Implemented WHEN, UNLESS, TRACE and UNTRACE.

Pascal J. Bourguignon [2014-10-10 02:19]
Implemented WHEN, UNLESS, TRACE and UNTRACE.
Filename
standard-macros.lisp
diff --git a/standard-macros.lisp b/standard-macros.lisp
index bff90ab..afc9065 100644
--- a/standard-macros.lisp
+++ b/standard-macros.lisp
@@ -39,7 +39,6 @@
 ;;;;    Software Foundation, Inc., 59 Temple Place, Suite 330,
 ;;;;    Boston, MA 02111-1307 USA
 ;;;;**************************************************************************
-
 (in-package "STANDARD-MACROS")

 ;; (CALL-NEXT-METHOD                        "Local Function")
@@ -56,9 +55,6 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


-
-
-
 (defmacro defun (name lambda-list &body body)
   `(progn
      (setf (symbol-value ',name)
@@ -437,6 +433,10 @@
 (defmacro etypecase ()
   `())

+(defmacro typecase ()
+  `())
+
+


 (defmacro incf ()
@@ -468,23 +468,32 @@
 (defmacro do* ()
   `())

-(defmacro do-all-symbols ()
+(defmacro dolist ()
   `())

-(defmacro do-external-symbols ()
+(defmacro dotimes ()
   `())

-(defmacro do-symbols ()
-  `())

-(defmacro dolist ()
-  `())

-(defmacro dotimes ()
-  `())

-(defmacro formatter ()
-  `())
+
+
+(defmacro formatter (control-string)
+  ;; This is not simple…
+  ;;
+  ;; The function generated, should process the arguments according to
+  ;; control-string and return the tail that is not processed.  But
+  ;; control-string may process a variable number of arguments
+  ;; depending on them their values.
+  ;;
+  ;; Therefore this arguments-tail must be computed at the same time
+  ;; the arguments are actually processed by the control-string.
+  ;;
+  ;; `(lambda (*standard-output* &rest arguments)
+  ;;    (apply #'format t ',control-string arguments)
+  ;;    arguments-tail)
+  )

 (defmacro handler-bind ()
   `())
@@ -587,52 +596,72 @@
   `())

 (defmacro trace ()
-  `())
+  `(progn ,@(mapcar (lambda (fname) `(trace-function ',fname)) function-names)))

-(defmacro typecase ()
-  `())
+(defmacro untrace (&rest function-names)
+  `(progn ,@(mapcar (lambda (fname) `(untrace-function ',fname)) function-names)))

-(defmacro unless ()
-  `())

-(defmacro untrace ()
-  `())
+(defmacro unless (test-form &body body)
+  `(if ,test-form nil (progn ,@body)))
+
+(defmacro when (test-form &body body)
+  `(if ,test-form (progn ,@body)))

-(defmacro when ()
-  `())

 (defmacro with-accessors ()
   `())

+(defmacro with-slots ()
+  `())
+
+
+
 (defmacro with-compilation-unit ()
   `())

+
 (defmacro with-condition-restarts ()
   `())

+(defmacro with-simple-restart ()
+  `())
+
+
+
+(defmacro with-standard-io-syntax ()
+  `())
+
 (defmacro with-hash-table-iterator ()
   `())

-(defmacro with-input-from-string ()
+
+(defmacro with-package-iterator ()
   `())

-(defmacro with-open-stream ()
+(defmacro do-all-symbols ()
   `())

-(defmacro with-output-to-string ()
+(defmacro do-external-symbols ()
   `())

-(defmacro with-package-iterator ()
+(defmacro do-symbols ()
   `())

-(defmacro with-simple-restart ()
+
+
+(defmacro with-open-stream ()
   `())

-(defmacro with-slots ()
+
+(defmacro with-input-from-string ()
   `())

-(defmacro with-standard-io-syntax ()
+(defmacro with-output-to-string ()
   `())


+
+
+
 ;;;; THE END ;;;;
ViewGit