* boot-9.scm (collect): New syntax. Similar to begin but returns
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 12 Nov 1998 16:03:11 +0000 (16:03 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 12 Nov 1998 16:03:11 +0000 (16:03 +0000)
a list of the results of all forms in the sequence instead of the
result of the last form.

ice-9/ChangeLog
ice-9/boot-9.scm

index 08d8c83..2f22160 100644 (file)
@@ -1,3 +1,9 @@
+1998-11-13  Mikael Djurfeldt  <mdj@barbara.nada.kth.se>
+
+       * boot-9.scm (collect): New syntax.  Similar to begin but returns
+       a list of the results of all forms in the sequence instead of the
+       result of the last form.
+
 1998-11-10  Mikael Djurfeldt  <mdj@barbara.nada.kth.se>
 
        * boot-9.scm (values, call-with-values): Moved here from
index 31909fe..f7c59c2 100644 (file)
            (lambda () (continue))
            (lambda v (cadr v)))))
 
+;;; {collect}
+;;;
+;;; Similar to `begin' but returns a list of the results of all constituent
+;;; forms instead of the result of the last form.
+;;; (The definition relies on the current left-to-right
+;;;  order of evaluation of operands in applications.)
+
+(defmacro collect forms
+  (cons 'list forms))
 
 ;;; {with-fluids}