mac (01/22/83)
; The following is a LISP macro which can be used to construct circular ; and otherwise tangled list structures, without a lot of rplacas & ; replacds. It's somewhat like the LET REC of ISWIM. ; ; Such a construct is described in Morris & Schwarz, "Computing Cyclic ; List Structures", in the 1980 LISP conference. ; It has the restriction that the results must be cons cells, not atoms. ; ; This construct is more useful in SCHEME, where it can replace the LABELS ; construct for defining (mutually) recursive functions. It's convenient ; in that it's not restricted to defining lambda expressions. ; ; e.g. (fix ((x (cons 'atom x))) x) ; constructs a circular list of 'atom (fix ((loop (list 'cond ; constructs a loop '(done result) (list 't '(do-something) loop ) ) ) (fun (list 'lambda () loop)) ) (fun) ; ... and executes it ) ; (macro source in net.sources)