/[cl-monad-macros]/trunk/cl-monad-macros.lisp
ViewVC logotype

Diff of /trunk/cl-monad-macros.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6 by dsorokin, Wed Jan 27 17:57:53 2010 UTC revision 7 by dsorokin, Wed Jan 27 17:59:48 2010 UTC
# Line 43  Line 43 
43     :with-monad-trans     :with-monad-trans
44     :with-inner-monad-trans     :with-inner-monad-trans
45     :with-outer-monad-trans     :with-outer-monad-trans
    :universal-let!  
    :universal-progn!  
46     :unit     :unit
47     :funcall!     :funcall!
48     :let!     :let!
# Line 100  Line 98 
98       ,@body))       ,@body))
99    
100  ;;;  ;;;
 ;;; The Bind Macros  
 ;;;  
   
 (defmacro universal-progn! (&body ms)  
   (reduce #'(lambda (m1 m2)  
               (let ((x (gensym)))  
                 `(funcall!  
                   #'(lambda (,x)  
                       (declare (ignore ,x))  
                       ,m2)  
                   ,m1)))  
           ms  
           :from-end t))  
   
 (defmacro universal-let! (decls m)  
   (reduce #'(lambda (decl m)  
               (destructuring-bind (x e) decl  
                 `(funcall! #'(lambda (,x) ,m) ,e)))  
           decls  
           :from-end t  
           :initial-value m))  
   
 ;;;  
101  ;;; The Identity Monad  ;;; The Identity Monad
102  ;;;  ;;;
103    

Legend:
Removed from v.6  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.5