Added several new utility macros, including a primitive DESTRUCTURING-BIND.
[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 ;; body forms
47 #:progn
48
49 ;; object literals
50 #:create
51 #:with-slots
52
53 ;; if
54 #:if
55 #:when
56 #:unless
57
58 ;; single argument statements
59 #:return
60 #:throw
61
62 ;; single argument expressions
63 #:delete
64 #:void
65 #:typeof
66 #:instanceof
67 #:new
68
69 ;; assignment and binding
70 #:setf
71 #:defsetf
72 #:psetf
73 #:setq
74 #:psetq
75 #:simple-let*
76 #:simple-let
77 #:lexical-let*
78 #:lexical-let
79 #:let*
80 #:let
81
82 ;; variables
83 #:var
84 #:defvar
85
86 ;; iteration
87 #:labeled-for
88 #:for
89 #:for-in
90 #:while
91 #:do
92 #:do*
93 #:dotimes
94 #:dolist
95 #:loop
96
97 ;; with
98 #:with
99
100 ;; case
101 #:switch
102 #:case
103 #:default
104
105 ;; try throw catch
106 #:try
107
108 ;; regex literals
109 #:regex
110
111 ;; conditional compilation (IE)
112 #:cc-if
113
114 ;; function definition
115 #:defun
116 #:lambda
117 #:flet
118 #:labels
119
120 ;; lambda lists
121 #:&key
122 #:&rest
123 #:&body
124 #:&optional
125 #:&aux
126 #:&environment
127 #:&key-object
128
129 ;; slot access
130 #:with-slots
131 #:slot-value
132
133 ;; macros
134 #:macrolet
135 #:symbol-macrolet
136 #:define-symbol-macro
137 #:define-ps-symbol-macro
138 #:defmacro
139
140 ;; lisp eval
141 #:lisp
142
143 ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
144
145 ;; html generator for javascript
146 #:*ps-html-empty-tag-aware-p*
147 #:*ps-html-mode*
148 #:ps-html
149 #:who-ps-html
150
151 ;; utils
152 #:do-set-timeout
153 #:max
154 #:min
155 #:floor
156 #:ceiling
157 #:round
158 #:sin
159 #:cos
160 #:tan
161 #:asin
162 #:acos
163 #:atan
164 #:pi
165 #:sinh
166 #:cosh
167 #:tanh
168 #:asinh
169 #:acosh
170 #:atanh
171 #:1+
172 #:1-
173 #:abs
174 #:evenp
175 #:oddp
176 #:exp
177 #:expt
178 #:log
179 #:sqrt
180 #:random
181 #:ignore-errors
182 #:concatenate
183 #:concat-string
184 #:length
185 #:null
186 #:defined
187 #:undefined
188 #:@
189 #:with-lambda
190 #:stringp
191 #:numberp
192 #:functionp
193 #:objectp
194 #:memoize
195 #:append
196 #:apply
197 #:destructuring-bind
198
199 ;; js runtime utils
200 #:*ps-lisp-library*
201 #:mapcar
202 #:map-into
203 #:map
204 #:map-until
205 #:member
206 #:append
207 #:set-difference
208 ))
209 (defparameter *parenscript-interface-exports*
210 '(;; compiler
211 #:compile-script
212 #:ps
213 #:ps-doc
214 #:ps-doc*
215 #:ps*
216 #:ps1*
217 #:ps-inline
218 #:ps-inline*
219
220 ;; for parenscript macro definition within lisp
221 #:defpsmacro
222 #:defmacro/ps
223 #:defmacro+ps
224 #:import-macros-from-lisp
225
226 ;; gensym
227 #:ps-gensym
228 #:with-ps-gensyms
229 #:ps-once-only
230 #:*ps-gensym-counter*
231
232 ;; naming and namespaces
233 #:ps-package-prefix
234 #:obfuscate-package
235 #:unobfuscate-package
236
237 ;; printer
238 #:symbol-to-js-string
239 #:*js-string-delimiter*
240 #:*js-inline-string-delimiter*
241 #:*ps-print-pretty*
242 #:*indent-num-spaces*
243 ))
244 (defparameter *parenscript-interface-deprecated-exports*
245 '(;; deprecated interface
246 #:define-script-symbol-macro
247 #:gen-js-name
248 #:with-unique-js-names
249 #:defjsmacro
250 #:js-compile
251 #:js-inline
252 #:js-inline*
253 #:js
254 #:js*
255 #:symbol-to-js
256 ))
257
258 (defparameter *javascript-exports*
259 '(;; for representing js code as s-expressions
260 #:?
261 #:if
262 #:unary-operator
263 #:--
264 #:!
265 #:block
266 #:literal
267 #:break
268 #:continue
269 #:return
270 #:throw
271 #:array
272 #:aref
273 #:++
274 #:+=
275 #:operator
276 #:-=
277 #:-
278 #:=
279 #:cond
280 #:lambda
281 #:object
282 #:variable
283 #:slot-value
284 #:new
285 #:funcall
286 #:instanceof
287 #:in
288 #:escape
289 ))
290 )
291
292 (defpackage "PARENSCRIPT"
293 (:use "COMMON-LISP")
294 (:nicknames "JS" "PS")
295 #.(cons :export *parenscript-lang-exports*)
296 #.(cons :export *parenscript-interface-exports*)
297 #.(cons :export *parenscript-interface-deprecated-exports*)
298 #.(cons :export *javascript-exports*)
299 )
300