[racket] Use of map and eval to evaluate symbol in namespace

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Aug 10 05:22:11 EDT 2014

On Sun, Aug 10, 2014 at 3:59 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>
> It's true that `eval` works as way to get reflective operations in
> general, but it's better (again, for error checking and for
> efficiency) when a language construct is accompanied with specific
> reflective operations.  [...] But if `keyword-apply` didn't exist,
> then this example would make me think that some form of abstraction
> was missing for keyword arguments, instead of seeming like a good use
> of `eval`.

+7 -- it's a nice demonstration of what I started with: use eval only
when you need the ability to evaluate all expressions, is this what you
need?  -- No, I just want to apply functions with an unknown keyword...

It's interesting to note that in Javascript there are many common uses
of eval, which are indeed pointers at missing features of the language.
(And only in rare cases the features get added -- as in the case of
parsing JSON (which pointed to a missing `read' feature).)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.