Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

What is fexpr in PHP? As I caught so far, It is a kinda function in Lisp language:

In Lisp programming languages, a fexpr is a function whose operands are passed to it without being evaluated.

I was reading an article which had deeply discussed PHP constructs, I faced fexpr there & Googling led me into the fact that it is fundamentally a Lisp concept!

That's why I can't clearly wrap my head around. Would you mind explain what fexpr is in PHP? and (if its semantically conceivable) Please provide an example & Use Case.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
272 views
Welcome To Ask or Share your Answers For Others

1 Answer

Simply put - it's the thing that enables "functions" like isset() and empty() to accept possibly undefined variables.

That's only possible because they aren't actually functions, but language keywords (try declaring classes with those names, it won't work) recognized by the parser and then executed by the compiler. A regular function is executed at runtime.

If that doesn't answer your question, then you'd first need to understand what compilers and runtimes are ... I'm afraid that's too broad to explain here.

Other than that, I don't know Lisp, but I can only assume that "fexpr" is a prominent feature in that language. As in, you could possibly declare your own fexpr-essions - PHP doesn't have this; it just utilizes the concept for a few special cases.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...