856bd6f6b17806c7d03ef3a367b0ce70612193d3
[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 #:incf #:decf
43
44 ;; body forms
45 #:progn
46
47 ;; object literals
48 #:create
49 #:with-slots
50
51 ;; macros
52 #:macrolet
53 #:symbol-macrolet
54
55 ;; if
56 #:if
57 #:when
58 #:unless
59
60 ;; single argument statements
61 #:return
62 #:throw
63
64 ;; single argument expressions
65 #:delete
66 #:void
67 #:typeof
68 #:instanceof
69 #:new
70
71 ;; assignment and binding
72 #:setf
73 #:defsetf
74 #:psetf
75 #:setq
76 #:psetq
77 #:simple-let*
78 #:simple-let
79 #:lexical-let*
80 #:lexical-let
81 #:let*
82 #:let
83
84 ;; variables
85 #:var
86 #:defvar
87
88 ;; iteration
89 #:labeled-for
90 #:for
91 #:for-in
92 #:while
93 #:do
94 #:do*
95 #:dotimes
96 #:dolist
97 #:doeach
98
99 ;; with
100 #:with
101
102 ;; case
103 #:switch
104 #:case
105 #:default
106
107 ;; try throw catch
108 #:try
109
110 ;; regex literals
111 #:regex
112
113 ;; conditional compilation (IE)
114 #:cc-if
115
116 ;; function definition
117 #:defun
118 #:lambda
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-script-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
147
148 ;; utils
149 #:do-set-timeout
150 #:max
151 #:min
152 #:floor
153 #:ceiling
154 #:round
155 #:sin
156 #:cos
157 #:tan
158 #:asin
159 #:acos
160 #:atan
161 #:pi
162 #:sinh
163 #:cosh
164 #:tanh
165 #:asinh
166 #:acosh
167 #:atanh
168 #:1+
169 #:1-
170 #:abs
171 #:evenp
172 #:oddp
173 #:exp
174 #:expt
175 #:log
176 #:sqrt
177 #:random
178 #:ignore-errors
179 #:concatenate
180 #:length
181 #:null
182 #:@
183
184 ;; js runtime utils
185 #:*ps-lisp-library*
186 #:mapcar
187 #:map-into
188 #:map
189 #:map-until
190 #:member
191 #:append
192 #:set-difference
193 )
194 "All symbols considered part of the Parenscript language."))
195
196 (defpackage :parenscript
197 (:use :common-lisp)
198 (:nicknames :js :ps)
199 #.(cons :export *parenscript-lang-exports*)
200
201 ;;; symbols that form the interface to the Parenscript compiler
202 (:export
203 ;; compiler
204 #:compile-script
205 #:ps
206 #:ps-doc
207 #:ps*
208 #:ps-inline
209 #:ps-inline*
210
211 ;; for parenscript macro definition within lisp
212 #:defpsmacro
213 #:defmacro/ps
214 #:defmacro+ps
215 #:import-macros-from-lisp
216
217 ;; gensym
218 #:ps-gensym
219 #:with-ps-gensyms
220 #:ps-once-only
221 #:*ps-gensym-counter*
222
223 ;; naming and namespaces
224 #:ps-package-prefix
225 #:obfuscate-package
226 #:unobfuscate-package
227
228 ;; printer
229 #:*js-string-delimiter*
230 #:*js-inline-string-delimiter*
231 #:*ps-print-pretty*
232 #:*indent-num-spaces*
233
234 ;; deprecated interface
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 ))
244