-(in-package :cl-user)
+(in-package "CL-USER")
(eval-when (:compile-toplevel :load-toplevel :execute)
(defparameter *parenscript-lang-exports*
#:>>= #:<<=
#:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~=
#:incf #:decf
+
+ ;; compile-time stuff
+ #:eval-when
;; body forms
#:progn
#:psetf
#:setq
#:psetq
- #:simple-let*
- #:simple-let
- #:lexical-let*
- #:lexical-let
#:let*
#:let
#:do*
#:dotimes
#:dolist
- #:doeach
+ #:loop
;; with
#:with
;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
;; html generator for javascript
- #:*html-empty-tag-aware-p*
- #:*html-mode*
+ #:*ps-html-empty-tag-aware-p*
+ #:*ps-html-mode*
#:ps-html
#:who-ps-html
#:concat-string
#:length
#:null
+ #:defined
+ #:undefined
#:@
-
+ #:with-lambda
+ #:stringp
+ #:numberp
+ #:functionp
+ #:objectp
+ #:memoize
+ #:append
+ #:apply
+ #:destructuring-bind
+
+ ;; DOM accessing utils
+ #:inner-html
+ #:uri-encode
+ #:attribute
+ #:offset
+ #:scroll
+ #:inner
+ #:client
+
;; js runtime utils
#:*ps-lisp-library*
#:mapcar
))
(defparameter *parenscript-interface-exports*
'(;; compiler
+ #:*js-target-version*
#:compile-script
#:ps
#:ps-doc
#:ps-doc*
#:ps*
- #:ps1*
#:ps-inline
#:ps-inline*
-
+ #:*ps-read-function*
+ #:ps-compile-file
+ #:ps-compile-stream
;; for parenscript macro definition within lisp
#:defpsmacro
#:defmacro/ps
#:js*
#:symbol-to-js
))
+
+ (defparameter *javascript-exports*
+ '(;;; for representing js code as s-expressions
+
+ ;; operators
+ ; arithmetic
+ #:+
+ #:-
+ #:*
+ #:/
+ #:%
+
+ ; bitwise
+ #:&
+ #:|\||
+ #:^
+ #:~
+ #:>>
+ #:<<
+ #:>>>
+
+ ; assignment
+ #:=
+ #:+=
+ #:-=
+ #:*=
+ #:/=
+ #:%=
+ #:&=
+ #:\|=
+ #:^+
+ #:>>=
+ #:<<=
+ #:>>>=
+
+ ; increment/decrement
+ #:++
+ #:--
+
+ ; comparison
+ #:==
+ #:===
+ #:!=
+ #:!==
+ #:>
+ #:>=
+ #:<
+ #:<=
+
+ ; logical
+ #:&&
+ #:||||
+ #:!
+
+ ; misc
+ #:? ; ternary
+ #:|,|
+ #:delete
+ #:function
+ #:get
+ #:in
+ #:instanceof
+ #:new
+ #:this
+ #:typeof
+ #:void
+
+
+ ;; statements
+ #:block
+ #:break
+ #:continue
+ #:do-while
+ #:for
+ #:for-in
+ #:if
+ #:label
+ #:return
+ #:switch
+ #:throw
+ #:try
+ #:var
+ #:while
+ #:with
+
+
+ #:unary-operator
+ #:literal
+ #:array
+ #:aref
+ #:operator
+ #:cond
+ #:lambda
+ #:object
+ #:variable
+ #:slot-value
+ #:funcall
+ #:escape
+ ))
)
-(defpackage :parenscript
- (:use :common-lisp)
- (:nicknames :js :ps)
+(defpackage "PARENSCRIPT"
+ (:use "COMMON-LISP" "ANAPHORA")
+ (:nicknames "JS" "PS")
#.(cons :export *parenscript-lang-exports*)
#.(cons :export *parenscript-interface-exports*)
#.(cons :export *parenscript-interface-deprecated-exports*)
+ #.(cons :export *javascript-exports*)
)