base: Reorder a bit.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 23 Apr 2006 00:02:28 +0000 (01:02 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 23 Apr 2006 00:02:28 +0000 (01:02 +0100)
Nothing significant actually changed.

mdw-base.lisp

index 5203933..787255b 100644 (file)
@@ -99,24 +99,6 @@ where Y defaults to A if not specified."
     ((#\space #\tab #\newline #\return #\vt #\formfeed) t)
     (t nil)))
 
-(defmacro nlet (name binds &body body)
-  "Scheme's named let."
-  (multiple-value-bind (vars vals)
-      (loop for bind in binds
-           for (var val) = (pairify bind nil)
-           collect var into vars
-           collect val into vals
-           finally (return (values vars vals)))
-    `(labels ((,name ,vars
-               ,@body))
-       (,name ,@vals))))
-
-(defmacro while (cond &body body)
-  "If COND is false, evaluate to nil; otherwise evaluate BODY and try again."
-  `(loop
-     (unless `cond (return))
-     ,@body))
-
 (declaim (ftype (function nil ()) slot-unitialized))
 (defun slot-uninitialized ()
   "A function which signals an error.  Can be used as an initializer form in
@@ -150,6 +132,27 @@ gensyms will be bound to the corresponding VALUE."
         (car (more (mapcar #'pairify (listify binds)))))))
 
 ;;;--------------------------------------------------------------------------
+;;; Some simple yet useful control structures.
+
+(defmacro nlet (name binds &body body)
+  "Scheme's named let."
+  (multiple-value-bind (vars vals)
+      (loop for bind in binds
+           for (var val) = (pairify bind nil)
+           collect var into vars
+           collect val into vals
+           finally (return (values vars vals)))
+    `(labels ((,name ,vars
+               ,@body))
+       (,name ,@vals))))
+
+(defmacro while (cond &body body)
+  "If COND is false, evaluate to nil; otherwise evaluate BODY and try again."
+  `(loop
+     (unless `cond (return))
+     ,@body))
+
+;;;--------------------------------------------------------------------------
 ;;; with-places
 
 (defmacro %place-ref (getform setform newtmp)