[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
eval, default-imports, and unexpected behavior
From: |
Diego |
Subject: |
eval, default-imports, and unexpected behavior |
Date: |
Mon, 15 Mar 2021 01:52:46 +0000 |
I was looking into ways to implement a 'clean' r5rs or r7rs environment in the
csi repl through csi options, and noticed that by default `eval-handler` from
chicken.eval imports `default-imports` and `default-syntax-imports`
This has at least two consequences:
a) the following lines that do these imports in csi.scm are superfluous
(removing them doesn't seem to change csi's behavior, since csi depends on eval
and therefore eval-handler):
(eval `(import-for-syntax ,@default-syntax-imports))
(eval `(import ,@default-imports))
b) You can get what is in my opinion unexpected behavior, for example running
the following interpreted or compiled code works (but shouldn't):
(module hey ()
(import scheme)
(eval '(print 'hey)))
Is this expected, or should this be reworked somewhat?
As a side note, this also might make it slightly harder to have a more minimal
environment in the repl (e.g. one that doesn't include chicken.base, towards my
previously stated goals) but maybe that's just a matter of playing with the
eval-handler parameter...
- Diego
- eval, default-imports, and unexpected behavior,
Diego <=