1 (in-package :parenscript
)
3 (define-condition simple-style-warning
(simple-condition style-warning
)
6 (defun warn-deprecated (old-name &optional new-name
)
7 (warn 'simple-style-warning
8 :format-control
"~:@(~a~) is deprecated~:[.~;, use ~:@(~a~) instead~]"
9 :format-arguments
(list old-name new-name new-name
)))
11 (defmacro defun-js
(old-name new-name args
&body body
)
12 `(defun ,old-name
,args
13 ,(when (and (stringp (car body
)) (< 1 (length body
))) ;; docstring
15 (warn-deprecated ',old-name
',new-name
)
18 ;;; DEPRECATED INTERFACE ;;;
20 (defun js-equal (ps-form1 ps-form2
)
21 (warn-deprecated 'js-equal
)
22 (equalp ps-form1 ps-form2
))
24 (defun-js js-compile compile-script
(form)
25 (compile-script form
))
27 (defun-js js-compile-list compile-script
(form)
28 (compile-script form
))
30 (defmacro defjsmacro
(&rest args
)
31 (warn-deprecated 'defjsmacro
'defpsmacro
)
34 (defmacro js-inline
(&rest body
)
35 (warn-deprecated 'js-inline
'ps-inline
)
36 `(js-inline* '(progn ,@body
)))
38 (defun-js js-inline
* ps-inline
* (&rest body
)
39 (apply #'ps-inline
* body
))
41 (defmacro with-unique-js-names
(&rest args
)
42 (warn-deprecated 'with-unique-js-names
'with-ps-gensyms
)
43 `(with-ps-gensyms ,@args
))
45 (defun-js gen-js-name ps-gensym
(&optional
(prefix "_js_"))
48 (defmacro js
(&rest args
)
49 (warn-deprecated 'js
'ps
)
52 (defun-js js
* ps
* (&rest args
)