Commit | Line | Data |
---|---|---|
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 | |
23 | #:make-array | |
d3c4afa2 | 24 | |
171bbab3 RD |
25 | ;; operators |
26 | #:! #:not #:~ | |
27 | #:* #:/ #:% | |
28 | #:+ #:- | |
29 | #:<< #:>> | |
30 | #:>>> | |
31 | #:< #:> #:<= #:>= | |
32 | #:in | |
33 | #:eql #:== #:!= #:= | |
34 | #:=== #:!== | |
35 | #:& | |
36 | #:^ | |
37 | #:\| | |
38 | #:\&\& #:and | |
39 | #:\|\| #:or | |
40 | #:>>= #:<<= | |
41 | #:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~= | |
171bbab3 | 42 | #:incf #:decf |
d3c4afa2 | 43 | |
171bbab3 RD |
44 | ;; body forms |
45 | #:progn | |
d3c4afa2 | 46 | |
171bbab3 RD |
47 | ;; object literals |
48 | #:create | |
171bbab3 | 49 | #:with-slots |
d3c4afa2 | 50 | |
171bbab3 RD |
51 | ;; macros |
52 | #:macrolet | |
53 | #:symbol-macrolet | |
d3c4afa2 | 54 | |
171bbab3 RD |
55 | ;; if |
56 | #:if | |
57 | #:when | |
58 | #:unless | |
d3c4afa2 | 59 | |
171bbab3 RD |
60 | ;; single argument statements |
61 | #:return | |
62 | #:throw | |
d3c4afa2 | 63 | |
171bbab3 RD |
64 | ;; single argument expressions |
65 | #:delete | |
66 | #:void | |
67 | #:typeof | |
68 | #:instanceof | |
69 | #:new | |
d3c4afa2 | 70 | |
d31d0bc7 | 71 | ;; assignment and binding |
171bbab3 | 72 | #:setf |
d31d0bc7 | 73 | #:defsetf |
1fe28ee1 | 74 | #:psetf |
ec227186 TC |
75 | #:setq |
76 | #:psetq | |
b5cf9e71 | 77 | #:simple-let* |
ca25a40e | 78 | #:simple-let |
58c4ef4f | 79 | #:lexical-let* |
3530f5e1 | 80 | #:lexical-let |
613457a0 TC |
81 | #:let* |
82 | #:let | |
d3c4afa2 | 83 | |
171bbab3 | 84 | ;; variables |
58c4ef4f | 85 | #:var |
171bbab3 | 86 | #:defvar |
d3c4afa2 | 87 | |
171bbab3 | 88 | ;; iteration |
6a2ce72d | 89 | #:labeled-for |
171bbab3 | 90 | #:for |
6a2ce72d | 91 | #:for-in |
171bbab3 | 92 | #:while |
613457a0 TC |
93 | #:do |
94 | #:do* | |
95 | #:dotimes | |
96 | #:dolist | |
97 | #:doeach | |
d3c4afa2 | 98 | |
171bbab3 RD |
99 | ;; with |
100 | #:with | |
d3c4afa2 | 101 | |
171bbab3 RD |
102 | ;; case |
103 | #:switch | |
104 | #:case | |
105 | #:default | |
d3c4afa2 | 106 | |
171bbab3 RD |
107 | ;; try throw catch |
108 | #:try | |
d3c4afa2 | 109 | |
171bbab3 RD |
110 | ;; regex literals |
111 | #:regex | |
d3c4afa2 | 112 | |
171bbab3 | 113 | ;; conditional compilation (IE) |
d31d0bc7 | 114 | #:cc-if |
d3c4afa2 | 115 | |
d31d0bc7 VS |
116 | ;; function definition |
117 | #:defun | |
118 | #:lambda | |
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 VS |
145 | ;; html generator for javascript |
146 | #:ps-html | |
1937c30a | 147 | #:who-ps-html |
dbb7017b | 148 | |
d31d0bc7 VS |
149 | ;; utils |
150 | #:do-set-timeout | |
c72e87d8 | 151 | #:max |
4b6e50d2 TC |
152 | #:min |
153 | #:floor | |
c72e87d8 | 154 | #:ceiling |
4b6e50d2 | 155 | #:round |
c72e87d8 VS |
156 | #:sin |
157 | #:cos | |
158 | #:tan | |
c72e87d8 | 159 | #:asin |
4b6e50d2 | 160 | #:acos |
c72e87d8 | 161 | #:atan |
58f3113d | 162 | #:pi |
7a5c62dc TC |
163 | #:sinh |
164 | #:cosh | |
165 | #:tanh | |
166 | #:asinh | |
167 | #:acosh | |
168 | #:atanh | |
4b6e50d2 TC |
169 | #:1+ |
170 | #:1- | |
171 | #:abs | |
172 | #:evenp | |
173 | #:oddp | |
c72e87d8 | 174 | #:exp |
c72e87d8 | 175 | #:expt |
4b6e50d2 | 176 | #:log |
a7b7afae | 177 | #:sqrt |
c72e87d8 | 178 | #:random |
c72e87d8 | 179 | #:ignore-errors |
d5c9059a | 180 | #:concatenate |
bb8ba95a | 181 | #:concat-string |
c72e87d8 VS |
182 | #:length |
183 | #:null | |
184 | #:@ | |
185 | ||
352621e1 | 186 | ;; js runtime utils |
c72e87d8 VS |
187 | #:*ps-lisp-library* |
188 | #:mapcar | |
352621e1 VS |
189 | #:map-into |
190 | #:map | |
191 | #:map-until | |
192 | #:member | |
193 | #:append | |
194 | #:set-difference | |
b73376a5 TC |
195 | )) |
196 | (defparameter *parenscript-interface-exports* | |
197 | '(;; compiler | |
198 | #:compile-script | |
199 | #:ps | |
200 | #:ps-doc | |
201 | #:ps* | |
202 | #:ps-inline | |
203 | #:ps-inline* | |
204 | ||
205 | ;; for parenscript macro definition within lisp | |
206 | #:defpsmacro | |
207 | #:defmacro/ps | |
208 | #:defmacro+ps | |
209 | #:import-macros-from-lisp | |
210 | ||
211 | ;; gensym | |
212 | #:ps-gensym | |
213 | #:with-ps-gensyms | |
214 | #:ps-once-only | |
215 | #:*ps-gensym-counter* | |
216 | ||
217 | ;; naming and namespaces | |
218 | #:ps-package-prefix | |
219 | #:obfuscate-package | |
220 | #:unobfuscate-package | |
221 | ||
222 | ;; printer | |
6274a448 | 223 | #:symbol-to-js-string |
b73376a5 TC |
224 | #:*js-string-delimiter* |
225 | #:*js-inline-string-delimiter* | |
226 | #:*ps-print-pretty* | |
227 | #:*indent-num-spaces* | |
228 | )) | |
229 | (defparameter *parenscript-interface-deprecated-exports* | |
230 | '(;; deprecated interface | |
b65b21c2 | 231 | #:define-script-symbol-macro |
b73376a5 TC |
232 | #:gen-js-name |
233 | #:with-unique-js-names | |
234 | #:defjsmacro | |
235 | #:js-compile | |
236 | #:js-inline | |
237 | #:js-inline* | |
238 | #:js | |
239 | #:js* | |
240 | )) | |
241 | ) | |
171bbab3 | 242 | |
5aa10005 | 243 | (defpackage :parenscript |
4a987e2b | 244 | (:use :common-lisp) |
9da682ca | 245 | (:nicknames :js :ps) |
171bbab3 | 246 | #.(cons :export *parenscript-lang-exports*) |
b73376a5 TC |
247 | #.(cons :export *parenscript-interface-exports*) |
248 | #.(cons :export *parenscript-interface-deprecated-exports*) | |
249 | ) | |
f326f929 | 250 |