[racket] Compile-time evaluation
On Mon, Jul 29, 2013 at 1:53 PM, Vincent St-Amour <stamourv at ccs.neu.edu> wrote:
> Here's a quick solution:
>
> #lang racket
>
> (define-syntax-rule (hash-dot e)
> (let-syntax ([computed-e (lambda (stx) (datum->syntax #'e e))])
> (computed-e)))
>
> (hash-dot (+ 2 3))
>
In CL, #. is read-time, not compile-time, evaluation, so this isn't
quite the same. It would be easy to create a read-table that enabled
this, though. You'd have to make some decision about what environment
the read-time expression sees -- I don't know what CL does here.
Sam