marcomaggi / vicare

A native compiler for Scheme compliant with R6RS
http://marcomaggi.github.com/vicare.html
Other
200 stars 34 forks source link

Graph syntax reader bug #14

Open ijp opened 14 years ago

ijp commented 14 years ago

I just installed Vicare Scheme and came across a bug in the reader, it is also present in Ikarus. If you are constructing a graph using reader syntax as opposed to by mutating the list explicitly, and you forget the quote, then it will hang your system.

'#0=(a b c #0#)

0=(a b c #0#)

0=(a b c #0#)

hangs

While I am sure that this is a bug, I am not sure whether or not the 'correct' solution is to have this be an error, or to allow it a la bytevectors.

marcomaggi commented 14 years ago

The reader works fine, the problem is somewhere around the call to LOAD-R6RS-SCRIPT in "ikarus.main.ss"; that is: the expander (probably) or the compiler enters an infinite loop while visiting the recursive input S-Expression.

I agree that it would be nice to detect this problem and raise an error, but deep understanding of the expander is needed for this and I do not have it now. For the time being, I tag this as wont-fix, because graph notation is just a (sometimes useful) extension and not part of R6RS.

marcomaggi commented 13 years ago

More on this from Ikarus bug 809250 reported by Göran Weinholt:

Per Bothner posted a message on scheme-reports: http://lists.scheme-reports.org/pipermail/scheme-reports/2011-July/001142.html The context is that R7RS probably will have the syntax for self-referential data structures. The expression he posted gives an infinite loop in Ikarus:

Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1870, build 2010-11-07) Copyright (c) 2006-2009 Abdulaziz Ghuloum

`#0=(,x #0#) [Ikarus uses 100% cpu here.]