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