Added a file PS-DOM with handy utility macros for DOM functionality, e.g. Lispy ways...
[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 ;; DOM accessing utils
200 #:inner-html
201 #:uri-encode
202 #:attribute
203 #:offset
204 #:scroll
205 #:inner
206 #:client
207
208 ;; js runtime utils
209 #:*ps-lisp-library*
210 #:mapcar
211 #:map-into
212 #:map
213 #:map-until
214 #:member
215 #:append
216 #:set-difference
217 ))
218 (defparameter *parenscript-interface-exports*
219 '(;; compiler
220 #:compile-script
221 #:ps
222 #:ps-doc
223 #:ps-doc*
224 #:ps*
225 #:ps1*
226 #:ps-inline
227 #:ps-inline*
228
229 ;; for parenscript macro definition within lisp
230 #:defpsmacro
231 #:defmacro/ps
232 #:defmacro+ps
233 #:import-macros-from-lisp
234
235 ;; gensym
236 #:ps-gensym
237 #:with-ps-gensyms
238 #:ps-once-only
239 #:*ps-gensym-counter*
240
241 ;; naming and namespaces
242 #:ps-package-prefix
243 #:obfuscate-package
244 #:unobfuscate-package
245
246 ;; printer
247 #:symbol-to-js-string
248 #:*js-string-delimiter*
249 #:*js-inline-string-delimiter*
250 #:*ps-print-pretty*
251 #:*indent-num-spaces*
252 ))
253 (defparameter *parenscript-interface-deprecated-exports*
254 '(;; deprecated interface
255 #:define-script-symbol-macro
256 #:gen-js-name
257 #:with-unique-js-names
258 #:defjsmacro
259 #:js-compile
260 #:js-inline
261 #:js-inline*
262 #:js
263 #:js*
264 #:symbol-to-js
265 ))
266
267 (defparameter *javascript-exports*
268 '(;; for representing js code as s-expressions
269 #:?
270 #:if
271 #:unary-operator
272 #:--
273 #:!
274 #:block
275 #:literal
276 #:break
277 #:continue
278 #:return
279 #:throw
280 #:array
281 #:aref
282 #:++
283 #:+=
284 #:operator
285 #:-=
286 #:-
287 #:=
288 #:cond
289 #:lambda
290 #:object
291 #:variable
292 #:slot-value
293 #:new
294 #:funcall
295 #:instanceof
296 #:in
297 #:escape
298 ))
299 )
300
301 (defpackage "PARENSCRIPT"
302 (:use "COMMON-LISP")
303 (:nicknames "JS" "PS")
304 #.(cons :export *parenscript-lang-exports*)
305 #.(cons :export *parenscript-interface-exports*)
306 #.(cons :export *parenscript-interface-deprecated-exports*)
307 #.(cons :export *javascript-exports*)
308 )
309