Implemented LET and LET* by variable renaming, which provides the
[clinton/parenscript.git] / src / package.lisp
index 9228f77..41fbb6a 100644 (file)
@@ -1,4 +1,4 @@
-(in-package :cl-user)
+(in-package "CL-USER")
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defparameter *parenscript-lang-exports*
@@ -10,6 +10,7 @@
       #:this
       #:false
       #:undefined
+      #:{}
 
       ;; keywords
       #:break
@@ -19,7 +20,9 @@
       #:array
       #:list
       #:aref
+      #:elt
       #:make-array
+      #:[]
 
       ;; operators
       #:! #:not #:~
@@ -39,6 +42,9 @@
       #:>>= #:<<=
       #:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~=
       #:incf #:decf
+      
+      ;; compile-time stuff
+      #:eval-when
 
       ;; body forms
       #:progn
       #:create
       #:with-slots
 
-      ;; macros
-      #:macrolet
-      #:symbol-macrolet
-
       ;; if
       #:if
       #:when
       #:psetf
       #:setq
       #:psetq
-      #:simple-let*
-      #:simple-let
-      #:lexical-let*
-      #:lexical-let
       #:let*
       #:let
 
@@ -93,7 +91,7 @@
       #:do*
       #:dotimes
       #:dolist
-      #:doeach
+      #:loop
 
       ;; with
       #:with
       ;; function definition
       #:defun
       #:lambda
+      #:flet
+      #:labels
 
       ;; lambda lists
       #:&key
       ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
 
       ;; html generator for javascript
+      #:*ps-html-empty-tag-aware-p*
+      #:*ps-html-mode*
       #:ps-html
+      #:who-ps-html
 
       ;; utils
       #:do-set-timeout
       #:random
       #:ignore-errors
       #:concatenate
+      #: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-compile-file
+      #:ps-compile-stream
       ;; for parenscript macro definition within lisp
       #:defpsmacro
       #:defmacro/ps
       #:unobfuscate-package
 
       ;; printer
+      #:symbol-to-js-string
       #:*js-string-delimiter*
       #:*js-inline-string-delimiter*
       #:*ps-print-pretty*
       ))
   (defparameter *parenscript-interface-deprecated-exports*
     '(;; deprecated interface
+      #:define-script-symbol-macro
       #:gen-js-name
       #:with-unique-js-names
       #:defjsmacro
       #:js-inline*
       #:js
       #: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")
+  (:nicknames "JS" "PS")
   #.(cons :export *parenscript-lang-exports*)
   #.(cons :export *parenscript-interface-exports*)
   #.(cons :export *parenscript-interface-deprecated-exports*)
+  #.(cons :export *javascript-exports*)
   )