Re: [racket-users] Re: catch and bind an unbound id in a macro

2019-04-21 Thread zeRusski
On Saturday, 20 April 2019 23:55:50 UTC+1, Stephen Chang wrote: > > fwiw, I think here is a working version along the lines of your > original attempt. > I see what you did there. This is both icky (as requested) and cute :0 Thanks, it's actually illuminating -- You received this message

Re: [racket-users] Re: catch and bind an unbound id in a macro

2019-04-20 Thread Stephen Chang
fwiw, I think here is a working version along the lines of your original attempt. #lang racket (require (for-syntax syntax/parse)) (define-syntax set/define (syntax-parser [(_ h k v) #:when (with-handlers ([exn:fail:syntax:unbound? (lambda _ #f)]) (local-expand #'h

Re: [racket-users] Re: catch and bind an unbound id in a macro

2019-04-20 Thread Shu-Hung You
identifier-binding returns #f for top-level bindings. I believe make-base-eval is evaluating expressions at top-level. On Sat, Apr 20, 2019 at 4:56 PM Ryan Kramer wrote: > > Below is a short example showing that identifier-binding doesn't seem to work > quite right with Scribble's

Re: [racket-users] Re: catch and bind an unbound id in a macro

2019-04-20 Thread Alexis King
The third argument to identifier-binding, top-level-symbol?, controls the result of identifier-binding when the identifier is bound to a top-level binding (and both the REPL and sandboxed evaluators are kinds of top-level evaluation). The docs elaborate this way: > The result is (list