Made special forms be compiled into named functions in a new package, parenscript...
[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 #:let
76 #:lexical-let
77
78 ;; variables
79 #:defvar
80
81 ;; iteration
82 #:for
83 #:doeach
84 #:while
85
86 ;; with
87 #:with
88
89 ;; case
90 #:switch
91 #:case
92 #:default
93
94 ;; try throw catch
95 #:try
96
97 ;; regex literals
98 #:regex
99
100 ;; conditional compilation (IE)
101 #:cc-if
102
103 ;; function definition
104 #:defun
105 #:lambda
106
107 ;; lambda lists
108 #:&key
109 #:&rest
110 #:&body
111 #:&optional
112 #:&aux
113 #:&environment
114 #:&key-object
115
116 ;; slot access
117 #:with-slots
118 #:slot-value
119
120 ;; macros
121 #:macrolet
122 #:symbol-macrolet
123 #:define-symbol-macro
124 #:define-script-symbol-macro
125 #:defmacro
126
127 ;; lisp eval
128 #:lisp
129
130 ;; iteration
131 #:do
132 #:dotimes
133 #:dolist
134 #:doeach
135 #:while
136
137 ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
138
139 ;; CSS
140 #:css
141 #:css-to-string
142 #:css-inline
143 #:css-file
144
145 ;; html generator for javascript
146 #:ps-html
147
148 ;; utils
149 #:do-set-timeout
150 #:min
151 #:max
152 #:ceiling
153 #:abs
154 #:sin
155 #:cos
156 #:tan
157 #:acos
158 #:asin
159 #:atan
160 #:exp
161 #:floor
162 #:expt
163 #:round
164 #:random
165 #:oddp
166 #:evenp
167 #:ignore-errors
168 #:length
169 #:null
170 #:@
171
172 ;; libries
173 #:*ps-lisp-library*
174 #:mapcar
175 ))
176 "All symbols considerred part of the Parenscript language.")
177
178 (defpackage :parenscript
179 (:use :common-lisp)
180 (:nicknames :js :ps)
181 #.(cons :export *parenscript-lang-exports*)
182
183 ;;; symbols that form the interface to the Parenscript compiler
184 (:export
185 ;; compiler
186 #:compile-script
187 #:ps
188 #:ps*
189 #:ps-inline
190 #:ps-inline*
191
192 ;; for parenscript macro definition within lisp
193 #:defpsmacro
194 #:defmacro/ps
195 #:defmacro+ps
196 #:import-macros-from-lisp
197
198 ;; gensym
199 #:ps-gensym
200 #:with-ps-gensyms
201 #:*ps-gensym-counter*
202
203 ;; naming and namespaces
204 #:ps-package-prefix
205 #:obfuscate-package
206 #:unobfuscate-package
207
208 ;; printer
209 #:*js-string-delimiter*
210 #:*js-inline-string-delimiter*
211 #:*ps-print-pretty*
212 #:*indent-num-spaces*
213
214 ;; deprecated interface
215 #:gen-js-name
216 #:gen-js-name-string
217 #:with-unique-js-names
218 #:defjsmacro
219 #:js-compile
220 #:js-inline
221 #:js-inline*
222 #:js-file
223 #:js-script
224 #:js-to-statement-strings
225 #:js
226 #:js*
227 ))
228
229 (defpackage :parenscript-special-forms
230 (:use))