[Scheme-reports] quasiquote and cycles Per Bothner (03 Jul 2011 05:09 UTC)
Re: quasiquote and cycles Arthur A. Gleckler (05 Jul 2011 17:28 UTC)

[Scheme-reports] quasiquote and cycles Per Bothner 03 Jul 2011 03:27 UTC

What is the thinking as to how quasiquote interacts with
self-referential data structures?  Does anyone have an
algorithm to translate these?

Is this valid?  Should it be?

`#0=(,x #0#)

One could translate this into:

(let ((tmp (cons x #f)))
   (set-cdr! tmp tmp)
   tmp)

Still, a general algorithm doesn't look exactly trivial,
and I haven't seen a published algorithm that does this.
Bonus points for an algorithm that tries to re-use the
reader objects when possible (i.e. that avoids needless
copying).
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports