pika-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pika-dev] Simplifying the core-pika expression grammar


From: Matthew Dempsky
Subject: [Pika-dev] Simplifying the core-pika expression grammar
Date: 28 Feb 2004 17:12:45 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

After finally, getting enough of a macro expander/evaluator working
that I can have user defined macros I've made a few notes about the
core expression grammar.

Since the user doesn't write in core-pika at all, I was thinking of
two or three little changes that could be made to make the syntax a
little more verbose, but easier to process by the evaluator or
compiler (having a little experience with both now :-).

First, since we already need to support #~quote, it seems straight
forward to eliminate self-evaluating values and require them to be
quoted by the macro expander.  e.g. (+ '3 '4) rather than (+ 3 4).

Second, the only remaining core expression that's not a list are
variable references, so a #~value-of built-in expression would be nice
just for uniformity.  e.g. ((#~value-of +) '3 '4)

And finally, at this point the only expression that's not a keyword
tagged list are function calls, so I'm half tempted to recommend
changing the above to (#~call (#~value-of +) '3 '4), but I'm not
convinced yet on the advantage this would offer.  (Maybe a little bit
faster because it would simplify the dispatch code in eval, but not
something I've spent much time thinking about yet.)

My greatest concerns with recommending these changes are that 1) it
further distances core-pika from Scheme and 2) making it more verbose
means that interpreted code will bloat.  However, at the same time,
because it would make things easier to implement, I'm tempted to just
make the above changes and if at a later time the memory costs are
deemed too great to then come up with a fix.

On a rather less important note, BINDING-OF should be marked as
derived syntax, not core syntax[1].  :-)

-jivera

[1]: (define-syntax binding-of
       (syntax-rules ()
         ((_ ?symbol)
          (environment-binding (the-environment) '?symbol))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]