lips icon indicating copy to clipboard operation
lips copied to clipboard

Parsing of recursive array literals

Open jcubic opened this issue 1 year ago • 2 comments

This code:

(write '(1 2 #0=#(1 2 #0#)))

Prints:

(1 2 #(1 2 #<DatumReference>))

On the first type it threw an error about expecting parenthesis but #<eof> found. I was not able to repeat this error.

DatumReference is an internal value of the parser, and it should never be exposed.

jcubic avatar Aug 30 '24 13:08 jcubic

This is problematic, because the parser need to mutate the array in order to add self reference. But the & and # syntax extensions use freeze on the array/object to prevent mutation.

jcubic avatar Sep 08 '24 23:09 jcubic

Let's remove the immutability from the array and objects literals. Proper recursive reference is more important.

jcubic avatar Jan 31 '25 14:01 jcubic