##// END OF EJS Templates
Fix a bug in dynamic return
naryl -
r65:4e5eb097 default
parent child Browse files
Show More
@@ -1,11 +1,12 b''
1 1
2 2 (in-package txt2web.api)
3 3
4 (defpsmacro with-call-args (args &body body)
4 (defpsmacro with-call-args (args return &body body)
5 5 `(progn
6 6 (init-args ,args)
7 7 ,@body
8 (get-result)))
8 ,@(when return
9 '((get-result)))))
9 10
10 11 (defpsmacro with-frame (&body body)
11 12 `(progn
@@ -134,7 +134,7 b''
134 134 (dotimes (i 10)
135 135 (set-global "ARGS" i 0)
136 136 (set-global "$ARGS" i "")
137 (when (< i (length args))
137 (when (and args (< i (length args)))
138 138 (let ((arg (elt args i)))
139 139 (if (numberp arg)
140 140 (set-global "ARGS" i arg)
@@ -147,9 +147,8 b''
147 147 (defun call-loc (name args)
148 148 (setf name (chain name (to-upper-case)))
149 149 (with-frame
150 (with-call-args args
151 (funcall (getprop *locs name))))
152 (void))
150 (with-call-args args t
151 (funcall (getprop *locs name)))))
153 152
154 153 (defun call-act (title)
155 154 (with-frame
@@ -90,16 +90,15 b''
90 90 `(progn
91 91 (when (stringp ,block)
92 92 (api:report-error "DYNAMIC can't evaluate arbitrary strings.\\nUse {braces} to create blocks for DYNAMIC."))
93 (api:with-call-args ,args
94 (funcall ,block))
95 (void)))
93 (api:with-call-args ,args nil
94 (funcall ,block))))
96 95
97 96 (defpsmacro dyneval (block &rest args)
98 97 `(progn
99 (when (stringp block)
98 (when (stringp ,block)
100 99 (api:report-error "DYNEVAL can't evaluate arbitrary strings.\\nUse {braces} to create blocks for DYNEVAL."))
101 (api:with-call-args args
102 (funcall block))))
100 (api:with-call-args ,args t
101 (funcall ,block))))
103 102
104 103 ;;; 11main
105 104
General Comments 0
You need to be logged in to leave comments. Login now