452de0ee698f2ec22689aebef8bfca97ffefc488
[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
96 ;; with
97 #:with
98
99 ;; case
100 #:switch
101 #:case
102 #:default
103
104 ;; try throw catch
105 #:try
106
107 ;; regex literals
108 #:regex
109
110 ;; conditional compilation (IE)
111 #:cc-if
112
113 ;; function definition
114 #:defun
115 #:lambda
116 #:flet
117 #:labels
118
119 ;; lambda lists
120 #:&key
121 #:&rest
122 #:&body
123 #:&optional
124 #:&aux
125 #:&environment
126 #:&key-object
127
128 ;; slot access
129 #:with-slots
130 #:slot-value
131
132 ;; macros
133 #:macrolet
134 #:symbol-macrolet
135 #:define-symbol-macro
136 #:define-ps-symbol-macro
137 #:defmacro
138
139 ;; lisp eval
140 #:lisp
141
142 ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
143
144 ;; html generator for javascript
145 #:*ps-html-empty-tag-aware-p*
146 #:*ps-html-mode*
147 #:ps-html
148 #:who-ps-html
149
150 ;; utils
151 #:do-set-timeout
152 #:max
153 #:min
154 #:floor
155 #:ceiling
156 #:round
157 #:sin
158 #:cos
159 #:tan
160 #:asin
161 #:acos
162 #:atan
163 #:pi
164 #:sinh
165 #:cosh
166 #:tanh
167 #:asinh
168 #:acosh
169 #:atanh
170 #:1+
171 #:1-
172 #:abs
173 #:evenp
174 #:oddp
175 #:exp
176 #:expt
177 #:log
178 #:sqrt
179 #:random
180 #:ignore-errors
181 #:concatenate
182 #:concat-string
183 #:length
184 #:null
185 #:@
186
187 ;; js runtime utils
188 #:*ps-lisp-library*
189 #:mapcar
190 #:map-into
191 #:map
192 #:map-until
193 #:member
194 #:append
195 #:set-difference
196 ))
197 (defparameter *parenscript-interface-exports*
198 '(;; compiler
199 #:compile-script
200 #:ps
201 #:ps-doc
202 #:ps-doc*
203 #:ps*
204 #:ps1*
205 #:ps-inline
206 #:ps-inline*
207
208 ;; for parenscript macro definition within lisp
209 #:defpsmacro
210 #:defmacro/ps
211 #:defmacro+ps
212 #:import-macros-from-lisp
213
214 ;; gensym
215 #:ps-gensym
216 #:with-ps-gensyms
217 #:ps-once-only
218 #:*ps-gensym-counter*
219
220 ;; naming and namespaces
221 #:ps-package-prefix
222 #:obfuscate-package
223 #:unobfuscate-package
224
225 ;; printer
226 #:symbol-to-js-string
227 #:*js-string-delimiter*
228 #:*js-inline-string-delimiter*
229 #:*ps-print-pretty*
230 #:*indent-num-spaces*
231 ))
232 (defparameter *parenscript-interface-deprecated-exports*
233 '(;; deprecated interface
234 #:define-script-symbol-macro
235 #:gen-js-name
236 #:with-unique-js-names
237 #:defjsmacro
238 #:js-compile
239 #:js-inline
240 #:js-inline*
241 #:js
242 #:js*
243 #:symbol-to-js
244 ))
245
246 (defparameter *javascript-exports*
247 '(;; for representing js code as s-expressions
248 #:?
249 #:if
250 #:unary-operator
251 #:--
252 #:!
253 #:block
254 #:literal
255 #:break
256 #:continue
257 #:return
258 #:throw
259 #:array
260 #:aref
261 #:++
262 #:+=
263 #:operator
264 #:-=
265 #:-
266 #:=
267 #:cond
268 #:lambda
269 #:object
270 #:variable
271 #:slot-value
272 #:new
273 #:funcall
274 #:instanceof
275 #:in
276 #:escape
277 ))
278 )
279
280 (defpackage "PARENSCRIPT"
281 (:use "COMMON-LISP")
282 (:nicknames "JS" "PS")
283 #.(cons :export *parenscript-lang-exports*)
284 #.(cons :export *parenscript-interface-exports*)
285 #.(cons :export *parenscript-interface-deprecated-exports*)
286 #.(cons :export *javascript-exports*)
287 )
288