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 js-equal script-equal
(a b
)
23 (defun-js js-compile compile-script
(form)
24 (compile-script form
:output-spec
:javascript
))
26 (defun-js js-compile-list compile-script
(form)
27 (compile-script form
:output-spec
:javascript
))
29 (defmacro defjsmacro
(&rest args
)
30 (warn-deprecated 'defjsmacro
'defpsmacro
)
31 `(defscriptmacro ,@args
))
33 (defmacro js-file
(&rest body
)
34 (warn-deprecated 'js-file
)
39 (defmacro js-script
(&rest body
)
40 (warn-deprecated 'js-script
)
41 `((:script
:type
"text/javascript")
42 (:princ
(format nil
"~%// <![CDATA[~%"))
44 (:princ
(format nil
"~%// ]]>~%"))))
46 (defmacro js-inline
(&rest body
)
47 (warn-deprecated 'js-inline
)
48 `(js-inline* '(progn ,@body
)))
50 (defmacro js-inline
* (&rest body
)
51 (warn-deprecated 'js-inline
*)
52 `(concatenate 'string
"javascript:"
53 (string-join (js-to-statement-strings (compile-script-form (list 'progn
,@body
)) 0) " ")))
55 (defmacro with-unique-js-names
(&rest args
)
56 (warn-deprecated 'with-unique-js-names
'with-unique-ps-names
)
57 `(with-unique-ps-names ,@args
))
59 (defmacro gen-js-name
(&rest args
)
60 (warn-deprecated 'gen-js-name
'gen-ps-name
)
61 `(gen-ps-name ,@args
))
63 (defmacro gen-js-name-string
(&rest args
)
64 (warn-deprecated 'gen-js-name-string
'gen-script-name-string
)
65 `(gen-script-name-string ,@args
))