I posted some other easy code, to clarify what's happening
When I use eval
on the following code
#lang racket
(define (test )
`( (define num 1)
(define l (list))
(define num2 (add1 num))
(displayln num2)))
(eval (test) (make-base-namespace))
racket screams at me define-values: not in a definition context in: (define-values (num) 1)
My questions are:
- How to make
eval
work on definition? - If
eval
is not designed to work on definitions, then is there some workarounds that can make it work?
I appreciate any help!
I think this might be an alternative way to the thing I want to do in here: How can I unsplice a list of expression into code?