1 (in-package :parenscript
)
3 (defun warn-deprecated (old-name new-name
)
4 (warn (format nil
"~:@(~a~) is deprecated. Use ~:@(~a~) instead." old-name new-name
)))
6 ;;; DEPRECATED INTERFACE ;;;
9 (warn-deprecated 'js-equal
'script-equal
)
12 (defun js-compile (form)
13 (warn-deprecated 'js-compile
'compile-script
)
14 (compile-script form
:output-spec
:javascript
))
16 (defun js-compile-list (form)
17 (warn-deprecated 'js-compile-list
'compile-script
)
18 (compile-script form
:output-spec
:javascript
))
20 (defun js-gensym (&rest args
)
21 (warn-deprecated 'js-gensym
'script-gensym
)
22 (apply #'script-gensym args
))
24 (defmacro defjsmacro
(&rest args
)
25 (warn-deprecated 'defjsmacro
'defscriptmacro
)
26 `(defscriptmacro ,@args
))
28 (defmacro js
(&body body
)
29 (warn-deprecated 'js
'ps
)
32 (defmacro js
* (&body body
)
33 (warn-deprecated 'js
* 'ps
*)
36 (defun js-to-string (expr)
37 "Given an AST node, compiles it to a Javascript string."
38 (warn "JS-TO-STRING is deprecated.")
40 (ps-js::js-to-statement-strings
(compile-script-form expr
) 0)
43 (defun js-to-line (expr)
44 "Given an AST node, compiles it to a Javascript string."
45 (warn "JS-TO-LINE is deprecated.")
47 (ps-js::js-to-statement-strings
(compile-script-form expr
) 0) " "))
49 (defmacro js-file
(&rest body
)
50 (warn "JS-FILE is deprecated.")
55 (defmacro js-script
(&rest body
)
56 (warn "JS-SCRIPT is deprecated.")
57 `((:script
:type
"text/javascript")
58 (:princ
(format nil
"~%// <![CDATA[~%"))
60 (:princ
(format nil
"~%// ]]>~%"))))
62 (defmacro js-inline
(&rest body
)
63 (warn "JS-INLINE is deprecated.")
64 `(js-inline* '(progn ,@body
)))
66 (defmacro js-inline
* (&rest body
)
67 (warn "JS-INLINE* is deprecated.")
68 `(concatenate 'string
"javascript:"
69 (string-join (js-to-statement-strings (compile-script-form (list 'progn
,@body
)) 0) " ")))
71 (defmacro with-unique-js-names
(&rest args
)
72 (warn-deprecated 'with-unique-js-names
'with-unique-ps-names
)
73 `(with-unique-ps-names ,@args
))
75 (defmacro gen-js-name
(&rest args
)
76 (warn-deprecated 'gen-js-name
'gen-ps-name
)
77 `(gen-ps-name ,@args
))
79 (defmacro gen-js-name-string
(&rest args
)
80 (warn-deprecated 'gen-js-name-string
'gen-script-name-string
)
81 `(gen-script-name-string ,@args
))