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 b
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 'expre
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 make-base-eval
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 source-id)
Below is a short example showing that identifier-binding doesn't seem to
work quite right with Scribble's make-base-eval. It works fine with
make-evaluator from racket/sandbox.
I'm not sure why this is, but using syntax-local-value instead works
everywhere. (Implementation here:
https://github
For what it's worth, Matthias' original answer has solved an issue I had. I
was using identifier-binding for something very similar and it worked fine,
except in my scribble examples. I had example 1 define foo, but then
example 2 (with the same evaluator) would not "see" foo via
identifier-bin
6 matches
Mail list logo