Skip to content
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

Maybe secure DO macros against variable capture #21

Open
phoe opened this issue Apr 14, 2021 · 2 comments
Open

Maybe secure DO macros against variable capture #21

phoe opened this issue Apr 14, 2021 · 2 comments

Comments

@phoe
Copy link

phoe commented Apr 14, 2021

18:58 < _death> phoe: another thing about screamer, I remember they warn about using stuff like 
                DOLIST/DOTIMES in nondeterministic functions, because it may not establish a new binding on 
                each iteration (it's implementation-defined).. but since they shadow CL symbols like DEFUN, 
                why not also shadow DOLIST and friends to provide just that?.. I've not tried it

While it's impossible to shield against this in the general case and it would be highly troublesome to do this for complex macros like loop or iterate, I think that the transformation for do and friends would be simple and possible.

Would exporting the fixed screamer:do and friends be worth it, be possible, and/or break anything that depends on them not being exported?

@nikodemus
Copy link
Owner

Not obvious to me, but sounds like worth a try.

@nikodemus
Copy link
Owner

I think at some point I was planning on adding a package SCREAMER-LISP, which one would use instead of CL. It would mostly just re-export things from CL, but provide its own definitions for things that need them, and possibly not export things that don't play well. (Though I think I was planning to have DEFUN be regular CL:DEFUN, and instead provide a separate DEFINE-ND-FUNCTION or similar as the equivalent of SCREAMER:DEFUN.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants