Fixed type bug with printing slot-value with obj/slot being a non-list.
[clinton/parenscript.git] / src / package.lisp
1 (in-package :cl-user)
2 ;;;; Package definitions for the Parenscript
3 ;; #:
4
5 (eval-when (:compile-toplevel :load-toplevel)
6 ;; exports shared between PARENSCRIPT and PARENSCRIPT.JAVASCRIPT
7 (defparameter *shared-symbols-ps-js*
8 '(
9 ;; literals
10 #:t
11 #:f
12 #:true
13 "NIL"
14 #:this
15 #:false
16 #:undefined
17
18 ;; keywords
19 #:break
20 #:continue
21
22 ;; array literals
23 #:array
24 #:list
25 #:aref
26 #:make-array
27
28 ;; operators
29 #:! #:not #:~
30 #:* #:/ #:%
31 #:+ #:-
32 #:<< #:>>
33 #:>>>
34 #:< #:> #:<= #:>=
35 #:in
36 #:eql #:== #:!= #:=
37 #:=== #:!==
38 #:&
39 #:^
40 #:\|
41 #:\&\& #:and
42 #:\|\| #:or
43 #:>>= #:<<=
44 #:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~=
45 #:++ #:--
46 #:1+ #:1-
47 #:incf #:decf
48
49 ;; body forms
50 #:progn
51
52 ;; object literals
53 #:create
54 #:with-slots
55
56 ;; macros
57 #:macrolet
58 #:symbol-macrolet
59
60 ;; if
61 #:if
62 #:when
63 #:unless
64
65 ;; single argument statements
66 #:return
67 #:throw
68
69 ;; single argument expressions
70 #:delete
71 #:void
72 #:typeof
73 #:instanceof
74 #:new
75
76 ;; assignment
77 #:setf
78
79 ;; variables
80 #:defvar
81
82 ;; iteration
83 #:for
84 #:doeach
85 #:while
86
87 ;; with
88 #:with
89
90 ;; case
91 #:switch
92 #:case
93 #:default
94
95 ;; try throw catch
96 #:try
97
98 ;; regex literals
99 #:regex
100
101 ;; conditional compilation (IE)
102 #:cc-if)
103 "Symbols exported from both the Parenscript and Javascript packages
104 that are also valid as Parenscript symbols for the corresponding script packages."))
105
106 (eval-when (:compile-toplevel :load-toplevel :execute)
107 (defparameter *parenscript-lang-exports*
108 (append
109 *shared-symbols-ps-js*
110 '(
111 ;; function definition
112 #:defun
113 #:lambda
114
115 ;; lambda lists
116 #:&key
117 #:&rest
118 #:&body
119 #:&optional
120 #:&aux
121 #:&environment
122 #:&key-object
123 #:optional-args
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 ;; assignment
140 #:setf
141 #:defaultf
142
143 #:let
144
145 ;; iteration
146 #:do
147 #:dotimes
148 #:dolist
149 #:doeach
150 #:while
151
152 ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
153
154 ;; CSS
155 #:css
156 #:css-to-string
157 #:css-inline
158 #:css-file
159
160 ;; html generator for javascript
161 #:html
162
163 ;; utils
164 #:do-set-timeout
165 ))
166 "List of (uninterned) symbols. Contains all symbols considerred
167 part of the Parenscript language. These should be exported within
168 both the Lisp package and the script package for Parenscript."))
169
170 (defpackage :parenscript
171 (:use :common-lisp)
172 (:nicknames :js :ps)
173 #.(cons :export *shared-symbols-ps-js*)
174 #.(cons :export *parenscript-lang-exports*)
175 (:export
176 ;; compiler
177 #:compile-script
178 #:ps
179 #:ps*
180
181 ;; for parenscript macro definition within lisp
182 #:defpsmacro
183 #:defmacro/ps
184 #:defmacro+ps
185 #:import-macros-from-lisp
186
187 ;; gensym
188 #:ps-gensym
189 #:with-ps-gensyms
190 #:*ps-gensym-counter*
191
192 ;; naming and namespaces
193 #:*obfuscate-identifiers*
194 #:*package-prefix-style*
195 #:ps-package-prefix
196
197 ;; deprecated interface
198 #:gen-js-name
199 #:gen-js-name-string
200 #:with-unique-js-names
201 #:defjsmacro
202 #:js-compile
203 #:js-inline
204 #:js-inline*
205 #:js-file
206 #:js-script
207 #:js-to-statement-strings
208 #:js
209 #:js*
210 ))
211