Commit | Line | Data |
---|---|---|
9da682ca RD |
1 | (in-package :parenscript) |
2 | ||
71089439 AL |
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))) | |
7590646c | 10 | |
3393fbce VS |
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) | |
b8307869 | 16 | ,@body)) |
3393fbce | 17 | |
9da682ca | 18 | ;;; DEPRECATED INTERFACE ;;; |
7590646c | 19 | |
0d971f14 VS |
20 | (defun js-equal (ps-form1 ps-form2) |
21 | (warn-deprecated 'js-equal) | |
22 | (equalp ps-form1 ps-form2)) | |
9da682ca | 23 | |
3393fbce | 24 | (defun-js js-compile compile-script (form) |
0d971f14 | 25 | (compile-script form)) |
9da682ca | 26 | |
3393fbce | 27 | (defun-js js-compile-list compile-script (form) |
0d971f14 | 28 | (compile-script form)) |
9da682ca | 29 | |
7590646c | 30 | (defmacro defjsmacro (&rest args) |
b5be3f57 | 31 | (warn-deprecated 'defjsmacro 'defpsmacro) |
4a987e2b | 32 | `(defpsmacro ,@args)) |
7590646c | 33 | |
5aa10005 | 34 | (defmacro js-inline (&rest body) |
0d971f14 | 35 | (warn-deprecated 'js-inline 'ps-inline) |
5aa10005 RD |
36 | `(js-inline* '(progn ,@body))) |
37 | ||
0d971f14 VS |
38 | (defun-js js-inline* ps-inline* (&rest body) |
39 | (apply #'ps-inline* body)) | |
7590646c VS |
40 | |
41 | (defmacro with-unique-js-names (&rest args) | |
0d971f14 VS |
42 | (warn-deprecated 'with-unique-js-names 'with-ps-gensyms) |
43 | `(with-ps-gensyms ,@args)) | |
7590646c | 44 | |
0d971f14 VS |
45 | (defun-js gen-js-name ps-gensym (&optional (prefix "_js_")) |
46 | (ps-gensym prefix)) | |
7590646c | 47 | |
4a987e2b | 48 | (defmacro js (&rest args) |
0d971f14 | 49 | (warn-deprecated 'js 'ps) |
4a987e2b VS |
50 | `(ps ,@args)) |
51 | ||
0d971f14 VS |
52 | (defun-js js* ps* (&rest args) |
53 | (apply #'ps* args)) |