namespaces + eval + reader

31 views
Skip to first unread message

Shriram Krishnamurthi

unread,
Jul 30, 2020, 10:01:38 PM7/30/20
to Racket Users
 want to create a namespace for (say) the BSL language in DrRacket. Critically, I need the reader to be aligned with this language. Otherwise, small semantic discrepancies creep in.

Concrete example:

> (define n (make-base-namespace))
> (eval `(require lang/htdp-beginner) n)
> (eval `(equal? 3 3.0) n)
#f

However, in BSL,

Language: Beginning Student; memory limit: 128 MB.
> (equal? 3 3.0)
#true

The expressions being `eval`ed are coming from a file, via `read`. I have the freedom to change things there.

Thanks,
Shriram

Jens Axel Søgaard

unread,
Jul 31, 2020, 5:17:54 AM7/31/20
to Shriram Krishnamurthi, Racket Users
Den fre. 31. jul. 2020 kl. 04.01 skrev Shriram Krishnamurthi <shr...@gmail.com>:
 want to create a namespace for (say) the BSL language in DrRacket. Critically, I need the reader to be aligned with this language. Otherwise, small semantic discrepancies creep in.
... 

The expressions being `eval`ed are coming from a file, via `read`. I have the freedom to change things there.


If not, you can at least see how the reader is configured in lines 46-48:

[read-case-sensitive (lookup 'read-case-sensitive table)]
[read-decimal-as-inexact #f]
[read-accept-dot #f] /Jens Axel
Reply all
Reply to author
Forward
0 new messages