什么是PHP中的fexpr? [英] What is fexpr in php?

查看:201
本文介绍了什么是PHP中的fexpr?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHP中的 fexpr 是什么?正如我到目前为止所捕获的,它是Lisp语言中的一种有用函数:


在Lisp编程语言中,fexpr是一个函数,其操作数是传递给它没有被评估。

我正在阅读深入讨论PHP构造的文章,我面对 fexpr <那里&谷歌搜索引导我进入一个事实,它基本上是一个Lisp概念!



这就是为什么我不能清楚地包裹我的头。你介意在PHP中 fexpr 是什么?和(如果其语义上可以想象)请提供一个例子&使用大小写。

解决方案

简单地说 - 这就是使像 isset() empty()来接受可能未定义的变量。 这是唯一可能的,因为它们不是实际上是函数,但是语言关键字(尝试声明带有这些名称的类,它不起作用)由解析器识别,然后由编译器执行。
常规函数在运行时执行。



如果这不能回答您的问题,那么您首先需要了解编译器和运行时是什么。 ..恐怕这太宽泛了,不能在这里解释。



除此之外,我不知道Lisp,但我只能假设fexpr是一个该语言的突出特点。如你所说,你可能会声明你自己的fexpr-essions - PHP没有这个;它只是将这个概念用于一些特殊情况。


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.

解决方案

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.

这篇关于什么是PHP中的fexpr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆