Exported 'loop' from Parenscript package, moved utility functions to src/utils.lisp.
[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 #:@
187
188 ;; js runtime utils
189 #:*ps-lisp-library*
190 #:mapcar
191 #:map-into
192 #:map
193 #:map-until
194 #:member
195 #:append
196 #:set-difference
197 ))
198 (defparameter *parenscript-interface-exports*
199 '(;; compiler
200 #:compile-script
201 #:ps
202 #:ps-doc
203 #:ps-doc*
204 #:ps*
205 #:ps1*
206 #:ps-inline
207 #:ps-inline*
208
209 ;; for parenscript macro definition within lisp
210 #:defpsmacro
211 #:defmacro/ps
212 #:defmacro+ps
213 #:import-macros-from-lisp
214
215 ;; gensym
216 #:ps-gensym
217 #:with-ps-gensyms
218 #:ps-once-only
219 #:*ps-gensym-counter*
220
221 ;; naming and namespaces
222 #:ps-package-prefix
223 #:obfuscate-package
224 #:unobfuscate-package
225
226 ;; printer
227 #:symbol-to-js-string
228 #:*js-string-delimiter*
229 #:*js-inline-string-delimiter*
230 #:*ps-print-pretty*
231 #:*indent-num-spaces*
232 ))
233 (defparameter *parenscript-interface-deprecated-exports*
234 '(;; deprecated interface
235 #:define-script-symbol-macro
236 #:gen-js-name
237 #:with-unique-js-names
238 #:defjsmacro
239 #:js-compile
240 #:js-inline
241 #:js-inline*
242 #:js
243 #:js*
244 #:symbol-to-js
245 ))
246
247 (defparameter *javascript-exports*
248 '(;; for representing js code as s-expressions
249 #:?
250 #:if
251 #:unary-operator
252 #:--
253 #:!
254 #:block
255 #:literal
256 #:break
257 #:continue
258 #:return
259 #:throw
260 #:array
261 #:aref
262 #:++
263 #:+=
264 #:operator
265 #:-=
266 #:-
267 #:=
268 #:cond
269 #:lambda
270 #:object
271 #:variable
272 #:slot-value
273 #:new
274 #:funcall
275 #:instanceof
276 #:in
277 #:escape
278 ))
279 )
280
281 (defpackage "PARENSCRIPT"
282 (:use "COMMON-LISP")
283 (:nicknames "JS" "PS")
284 #.(cons :export *parenscript-lang-exports*)
285 #.(cons :export *parenscript-interface-exports*)
286 #.(cons :export *parenscript-interface-deprecated-exports*)
287 #.(cons :export *javascript-exports*)
288 )
289