Is #%top
what you are looking for?
#lang racket
(require syntax/parse/define)
(define-simple-macro (#%top . x) 'x)
(define x 42)
x ;=> 42
y ;=> 'y
(string-length (symbol->string abcdef)) ;=> 6
Unbound identifiers are wrapped with #%top
during expansion steps, so you can define #%top
to deal with unbound ids. For instance, Pollen by default uses #%top
to create default tags.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/EB9B5188-4B62-42BB-B24F-2B95166E95F7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
On Jun 20, 2019, at 10:18 PM, Sorawee Porncharoenwase <sorawe...@gmail.com> wrote:
#lang racket (require syntax/parse/define) (define-simple-macro (#%top . x) 'x) (define x 42) x ;=> 42 y ;=> 'y (string-length (symbol->string abcdef)) ;=> 6
Unbound identifiers are wrapped with
#%top
during expansion steps, so you can define#%top
to deal with unbound ids. For instance, Pollen by default uses#%top
to create default tags.
Wow! That does appear to be just what I’ve been looking for.