Exported 'loop' from Parenscript package, moved utility functions to src/utils.lisp.
[clinton/parenscript.git] / src / package.lisp
CommitLineData
e8fdcce7 1(in-package "CL-USER")
171bbab3 2
d31d0bc7
VS
3(eval-when (:compile-toplevel :load-toplevel :execute)
4 (defparameter *parenscript-lang-exports*
b73376a5 5 '(;; literals
171bbab3
RD
6 #:t
7 #:f
8 #:true
45c9f9c2 9 #.(symbol-name 'nil) ; for case-sensitive Lisps like some versions of Allegro
171bbab3
RD
10 #:this
11 #:false
12 #:undefined
72044f33 13 #:{}
d3c4afa2 14
171bbab3
RD
15 ;; keywords
16 #:break
17 #:continue
d3c4afa2 18
171bbab3
RD
19 ;; array literals
20 #:array
21 #:list
22 #:aref
ce44c98c 23 #:elt
171bbab3 24 #:make-array
06ed0d3a 25 #:[]
d3c4afa2 26
171bbab3
RD
27 ;; operators
28 #:! #:not #:~
29 #:* #:/ #:%
30 #:+ #:-
31 #:<< #:>>
32 #:>>>
33 #:< #:> #:<= #:>=
34 #:in
35 #:eql #:== #:!= #:=
36 #:=== #:!==
37 #:&
38 #:^
39 #:\|
40 #:\&\& #:and
41 #:\|\| #:or
42 #:>>= #:<<=
43 #:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~=
171bbab3 44 #:incf #:decf
d3c4afa2 45
171bbab3
RD
46 ;; body forms
47 #:progn
d3c4afa2 48
171bbab3
RD
49 ;; object literals
50 #:create
171bbab3 51 #:with-slots
d3c4afa2 52
171bbab3
RD
53 ;; if
54 #:if
55 #:when
56 #:unless
d3c4afa2 57
171bbab3
RD
58 ;; single argument statements
59 #:return
60 #:throw
d3c4afa2 61
171bbab3
RD
62 ;; single argument expressions
63 #:delete
64 #:void
65 #:typeof
66 #:instanceof
67 #:new
d3c4afa2 68
d31d0bc7 69 ;; assignment and binding
171bbab3 70 #:setf
d31d0bc7 71 #:defsetf
1fe28ee1 72 #:psetf
ec227186
TC
73 #:setq
74 #:psetq
b5cf9e71 75 #:simple-let*
ca25a40e 76 #:simple-let
58c4ef4f 77 #:lexical-let*
3530f5e1 78 #:lexical-let
613457a0
TC
79 #:let*
80 #:let
d3c4afa2 81
171bbab3 82 ;; variables
58c4ef4f 83 #:var
171bbab3 84 #:defvar
d3c4afa2 85
171bbab3 86 ;; iteration
6a2ce72d 87 #:labeled-for
171bbab3 88 #:for
6a2ce72d 89 #:for-in
171bbab3 90 #:while
613457a0
TC
91 #:do
92 #:do*
93 #:dotimes
94 #:dolist
09a3438e 95 #:loop
d3c4afa2 96
171bbab3
RD
97 ;; with
98 #:with
d3c4afa2 99
171bbab3
RD
100 ;; case
101 #:switch
102 #:case
103 #:default
d3c4afa2 104
171bbab3
RD
105 ;; try throw catch
106 #:try
d3c4afa2 107
171bbab3
RD
108 ;; regex literals
109 #:regex
d3c4afa2 110
171bbab3 111 ;; conditional compilation (IE)
d31d0bc7 112 #:cc-if
d3c4afa2 113
d31d0bc7
VS
114 ;; function definition
115 #:defun
116 #:lambda
ef3be63e
VS
117 #:flet
118 #:labels
d3c4afa2 119
d31d0bc7
VS
120 ;; lambda lists
121 #:&key
122 #:&rest
123 #:&body
124 #:&optional
125 #:&aux
126 #:&environment
127 #:&key-object
46f794a4 128
d31d0bc7
VS
129 ;; slot access
130 #:with-slots
131 #:slot-value
46f794a4 132
d31d0bc7
VS
133 ;; macros
134 #:macrolet
135 #:symbol-macrolet
136 #:define-symbol-macro
386ecd2f 137 #:define-ps-symbol-macro
d31d0bc7 138 #:defmacro
d3c4afa2 139
d31d0bc7
VS
140 ;; lisp eval
141 #:lisp
d3c4afa2 142
d31d0bc7 143 ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
171bbab3 144
d31d0bc7 145 ;; html generator for javascript
6c9687e9
VS
146 #:*ps-html-empty-tag-aware-p*
147 #:*ps-html-mode*
d31d0bc7 148 #:ps-html
1937c30a 149 #:who-ps-html
dbb7017b 150
d31d0bc7
VS
151 ;; utils
152 #:do-set-timeout
c72e87d8 153 #:max
4b6e50d2
TC
154 #:min
155 #:floor
c72e87d8 156 #:ceiling
4b6e50d2 157 #:round
c72e87d8
VS
158 #:sin
159 #:cos
160 #:tan
c72e87d8 161 #:asin
4b6e50d2 162 #:acos
c72e87d8 163 #:atan
58f3113d 164 #:pi
7a5c62dc
TC
165 #:sinh
166 #:cosh
167 #:tanh
168 #:asinh
169 #:acosh
170 #:atanh
4b6e50d2
TC
171 #:1+
172 #:1-
173 #:abs
174 #:evenp
175 #:oddp
c72e87d8 176 #:exp
c72e87d8 177 #:expt
4b6e50d2 178 #:log
a7b7afae 179 #:sqrt
c72e87d8 180 #:random
c72e87d8 181 #:ignore-errors
d5c9059a 182 #:concatenate
bb8ba95a 183 #:concat-string
c72e87d8
VS
184 #:length
185 #:null
186 #:@
187
352621e1 188 ;; js runtime utils
c72e87d8
VS
189 #:*ps-lisp-library*
190 #:mapcar
352621e1
VS
191 #:map-into
192 #:map
193 #:map-until
194 #:member
195 #:append
196 #:set-difference
b73376a5
TC
197 ))
198 (defparameter *parenscript-interface-exports*
199 '(;; compiler
200 #:compile-script
201 #:ps
202 #:ps-doc
157cb2d6 203 #:ps-doc*
b73376a5 204 #:ps*
cb8f8e58 205 #:ps1*
b73376a5
TC
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
6274a448 227 #:symbol-to-js-string
b73376a5
TC
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
b65b21c2 235 #:define-script-symbol-macro
b73376a5
TC
236 #:gen-js-name
237 #:with-unique-js-names
238 #:defjsmacro
239 #:js-compile
240 #:js-inline
241 #:js-inline*
242 #:js
243 #:js*
ffb6d061 244 #:symbol-to-js
b73376a5 245 ))
e8fdcce7
VS
246
247 (defparameter *javascript-exports*
248 '(;; for representing js code as s-expressions
249 #:?
250 #:if
251 #:unary-operator
252 #:--
0ce67a33
VS
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
e8fdcce7 278 ))
b73376a5 279 )
171bbab3 280
e8fdcce7
VS
281(defpackage "PARENSCRIPT"
282 (:use "COMMON-LISP")
283 (:nicknames "JS" "PS")
171bbab3 284 #.(cons :export *parenscript-lang-exports*)
b73376a5
TC
285 #.(cons :export *parenscript-interface-exports*)
286 #.(cons :export *parenscript-interface-deprecated-exports*)
e8fdcce7 287 #.(cons :export *javascript-exports*)
b73376a5 288 )
f326f929 289