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

Add SRFI-156 - Syntactic combiners for binary predicates #54

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

jpellegrini
Copy link
Contributor

There was one macro which the reference implementation contains, using syntax-rules, which did not work in STklos, so I write another, using define-macro. All tests pass.

  • the problem was that STklos introduces identical symbols in different phases of macro expansion using syntax rules:
(define-syntax f
  (syntax-rules (k)
    ((f) #f)
    ((f k) 'K)
    ((f k x ...) (a (f x ...)))))

Here's the STklos expansion:

stklos> (macro-expand* '(f k k k))
(a (a 'K))

some other implementations will return

(a.0 (a.1 'K))

Anyway, not a problem, since we have define-macro!

@jpellegrini
Copy link
Contributor Author

stklos> (macro-expand* '(f k k k)) (a (a 'K))

Actually, this seems to affect other SRFIs too. I'll take a look. It seems like, when a macro introduces a new symbol, it should be generated by gensym, and this is not happening...

@jpellegrini
Copy link
Contributor Author

I have filed issue #55 about this.

@egallesio egallesio merged commit 141a390 into egallesio:master Jul 13, 2020
@egallesio
Copy link
Owner

OK. I have sen issue #55. I suppose it will not be simple to correct (I did not wrote this code, and I always have difficulties with it).
I 'll look at the issue asap.
In the meantime, I merge this pool request.

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

Successfully merging this pull request may close these issues.

2 participants