> On Sep 15, 2018, at 7:27 PM, Philip McGrath <phi...@philipmcgrath.com> wrote:
> 
> Sure. For example:
> 
> #lang racket
> 
> (require syntax/parse/define
>          rackunit)
> 
> (define-syntax-parser foo
>   [(_ arg:id)
>    #''arg]
>   [(_ arg:expr)
>    #'arg])
> 
> (check-eqv? (foo 10) 10)
> (check-eq? (foo hello) 'hello)
> (check-pred procedure? (foo (λ (x) (* 2 x))))
> 
> -Philip
> 
> 
> On Sat, Sep 15, 2018 at 9:17 PM Kevin Forchione <lyss...@gmail.com 
> <mailto:lyss...@gmail.com>> wrote:
> Hi guys,
> Is there a way to define a macro so that an argument will be quoted only when 
> it is a symbol? Something like this:
> 
> (foo 10) => 10
> (foo hello) => ‘hello
> (foo (lambda (x) (* 2 x))) => <procedure>
> etc.

Thanks! That’s just what I wanted. Is there a way in Racket to determine if a 
quoted symbol has an associated procedure? 

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 
> <mailto:racket-users%2bunsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to