Added example of closure symbol-map usage for obfuscate-package in reference doc.
[clinton/parenscript.git] / src / package.lisp
CommitLineData
8e198a08 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
95 #:doeach
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
11a0e241 146 #:*self-closing-tags-p*
d31d0bc7 147 #:ps-html
1937c30a 148 #:who-ps-html
dbb7017b 149
d31d0bc7
VS
150 ;; utils
151 #:do-set-timeout
c72e87d8 152 #:max
4b6e50d2
TC
153 #:min
154 #:floor
c72e87d8 155 #:ceiling
4b6e50d2 156 #:round
c72e87d8
VS
157 #:sin
158 #:cos
159 #:tan
c72e87d8 160 #:asin
4b6e50d2 161 #:acos
c72e87d8 162 #:atan
58f3113d 163 #:pi
7a5c62dc
TC
164 #:sinh
165 #:cosh
166 #:tanh
167 #:asinh
168 #:acosh
169 #:atanh
4b6e50d2
TC
170 #:1+
171 #:1-
172 #:abs
173 #:evenp
174 #:oddp
c72e87d8 175 #:exp
c72e87d8 176 #:expt
4b6e50d2 177 #:log
a7b7afae 178 #:sqrt
c72e87d8 179 #:random
c72e87d8 180 #:ignore-errors
d5c9059a 181 #:concatenate
bb8ba95a 182 #:concat-string
c72e87d8
VS
183 #:length
184 #:null
185 #:@
186
352621e1 187 ;; js runtime utils
c72e87d8
VS
188 #:*ps-lisp-library*
189 #:mapcar
352621e1
VS
190 #:map-into
191 #:map
192 #:map-until
193 #:member
194 #:append
195 #:set-difference
b73376a5
TC
196 ))
197 (defparameter *parenscript-interface-exports*
198 '(;; compiler
199 #:compile-script
200 #:ps
201 #:ps-doc
202 #:ps*
cb8f8e58 203 #:ps1*
b73376a5
TC
204 #:ps-inline
205 #:ps-inline*
206
207 ;; for parenscript macro definition within lisp
208 #:defpsmacro
209 #:defmacro/ps
210 #:defmacro+ps
211 #:import-macros-from-lisp
212
213 ;; gensym
214 #:ps-gensym
215 #:with-ps-gensyms
216 #:ps-once-only
217 #:*ps-gensym-counter*
218
219 ;; naming and namespaces
220 #:ps-package-prefix
221 #:obfuscate-package
222 #:unobfuscate-package
223
224 ;; printer
6274a448 225 #:symbol-to-js-string
b73376a5
TC
226 #:*js-string-delimiter*
227 #:*js-inline-string-delimiter*
228 #:*ps-print-pretty*
229 #:*indent-num-spaces*
230 ))
231 (defparameter *parenscript-interface-deprecated-exports*
232 '(;; deprecated interface
b65b21c2 233 #:define-script-symbol-macro
b73376a5
TC
234 #:gen-js-name
235 #:with-unique-js-names
236 #:defjsmacro
237 #:js-compile
238 #:js-inline
239 #:js-inline*
240 #:js
241 #:js*
ffb6d061 242 #:symbol-to-js
b73376a5
TC
243 ))
244 )
171bbab3 245
5aa10005 246(defpackage :parenscript
4a987e2b 247 (:use :common-lisp)
9da682ca 248 (:nicknames :js :ps)
171bbab3 249 #.(cons :export *parenscript-lang-exports*)
b73376a5
TC
250 #.(cons :export *parenscript-interface-exports*)
251 #.(cons :export *parenscript-interface-deprecated-exports*)
252 )
f326f929 253