[racket] Is this a bug in procedure 'primitive?' ?
On Sun, May 13, 2012 at 1:01 AM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> primitive? is only defined on values.
>
> thunk, let, lambda, etc are not values.
>
> They are syntactic forms and thus, for example, the expression
>
> (primitive? let)
>
> represents an ill-formed let expression (indeed, so does 'let')
Another way to say this is: primitive? is a function, and like all
functions, it can be applied only after its argument's value has been
computed.
But if we try to do something like this:
(define v let)
in an attempt to see what the value of 'let' is, then we'll find that
we can't even get a value from evaluating the raw "let". So we run
into the problem even before truly calling into "primitive?". Racket
doesn't currently have rules for getting a value from a raw use of
"let", "lambda", or "thunk": using these raw should raise a
compile-time syntax error.