projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
53a9b4e
)
Migrate js!bool and js!selfcall
author
David Vázquez
<davazp@gmail.com>
Sat, 22 Jun 2013 08:32:01 +0000
(10:32 +0200)
committer
David Vázquez
<davazp@gmail.com>
Sat, 22 Jun 2013 08:32:01 +0000
(10:32 +0200)
src/compiler.lisp
patch
|
blob
|
history
diff --git
a/src/compiler.lisp
b/src/compiler.lisp
index
1221ff7
..
b4e1eaf
100644
(file)
--- a/
src/compiler.lisp
+++ b/
src/compiler.lisp
@@
-50,7
+50,7
@@
;;; Wrap X with a Javascript code to convert the result from
;;; Javascript generalized booleans to T or NIL.
(defun js!bool (x)
;;; Wrap X with a Javascript code to convert the result from
;;; Javascript generalized booleans to T or NIL.
(defun js!bool (x)
- `(code "(" ,x "?" ,(ls-compile t) ": " ,(ls-compile nil) ")"))
+ `(if ,x ,(ls-compile t) ,(ls-compile nil)))
;;; Concatenate the arguments and wrap them with a self-calling
;;; Javascript anonymous function. It is used to make some Javascript
;;; Concatenate the arguments and wrap them with a self-calling
;;; Javascript anonymous function. It is used to make some Javascript
@@
-58,10
+58,7
@@
;;; It could be defined as function, but we could do some
;;; preprocessing in the future.
(defmacro js!selfcall (&body body)
;;; It could be defined as function, but we could do some
;;; preprocessing in the future.
(defmacro js!selfcall (&body body)
- ``(code "(function(){" ,*newline*
- (code ,,@body)
- ,*newline*
- "})()"))
+ ``(call (function nil (code ,,@body))))
;;; Like CODE, but prefix each line with four spaces. Two versions
;;; of this function are available, because the Ecmalisp version is
;;; Like CODE, but prefix each line with four spaces. Two versions
;;; of this function are available, because the Ecmalisp version is