b57330bc6a8f95c183e28f7677d506b043612630
[clinton/parenscript.git] / src / package.lisp
1 (in-package "CL-USER")
2
3 (eval-when (:compile-toplevel :load-toplevel :execute)
4 (defparameter *parenscript-lang-exports*
5 '(;; literals
6 #:t
7 #:f
8 #:true
9 #.(symbol-name 'nil) ; for case-sensitive Lisps like some versions of Allegro
10 #:this
11 #:false
12 #:undefined
13 #:{}
14
15 ;; keywords
16 #:break
17 #:continue
18
19 ;; array literals
20 #:array
21 #:list
22 #:aref
23 #:elt
24 #:make-array
25 #:[]
26
27 ;; operators
28 #:! #:not #:~
29 #:* #:/ #:%
30 #:+ #:-
31 #:<< #:>>
32 #:>>>
33 #:< #:> #:<= #:>=
34 #:in
35 #:eql #:== #:!= #:=
36 #:=== #:!==
37 #:&
38 #:^
39 #:\|
40 #:\&\& #:and
41 #:\|\| #:or
42 #:>>= #:<<=
43 #:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~=
44 #:incf #:decf
45
46 ;; compile-time stuff
47 #:eval-when
48
49 ;; body forms
50 #:progn
51
52 ;; object literals
53 #:create
54 #:with-slots
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
72 ;; assignment and binding
73 #:setf
74 #:defsetf
75 #:psetf
76 #:setq
77 #:psetq
78 #:simple-let*
79 #:simple-let
80 #:lexical-let*
81 #:lexical-let
82 #:let*
83 #:let
84
85 ;; variables
86 #:var
87 #:defvar
88
89 ;; iteration
90 #:labeled-for
91 #:for
92 #:for-in
93 #:while
94 #:do
95 #:do*
96 #:dotimes
97 #:dolist
98 #:loop
99
100 ;; with
101 #:with
102
103 ;; case
104 #:switch
105 #:case
106 #:default
107
108 ;; try throw catch
109 #:try
110
111 ;; regex literals
112 #:regex
113
114 ;; conditional compilation (IE)
115 #:cc-if
116
117 ;; function definition
118 #:defun
119 #:lambda
120 #:flet
121 #:labels
122
123 ;; lambda lists
124 #:&key
125 #:&rest
126 #:&body
127 #:&optional
128 #:&aux
129 #:&environment
130 #:&key-object
131
132 ;; slot access
133 #:with-slots
134 #:slot-value
135
136 ;; macros
137 #:macrolet
138 #:symbol-macrolet
139 #:define-symbol-macro
140 #:define-ps-symbol-macro
141 #:defmacro
142
143 ;; lisp eval
144 #:lisp
145
146 ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
147
148 ;; html generator for javascript
149 #:*ps-html-empty-tag-aware-p*
150 #:*ps-html-mode*
151 #:ps-html
152 #:who-ps-html
153
154 ;; utils
155 #:do-set-timeout
156 #:max
157 #:min
158 #:floor
159 #:ceiling
160 #:round
161 #:sin
162 #:cos
163 #:tan
164 #:asin
165 #:acos
166 #:atan
167 #:pi
168 #:sinh
169 #:cosh
170 #:tanh
171 #:asinh
172 #:acosh
173 #:atanh
174 #:1+
175 #:1-
176 #:abs
177 #:evenp
178 #:oddp
179 #:exp
180 #:expt
181 #:log
182 #:sqrt
183 #:random
184 #:ignore-errors
185 #:concatenate
186 #:concat-string
187 #:length
188 #:null
189 #:defined
190 #:undefined
191 #:@
192 #:with-lambda
193 #:stringp
194 #:numberp
195 #:functionp
196 #:objectp
197 #:memoize
198 #:append
199 #:apply
200 #:destructuring-bind
201
202 ;; DOM accessing utils
203 #:inner-html
204 #:uri-encode
205 #:attribute
206 #:offset
207 #:scroll
208 #:inner
209 #:client
210
211 ;; js runtime utils
212 #:*ps-lisp-library*
213 #:mapcar
214 #:map-into
215 #:map
216 #:map-until
217 #:member
218 #:append
219 #:set-difference
220 ))
221 (defparameter *parenscript-interface-exports*
222 '(;; compiler
223 #:*js-target-version*
224 #:compile-script
225 #:ps
226 #:ps-doc
227 #:ps-doc*
228 #:ps*
229 #:ps1*
230 #:ps-inline
231 #:ps-inline*
232 #:ps-compile-file
233 #:ps-compile-stream
234 ;; for parenscript macro definition within lisp
235 #:defpsmacro
236 #:defmacro/ps
237 #:defmacro+ps
238 #:import-macros-from-lisp
239
240 ;; gensym
241 #:ps-gensym
242 #:with-ps-gensyms
243 #:ps-once-only
244 #:*ps-gensym-counter*
245
246 ;; naming and namespaces
247 #:ps-package-prefix
248 #:obfuscate-package
249 #:unobfuscate-package
250
251 ;; printer
252 #:symbol-to-js-string
253 #:*js-string-delimiter*
254 #:*js-inline-string-delimiter*
255 #:*ps-print-pretty*
256 #:*indent-num-spaces*
257 ))
258 (defparameter *parenscript-interface-deprecated-exports*
259 '(;; deprecated interface
260 #:define-script-symbol-macro
261 #:gen-js-name
262 #:with-unique-js-names
263 #:defjsmacro
264 #:js-compile
265 #:js-inline
266 #:js-inline*
267 #:js
268 #:js*
269 #:symbol-to-js
270 ))
271
272 (defparameter *javascript-exports*
273 '(;;; for representing js code as s-expressions
274
275 ;; operators
276 ; arithmetic
277 #:+
278 #:-
279 #:*
280 #:/
281 #:%
282
283 ; bitwise
284 #:&
285 #:|\||
286 #:^
287 #:~
288 #:>>
289 #:<<
290 #:>>>
291
292 ; assignment
293 #:=
294 #:+=
295 #:-=
296 #:*=
297 #:/=
298 #:%=
299 #:&=
300 #:\|=
301 #:^+
302 #:>>=
303 #:<<=
304 #:>>>=
305
306 ; increment/decrement
307 #:++
308 #:--
309
310 ; comparison
311 #:==
312 #:===
313 #:!=
314 #:!==
315 #:>
316 #:>=
317 #:<
318 #:<=
319
320 ; logical
321 #:&&
322 #:||||
323 #:!
324
325 ; misc
326 #:? ; ternary
327 #:|,|
328 #:delete
329 #:function
330 #:get
331 #:in
332 #:instanceof
333 #:new
334 #:this
335 #:typeof
336 #:void
337
338
339 ;; statements
340 #:block
341 #:break
342 #:continue
343 #:do-while
344 #:for
345 #:for-in
346 #:if
347 #:label
348 #:return
349 #:switch
350 #:throw
351 #:try
352 #:var
353 #:while
354 #:with
355
356
357 #:unary-operator
358 #:literal
359 #:array
360 #:aref
361 #:operator
362 #:cond
363 #:lambda
364 #:object
365 #:variable
366 #:slot-value
367 #:funcall
368 #:escape
369 ))
370 )
371
372 (defpackage "PARENSCRIPT"
373 (:use "COMMON-LISP")
374 (:nicknames "JS" "PS")
375 #.(cons :export *parenscript-lang-exports*)
376 #.(cons :export *parenscript-interface-exports*)
377 #.(cons :export *parenscript-interface-deprecated-exports*)
378 #.(cons :export *javascript-exports*)
379 )
380