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

Recursive printing is broken #152

Open
pdarragh opened this issue Nov 28, 2023 · 1 comment
Open

Recursive printing is broken #152

pdarragh opened this issue Nov 28, 2023 · 1 comment

Comments

@pdarragh
Copy link
Contributor

When we have self-referential heap structures, the output loops infinitely and must be interrupted:

> (let ([v (make-vector 1 #t)]) (begin (vector-set! v 0 v) v))
#0='#(#0#)
> (run (compile (parse '(let ([v (make-vector 1 #t)]) (begin (vector-set! v 0 v) v)))))
^Cuser break [,bt for context]

It'd be nice to implement a (simple) check for these cases and indicate the recursion somehow.

@laelath
Copy link

laelath commented Nov 28, 2023

It looks like Racket resolves these by printing out the recursive equations i.e. for this example it prints #0='#(#0#).

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