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

Cycles don't print in REPL #313

Closed
jcubic opened this issue Feb 13, 2024 · 3 comments
Closed

Cycles don't print in REPL #313

jcubic opened this issue Feb 13, 2024 · 3 comments
Milestone

Comments

@jcubic
Copy link
Collaborator

jcubic commented Feb 13, 2024

This creates stack overflow:

lips> '#0=(a b c . #0#)

even that this works

(display '#0=(a b c . #0#))
;; ==> #0=(a b c . #0#)
(write '#0=(a b c . #0#))
;; ==> #0=(a b c . #0#)
@jcubic jcubic added this to the 1.0 milestone Feb 13, 2024
jcubic added a commit that referenced this issue Feb 13, 2024
@jcubic
Copy link
Collaborator Author

jcubic commented Feb 13, 2024

the problem was that the quote macro was running resolve_promises before marking the data as a cycle.

jcubic added a commit that referenced this issue Feb 13, 2024
@jcubic
Copy link
Collaborator Author

jcubic commented Feb 13, 2024

The better fix was to mark cycles on a parser level when a datum was used. This should not slow down the code.

@jcubic
Copy link
Collaborator Author

jcubic commented Feb 13, 2024

This fix also make this works (kind of):

lips> #0=(a b c . #0#)
Unbound variable `a'

There is a need for a function is_cycle() and the code should throw an error because the cycle is found in the code.

jcubic added a commit that referenced this issue Feb 13, 2024
@jcubic jcubic closed this as completed Feb 13, 2024
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

1 participant