> On Jul 8, 2019, at 10:50 AM, David Storrs <david.sto...@gmail.com> wrote:
> 
> 
> 
> On Mon, Jul 8, 2019 at 12:59 PM Kevin Forchione <lyss...@gmail.com 
> <mailto:lyss...@gmail.com>> wrote:
> Hi guys, 
> I’ve noticed that the library provides *some* syntax classes: id, str, char, 
> expo… for various datatypes, but not all. Obviously being such a handy aspect 
> of syntax-parse there’s probably a reason for this. Having spent a few days 
> trying to roll my own for procedure I have to suspect this isn’t a simple 
> thing. 
> 
> What’s the rationale in not reprinting them? 
> 
> Mat.* and/or others will be able to answer this more definitively, but I 
> suspect the issue is that syntax-parse works at phase 1, a macro-expansion 
> (similar to "compile time") phase, as opposed to runtime.  As a result, the 
> thing that will be in that slot is an sexp like (lambda (x) x) instead of a 
> #<procedure>.  It's easy to tell that the sexp is not an identifier, string, 
> etc, but determining if it will produce a #<procedure> requires actually 
> evaluating it -- what if it was (and foo bar) or (* x 9) instead of (lambda 
> (x) x)?

Yes, that’s been one of my thoughts well. For example, if it’s an identifier I 
can use syntax-case and a guard to check for identifier-binding, but the lambda 
case seems to mean interrogating the syntax for lambda, or relying on some 
syntactical structure pattern and then dealing with it later in a function. 

It’s a matter of control. I’m constantly being amazed at how rich the 
mechanisms are for manipulating syntax. And never surprised when there’s a 
better way to do it. The Racket development team have created something truly 
remarkable. 

Kevin

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/B6DE0408-2A01-42B6-A068-D49FB68B2CB8%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to