Commit | Line | Data |
---|---|---|
8e198a08 | 1 | (in-package :cl-user) |
171bbab3 | 2 | |
d31d0bc7 VS |
3 | (eval-when (:compile-toplevel :load-toplevel :execute) |
4 | (defparameter *parenscript-lang-exports* | |
171bbab3 RD |
5 | '( |
6 | ;; literals | |
7 | #:t | |
8 | #:f | |
9 | #:true | |
6f093623 | 10 | #.(symbol-name 'nil) ;; for case-sensitive Lisps like some versions of Allegro |
171bbab3 RD |
11 | #:this |
12 | #:false | |
13 | #:undefined | |
14 | ||
15 | ;; keywords | |
16 | #:break | |
17 | #:continue | |
18 | ||
19 | ;; array literals | |
20 | #:array | |
21 | #:list | |
22 | #:aref | |
23 | #:make-array | |
24 | ||
25 | ;; operators | |
26 | #:! #:not #:~ | |
27 | #:* #:/ #:% | |
28 | #:+ #:- | |
29 | #:<< #:>> | |
30 | #:>>> | |
31 | #:< #:> #:<= #:>= | |
32 | #:in | |
33 | #:eql #:== #:!= #:= | |
34 | #:=== #:!== | |
35 | #:& | |
36 | #:^ | |
37 | #:\| | |
38 | #:\&\& #:and | |
39 | #:\|\| #:or | |
40 | #:>>= #:<<= | |
41 | #:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~= | |
171bbab3 RD |
42 | #:1+ #:1- |
43 | #:incf #:decf | |
44 | ||
45 | ;; body forms | |
46 | #:progn | |
47 | ||
171bbab3 RD |
48 | ;; object literals |
49 | #:create | |
171bbab3 RD |
50 | #:with-slots |
51 | ||
52 | ;; macros | |
53 | #:macrolet | |
54 | #:symbol-macrolet | |
55 | ||
56 | ;; if | |
57 | #:if | |
58 | #:when | |
59 | #:unless | |
60 | ||
61 | ;; single argument statements | |
62 | #:return | |
63 | #:throw | |
64 | ||
65 | ;; single argument expressions | |
66 | #:delete | |
67 | #:void | |
68 | #:typeof | |
69 | #:instanceof | |
70 | #:new | |
71 | ||
d31d0bc7 | 72 | ;; assignment and binding |
171bbab3 | 73 | #:setf |
d31d0bc7 | 74 | #:defsetf |
58c4ef4f VS |
75 | #:let* |
76 | #:lexical-let* | |
171bbab3 RD |
77 | |
78 | ;; variables | |
58c4ef4f | 79 | #:var |
171bbab3 RD |
80 | #:defvar |
81 | ||
82 | ;; iteration | |
83 | #:for | |
84 | #:doeach | |
85 | #:while | |
86 | ||
87 | ;; with | |
88 | #:with | |
89 | ||
90 | ;; case | |
91 | #:switch | |
92 | #:case | |
93 | #:default | |
94 | ||
95 | ;; try throw catch | |
96 | #:try | |
97 | ||
98 | ;; regex literals | |
99 | #:regex | |
100 | ||
101 | ;; conditional compilation (IE) | |
d31d0bc7 VS |
102 | #:cc-if |
103 | ||
104 | ;; function definition | |
105 | #:defun | |
106 | #:lambda | |
46f794a4 | 107 | |
d31d0bc7 VS |
108 | ;; lambda lists |
109 | #:&key | |
110 | #:&rest | |
111 | #:&body | |
112 | #:&optional | |
113 | #:&aux | |
114 | #:&environment | |
115 | #:&key-object | |
46f794a4 | 116 | |
d31d0bc7 VS |
117 | ;; slot access |
118 | #:with-slots | |
119 | #:slot-value | |
46f794a4 | 120 | |
d31d0bc7 VS |
121 | ;; macros |
122 | #:macrolet | |
123 | #:symbol-macrolet | |
124 | #:define-symbol-macro | |
125 | #:define-script-symbol-macro | |
126 | #:defmacro | |
171bbab3 | 127 | |
d31d0bc7 VS |
128 | ;; lisp eval |
129 | #:lisp | |
171bbab3 | 130 | |
d31d0bc7 VS |
131 | ;; iteration |
132 | #:do | |
133 | #:dotimes | |
134 | #:dolist | |
135 | #:doeach | |
136 | #:while | |
171bbab3 | 137 | |
d31d0bc7 | 138 | ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v |
171bbab3 | 139 | |
d31d0bc7 VS |
140 | ;; CSS |
141 | #:css | |
142 | #:css-to-string | |
143 | #:css-inline | |
144 | #:css-file | |
171bbab3 | 145 | |
d31d0bc7 VS |
146 | ;; html generator for javascript |
147 | #:ps-html | |
dbb7017b | 148 | |
d31d0bc7 VS |
149 | ;; utils |
150 | #:do-set-timeout | |
c72e87d8 VS |
151 | #:min |
152 | #:max | |
153 | #:ceiling | |
154 | #:abs | |
155 | #:sin | |
156 | #:cos | |
157 | #:tan | |
158 | #:acos | |
159 | #:asin | |
160 | #:atan | |
161 | #:exp | |
162 | #:floor | |
163 | #:expt | |
164 | #:round | |
165 | #:random | |
166 | #:oddp | |
167 | #:evenp | |
168 | #:ignore-errors | |
169 | #:length | |
170 | #:null | |
171 | #:@ | |
172 | ||
352621e1 | 173 | ;; js runtime utils |
c72e87d8 VS |
174 | #:*ps-lisp-library* |
175 | #:mapcar | |
352621e1 VS |
176 | #:map-into |
177 | #:map | |
178 | #:map-until | |
179 | #:member | |
180 | #:append | |
181 | #:set-difference | |
d31d0bc7 VS |
182 | )) |
183 | "All symbols considerred part of the Parenscript language.") | |
171bbab3 | 184 | |
5aa10005 | 185 | (defpackage :parenscript |
4a987e2b | 186 | (:use :common-lisp) |
9da682ca | 187 | (:nicknames :js :ps) |
171bbab3 | 188 | #.(cons :export *parenscript-lang-exports*) |
d31d0bc7 VS |
189 | |
190 | ;;; symbols that form the interface to the Parenscript compiler | |
8e198a08 | 191 | (:export |
8e198a08 | 192 | ;; compiler |
9da682ca | 193 | #:compile-script |
7590646c VS |
194 | #:ps |
195 | #:ps* | |
33c100f0 VS |
196 | #:ps-inline |
197 | #:ps-inline* | |
9da682ca RD |
198 | |
199 | ;; for parenscript macro definition within lisp | |
4a987e2b | 200 | #:defpsmacro |
a19d2bde VS |
201 | #:defmacro/ps |
202 | #:defmacro+ps | |
ca493d55 | 203 | #:import-macros-from-lisp |
0b7a1d2f | 204 | |
7590646c | 205 | ;; gensym |
4a987e2b VS |
206 | #:ps-gensym |
207 | #:with-ps-gensyms | |
208 | #:*ps-gensym-counter* | |
551080b7 | 209 | |
edfaa07b | 210 | ;; naming and namespaces |
edfaa07b | 211 | #:ps-package-prefix |
0c542be0 VS |
212 | #:obfuscate-package |
213 | #:unobfuscate-package | |
edfaa07b | 214 | |
c639fe7f VS |
215 | ;; printer |
216 | #:*js-string-delimiter* | |
217 | #:*js-inline-string-delimiter* | |
218 | #:*ps-print-pretty* | |
219 | #:*indent-num-spaces* | |
220 | ||
9da682ca | 221 | ;; deprecated interface |
7590646c VS |
222 | #:gen-js-name |
223 | #:gen-js-name-string | |
224 | #:with-unique-js-names | |
9da682ca RD |
225 | #:defjsmacro |
226 | #:js-compile | |
9da682ca RD |
227 | #:js-inline |
228 | #:js-inline* | |
229 | #:js-file | |
230 | #:js-script | |
9da682ca | 231 | #:js-to-statement-strings |
4a987e2b VS |
232 | #:js |
233 | #:js* | |
58c4ef4f | 234 | #:let |
171bbab3 | 235 | )) |
f326f929 VS |
236 | |
237 | (defpackage :parenscript-special-forms | |
238 | (:use)) |