(in-package :cl-user)
-;;;; Package definitions for the Parenscript
-;; #:
-(eval-when (:compile-toplevel :load-toplevel)
- ;; exports shared between PARENSCRIPT and PARENSCRIPT.JAVASCRIPT
- (defparameter *shared-symbols-ps-js*
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (defparameter *parenscript-lang-exports*
'(
;; literals
#:t
#:f
#:true
- "NIL"
+ #.(symbol-name 'nil) ;; for case-sensitive Lisps like some versions of Allegro
#:this
#:false
#:undefined
-
+
;; keywords
#:break
#:continue
-
+
;; array literals
#:array
#:list
#:aref
#:make-array
-
+
;; operators
#:! #:not #:~
#:* #:/ #:%
#:\|\| #:or
#:>>= #:<<=
#:*= #:/= #:%= #:+= #:\&= #:^= #:\|= #:~=
- #:++ #:--
#:1+ #:1-
#:incf #:decf
-
+
;; body forms
#:progn
-
+
;; object literals
#:create
#:with-slots
-
+
;; macros
#:macrolet
#:symbol-macrolet
-
+
;; if
#:if
#:when
#:unless
-
+
;; single argument statements
#:return
#:throw
-
+
;; single argument expressions
#:delete
#:void
#:typeof
#:instanceof
#:new
-
- ;; assignment
+
+ ;; assignment and binding
#:setf
-
+ #:defsetf
+ #:psetf
+ #:setq
+ #:psetq
+ #:simple-let*
+ #:simple-let
+ #:let*
+ #:lexical-let*
+ #:lexical-let
+
;; variables
+ #:var
#:defvar
-
+
;; iteration
+ #:labeled-for
#:for
+ #:for-in
#:doeach
#:while
-
+
;; with
#:with
-
+
;; case
#:switch
#:case
#:default
-
+
;; try throw catch
#:try
-
+
;; regex literals
#:regex
-
+
;; conditional compilation (IE)
- #:cc-if)
- "Symbols exported from both the Parenscript and Javascript packages
-that are also valid as Parenscript symbols for the corresponding script packages."))
+ #:cc-if
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (defparameter *parenscript-lang-exports*
- (append
- *shared-symbols-ps-js*
- '(
- ;; function definition
- #:defun
- #:lambda
-
- ;; lambda lists
- #:&key
- #:&rest
- #:&body
- #:&optional
- #:&aux
- #:&environment
- #:&key-object
- #:optional-args
-
- ;; slot access
- #:with-slots
- #:slot-value
-
- ;; macros
- #:macrolet
- #:symbol-macrolet
- #:define-symbol-macro
- #:define-script-symbol-macro
- #:defmacro
-
- ;; lisp eval
- #:lisp
-
- ;; assignment
- #:setf
- #:defaultf
-
- #:let
-
- ;; iteration
- #:do
- #:dotimes
- #:dolist
- #:doeach
- #:while
-
- ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
-
- ;; CSS
- #:css
- #:css-to-string
- #:css-inline
- #:css-file
-
- ;; html generator for javascript
- #:html
-
- ;; utils
- #:do-set-timeout
- ))
- "List of (uninterned) symbols. Contains all symbols considerred
-part of the Parenscript language. These should be exported within
-both the Lisp package and the script package for Parenscript."))
+ ;; function definition
+ #:defun
+ #:lambda
+
+ ;; lambda lists
+ #:&key
+ #:&rest
+ #:&body
+ #:&optional
+ #:&aux
+ #:&environment
+ #:&key-object
+
+ ;; slot access
+ #:with-slots
+ #:slot-value
+
+ ;; macros
+ #:macrolet
+ #:symbol-macrolet
+ #:define-symbol-macro
+ #:define-script-symbol-macro
+ #:defmacro
+
+ ;; lisp eval
+ #:lisp
+
+ ;; iteration
+ #:do
+ #:do*
+ #:dotimes
+ #:dolist
+ #:doeach
+ #:while
+
+ ;; v v v STUFF WE SHOULD PROBABLY MOVE TO OTHER LIBS v v v
+
+ ;; html generator for javascript
+ #:ps-html
+
+ ;; utils
+ #:do-set-timeout
+ #:min
+ #:max
+ #:ceiling
+ #:abs
+ #:sin
+ #:cos
+ #:tan
+ #:acos
+ #:asin
+ #:atan
+ #:exp
+ #:floor
+ #:expt
+ #:round
+ #:random
+ #:oddp
+ #:evenp
+ #:ignore-errors
+ #:concatenate
+ #:length
+ #:null
+ #:@
+
+ ;; js runtime utils
+ #:*ps-lisp-library*
+ #:mapcar
+ #:map-into
+ #:map
+ #:map-until
+ #:member
+ #:append
+ #:set-difference
+ ))
+ "All symbols considered part of the Parenscript language.")
(defpackage :parenscript
(:use :common-lisp)
(:nicknames :js :ps)
- #.(cons :export *shared-symbols-ps-js*)
#.(cons :export *parenscript-lang-exports*)
+
+ ;;; symbols that form the interface to the Parenscript compiler
(:export
;; compiler
#:compile-script
#:ps
#:ps*
-
+ #:ps-inline
+ #:ps-inline*
+
;; for parenscript macro definition within lisp
#:defpsmacro
#:defmacro/ps
#:defmacro+ps
#:import-macros-from-lisp
-
+
;; gensym
#:ps-gensym
#:with-ps-gensyms
#:*ps-gensym-counter*
+ ;; naming and namespaces
+ #:ps-package-prefix
+ #:obfuscate-package
+ #:unobfuscate-package
+
+ ;; printer
+ #:*js-string-delimiter*
+ #:*js-inline-string-delimiter*
+ #:*ps-print-pretty*
+ #:*indent-num-spaces*
+
;; deprecated interface
#:gen-js-name
#:gen-js-name-string
#:js-to-statement-strings
#:js
#:js*
+ #:let
))
+(defpackage :parenscript-special-forms
+ (:use))