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

Interning symbols mechanism #106

Closed
jcubic opened this issue Dec 15, 2020 · 0 comments
Closed

Interning symbols mechanism #106

jcubic opened this issue Dec 15, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@jcubic
Copy link
Collaborator

jcubic commented Dec 15, 2020

eq? right now check if two values are symbols and compare the name properties of both symbols. But this is not how symbols and eq? should work, eq? should check if identity and there should always be single symbol of given name.

So all symbols should be saved when parsed or maybe easiest is to just modify LSymbol constructor.
NOTE that it gensyms symbols should not be interned so only symbols with strings should be interned.

The issue is hard to notice but this is one of core concepts of Scheme, it will not break anything.

var foo = (await lips.exec("'foo"))[0]
var bar = (await lips.exec("'foo"))[0]
foo === bar;
// false

this should return true.

@jcubic jcubic added the enhancement New feature or request label Dec 15, 2020
jcubic added a commit that referenced this issue Dec 16, 2020
@jcubic jcubic closed this as completed Dec 16, 2020
@jcubic jcubic added this to the 1.0 milestone Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant