I have a program that takes a (trusted) module form as a list and then
pulls out a provided value using this method. I used syntax/modread and
generate a pseudorandom id for each value of `trusted` here.

(define-namespace-anchor anchor)
(define module-namespace (namespace-anchor->namespace anchor))
(define (add trusted)
   (eval trusted module-namespace)
   (dynamic-require `',(cadr trusted) 'data))

Full disclosure: I don't know how to do better. I figured that this
wasn't the best way to do it to begin with because I get the following
error under `raco test`'s runtime configuration.

define-values: assignment disallowed;
  cannot re-define a constant
   constant: lifted/4
   in module:'pkgdef1620873248

I don't know what "lifted/4" is.

If I am bringing in module forms that I trust, what's the best way to
dynamically evaluate them and pull out a provided value without running
into that error?

--

~slg


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/e0a048c8-77ac-5126-5bef-226ecbe906dc%40sagegerard.com.

Reply via email to