HCoop
/
clinton
/
parenscript.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
765a54b
)
Renamed with-timeout to do-set-timeout, added ignore errors.
author
Vladimir Sedach
<vsedach@gmail.com>
Thu, 21 Jun 2007 17:54:16 +0000
(17:54 +0000)
committer
Vladimir Sedach
<vsedach@gmail.com>
Thu, 21 Jun 2007 17:54:16 +0000
(17:54 +0000)
Thanks to: John Fremlin <john@fremlin.org>
src/js-utils.lisp
patch
|
blob
|
blame
|
history
diff --git
a/src/js-utils.lisp
b/src/js-utils.lisp
index
31afd30
..
924840a
100644
(file)
--- a/
src/js-utils.lisp
+++ b/
src/js-utils.lisp
@@
-3,7
+3,7
@@
;;; Handy utilities for doing common tasks found in many web browser
;;; JavaScript implementations
-(defjsmacro
with
-timeout ((timeout) &body body)
+(defjsmacro
do-set
-timeout ((timeout) &body body)
`(set-timeout (lambda () ,@body) ,timeout))
;;; Arithmetic
@@
-29,3
+29,8
@@
(random (&optional upto) (if upto
`(floor (* ,upto (*math.random)))
'(*math.random))))
+
+;;; Exception handling
+
+(defjsmacro ignore-errors (&body body)
+ `(try (progn ,@body) (:catch (e))))