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

Support Quoting of Dotted Pairs #15

Open
iwillspeak opened this issue Jun 6, 2021 · 1 comment
Open

Support Quoting of Dotted Pairs #15

iwillspeak opened this issue Jun 6, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@iwillspeak
Copy link
Owner

Currently dotted pairs are quoted as a list conianing the dot as an identifier. It
seems like Scheme expectes them to be quoted as a pair instead. It could be
that we need to add support for pairs as a new literal type too.

Given:

'(a . b)

We expect it to become:

(a . b) ; ~> (pair (quote a) (quote b))

But in fact it becomes:

(a |.| b) ; ~> (list (quote a) (quote |.|) (quote b))
@iwillspeak iwillspeak added the bug Something isn't working label Jun 6, 2021
@iwillspeak
Copy link
Owner Author

Part of this comes down to the fact we should just support improper tails as parts of forms. The parsed form also needs modifying before we bind it. Maybe a separate CST and AST is the way forward here. CST could capture the raw representation of a given form, but the AST always represents it as Form(List, Option) where the second node is the improper tail.

Something like Rowan's red-green trees here might be the way forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant