[plt-scheme] Problems with dynamic-require and eval
Hi all,
The following snippet produces the output:
(1 2 3). reference to undefined identifier: mergesort
Why?
(let ((n (make-namespace)))
(parameterize ([current-namespace n])
(dynamic-require '(lib "list.ss") 'mergesort)
(display (mergesort '(2 1 3) <))
(eval '(mergesort '(5 4 6) <))))
The documentation for dynamic-require states that
the the name is imported into the current namespace,
which is what eval uses to evaluate the given expression.
For my purpose, I can use namespace-require in stead,
but I am curious to know, what I have missed.
--
Jens Axel Søgaard