80e607e49558bc8cbb7b73d4b8930a7b9b820157
[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 '(
6 ;; literals
7 #:t
8 #:f
9 #:true
10 #.(symbol-name 'nil) ;; for case-sensitive Lisps like some versions of Allegro
11 #:this
12 #:false
13 #:undefined
14
15 ;; keywords
16 #:break
17 #:continue
18
19 ;; array literals
20 #:array
21 #:list
22 #:aref
23 #:make-array
24
25 ;; operators
26 #:! #:not #:~
27 #:* #:/ #:%
28 #:+ #:-
29 #:<< #:>>
30 #:>>>
31 #:< #:> #:<= #:>=
32 #:in
33 #:eql #:== #:!= #:=
34 #:=== #:!==
35 #:&
36 #:^
37 #:\|
38 #:\&\& #:and
39 #:\|\| #:or
40 #:>>= #:<<=
41 #:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~=
42 #:1+ #:1-
43 #:incf #:decf
44
45 ;; body forms
46 #:progn
47
48 ;; object literals
49 #:create
50 #:with-slots
51
52 ;; macros
53 #:macrolet
54 #:symbol-macrolet
55
56 ;; if
57 #:if
58 #:when
59 #:unless
60
61 ;; single argument statements
62 #:return
63 #:throw
64
65 ;; single argument expressions
66 #:delete
67 #:void
68 #:typeof
69 #:instanceof
70 #:new
71
72 ;; assignment and binding
73 #:setf
74 #:defsetf
75 #:psetf
76 #:setq
77 #:psetq
78 #:simple-let*
79 #:simple-let
80 #:let*
81 #:lexical-let*
82 #:lexical-let
83
84 ;; variables
85 #:var
86 #:defvar
87
88 ;; iteration
89 #:labeled-for
90 #:for
91 #:for-in
92 #:doeach
93 #:while
94
95 ;; with
96 #:with
97
98 ;; case
99 #:switch
100 #:case
101 #:default
102
103 ;; try throw catch
104 #:try
105
106 ;; regex literals
107 #:regex
108
109 ;; conditional compilation (IE)
110 #:cc-if
111
112 ;; function definition
113 #:defun
114 #:lambda
115
116 ;; lambda lists
117 #:&key
118 #:&rest
119 #:&body
120 #:&optional
121 #:&aux
122 #:&environment
123 #:&key-object
124
125 ;; slot access
126 #:with-slots
127 #:slot-value
128
129 ;; macros
130 #:macrolet
131 #:symbol-macrolet
132 #:define-symbol-macro
133 #:define-script-symbol-macro
134 #:defmacro
135
136 ;; lisp eval
137 #:lisp
138
139 ;; iteration
140 #:do
141 #:do*
142 #:dotimes
143 #:dolist
144 #:doeach
145 #:while
146
147 ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
148
149 ;; html generator for javascript
150 #:ps-html
151
152 ;; utils
153 #:do-set-timeout
154 #:min
155 #:max
156 #:ceiling
157 #:abs
158 #:sin
159 #:cos
160 #:tan
161 #:acos
162 #:asin
163 #:atan
164 #:exp
165 #:floor
166 #:expt
167 #:round
168 #:random
169 #:oddp
170 #:evenp
171 #:ignore-errors
172 #:concatenate
173 #:length
174 #:null
175 #:@
176
177 ;; js runtime utils
178 #:*ps-lisp-library*
179 #:mapcar
180 #:map-into
181 #:map
182 #:map-until
183 #:member
184 #:append
185 #:set-difference
186 ))
187 "All symbols considered part of the Parenscript language.")
188
189 (defpackage :parenscript
190 (:use :common-lisp)
191 (:nicknames :js :ps)
192 #.(cons :export *parenscript-lang-exports*)
193
194 ;;; symbols that form the interface to the Parenscript compiler
195 (:export
196 ;; compiler
197 #:compile-script
198 #:ps
199 #:ps*
200 #:ps-inline
201 #:ps-inline*
202
203 ;; for parenscript macro definition within lisp
204 #:defpsmacro
205 #:defmacro/ps
206 #:defmacro+ps
207 #:import-macros-from-lisp
208
209 ;; gensym
210 #:ps-gensym
211 #:with-ps-gensyms
212 #:*ps-gensym-counter*
213
214 ;; naming and namespaces
215 #:ps-package-prefix
216 #:obfuscate-package
217 #:unobfuscate-package
218
219 ;; printer
220 #:*js-string-delimiter*
221 #:*js-inline-string-delimiter*
222 #:*ps-print-pretty*
223 #:*indent-num-spaces*
224
225 ;; deprecated interface
226 #:gen-js-name
227 #:gen-js-name-string
228 #:with-unique-js-names
229 #:defjsmacro
230 #:js-compile
231 #:js-inline
232 #:js-inline*
233 #:js-file
234 #:js-script
235 #:js-to-statement-strings
236 #:js
237 #:js*
238 #:let
239 ))
240
241 (defpackage :parenscript-special-forms
242 (:use))