Whitespaceification: removed indentation tabs throughout project.
[clinton/parenscript.git] / src / deprecated-interface.lisp
1 (in-package :parenscript)
2
3 (define-condition simple-style-warning (simple-condition style-warning)
4 ())
5
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)))
10
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
14 (car body))
15 (warn-deprecated ',old-name ',new-name)
16 ,@body))
17
18 ;;; DEPRECATED INTERFACE ;;;
19
20 (defun js-equal (ps-form1 ps-form2)
21 (warn-deprecated 'js-equal)
22 (equalp ps-form1 ps-form2))
23
24 (defun-js js-compile compile-script (form)
25 (compile-script form))
26
27 (defun-js js-compile-list compile-script (form)
28 (compile-script form))
29
30 (defmacro defjsmacro (&rest args)
31 (warn-deprecated 'defjsmacro 'defpsmacro)
32 `(defpsmacro ,@args))
33
34 (defmacro js-inline (&rest body)
35 (warn-deprecated 'js-inline 'ps-inline)
36 `(js-inline* '(progn ,@body)))
37
38 (defun-js js-inline* ps-inline* (&rest body)
39 (apply #'ps-inline* body))
40
41 (defmacro with-unique-js-names (&rest args)
42 (warn-deprecated 'with-unique-js-names 'with-ps-gensyms)
43 `(with-ps-gensyms ,@args))
44
45 (defun-js gen-js-name ps-gensym (&optional (prefix "_js_"))
46 (ps-gensym prefix))
47
48 (defmacro js (&rest args)
49 (warn-deprecated 'js 'ps)
50 `(ps ,@args))
51
52 (defun-js js* ps* (&rest args)
53 (apply #'ps* args))