-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SRFI 101: Purely Functional Random-Access Pairs and Lists #409
base: master
Are you sure you want to change the base?
Conversation
The
|
This one is tricky, since it requires the redefinition of very fundamental things like CAR and QUOTE. - Everything is defined inside the module with a prefix "srfi101:", and exported with renaming - The ideal way to use this SRFI is to prefix symbols when importing, otherwise one'd lose the standard car, list, quote etc. - Its tests are in a separate file, and loaded as a last thing in do-test.stk Issues: - When not renamed, quote enters a loop - Tests run fine and pass when called manually, but when inside the test system, they raise some kind of exception
Adapted to the new |
I'll have a look at this point. But as you said before, this is a more general problem with the redefinition of basic macros. |
Just registering one idea:
|
I just tried... That, by itself, doesn't help. But perhaps a new structure,
Maybe
|
I have this implemented, partially: stklos> (define x '(+ 2 3))
;; x
stklos> x
(+ 2 3)
stklos> (eval x)
5
stklos> (%self-evaluating? x)
#f
stklos> (%self-evaluate-set! x #t)
stklos> (%self-evaluating? x)
#t
stklos> (eval x)
(+ 2 3)
stklos> (%self-evaluate-set! x #f)
stklos> (%self-evaluating? x)
#f
stklos> (eval x)
5 Maybe this will make it easier to implement a redefinable EDIT: Not good -- quasiquote & recursive evaluation would defeat that. But a new |
Hi @egallesio !
One more R7RS-Large library...
This one is tricky, since it requires the redefinition of
very fundamental things like
CAR
andQUOTE
.Relevant points
srfi101:
, and exported with renamingimporting, otherwise one'd lose the standard car, list, quote
etc.
in
do-test.stk
:Issues:
quote
enters a looptest system, they raise some kind of exception
(1) is probably because
quote
is not a macro in STklos, but rather a special form, so the SRFI's customquote
macro will confuse the compiler:Maybe
quote
andquasiquote
could be turned into macros? I can take a look into that if you think it's ok.(2) is a mystery to me.
(All tests pass)
But if I run the full test suite, it fails.