Hayley Sha

2019-12-20 23:15:02 UTC

Is there a difference (besides the syntactical one) between

#'(lambda (y) (1+ y)) and

(lambda (y) (1+ y))?

#'(lambda (y) (1+ y)) and

(lambda (y) (1+ y))?

Discussion:

(too old to reply)

Hayley Sha

2019-12-20 23:15:02 UTC

Is there a difference (besides the syntactical one) between

#'(lambda (y) (1+ y)) and

(lambda (y) (1+ y))?

#'(lambda (y) (1+ y)) and

(lambda (y) (1+ y))?

Alan Bawden

2019-12-21 03:39:54 UTC

Is there a difference (besides the syntactical one) between

#'(lambda (y) (1+ y)) and

(lambda (y) (1+ y))?

((lambda (y) (1+ y)) 17)

But is illegal to write:

(#'(lambda (y) (1+ y)) 17)

I don't know if that difference is what you mean by "the syntactical one".

--

Alan Bawden

Alan Bawden

Kaz Kylheku

2019-12-21 04:12:04 UTC

Is there a difference (besides the syntactical one) between

#'(lambda (y) (1+ y)) and

(lambda (y) (1+ y))?

presented for evaluation, invokes a lambda macro. The expansion of that

macro is the former expression. The evaluation of *that* expression

calculates the function object.

So, under evaluation, they are equivalent via the macro expansion

of one to the other.

Under processing other than evaluation, they may not be equivalent.

Note that #'(lambda (...) ...) is not a Lambda Expression; it's

an (function ...) expression containing an embedded Lambda Expression.

A situation which requires a Lambda Expression, and doesn't evaluate the

expression, will almost certainly not accept #'(lambda ...).

One example of that is the first position of a compound form,

which is not evaluated, but permits a Lambda Expression.

Hayley Sha

2019-12-26 02:22:32 UTC

Loading...