[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

code walker -- ticl::let-if



Does let-if in TICL only bind special variables?

If so, the following should work.  I haven't tested it though.  Let us
know so that we can add it to the sources.

#+TI
(define-walker-template TICL::LET-IF                  walk-let-if)
#+TI
(defun walk-let-if (form context env)
  (let ((test (cadr form))
	(bindings (caddr form))
	(body (cdddr form)))
    (walk-form-internal
      `(let ()
	 (declare (special ,@(mapcar #'(lambda (x)
					 (if (listp x) (car x) x))
				     bindings)))
	 (flet ((.let-if-dummy. () ,@body))
	   (if ,test (let ,bindings (.let-if-dummy.))
	       (.let-if-dummy.))))
      context
      env)))
-------