X-Git-Url: http://git.hcoop.net/clinton/parenscript.git/blobdiff_plain/7a5c62dc9046222136af59e4217fad8731c6d538..83a26b36c:/src/package.lisp diff --git a/src/package.lisp b/src/package.lisp index ce7688b..dc3a441 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1,9 +1,8 @@ -(in-package :cl-user) +(in-package "CL-USER") (eval-when (:compile-toplevel :load-toplevel :execute) (defparameter *parenscript-lang-exports* - '( - ;; literals + '(;; literals #:t #:f #:true @@ -11,6 +10,7 @@ #:this #:false #:undefined + #:{} ;; keywords #:break @@ -20,7 +20,9 @@ #:array #:list #:aref + #:elt #:make-array + #:[] ;; operators #:! #:not #:~ @@ -48,10 +50,6 @@ #:create #:with-slots - ;; macros - #:macrolet - #:symbol-macrolet - ;; if #:if #:when @@ -94,7 +92,7 @@ #:do* #:dotimes #:dolist - #:doeach + #:loop ;; with #:with @@ -116,6 +114,8 @@ ;; function definition #:defun #:lambda + #:flet + #:labels ;; lambda lists #:&key @@ -134,7 +134,7 @@ #:macrolet #:symbol-macrolet #:define-symbol-macro - #:define-script-symbol-macro + #:define-ps-symbol-macro #:defmacro ;; lisp eval @@ -143,7 +143,10 @@ ;; 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 @@ -158,6 +161,7 @@ #:asin #:acos #:atan + #:pi #:sinh #:cosh #:tanh @@ -176,9 +180,21 @@ #:random #:ignore-errors #:concatenate + #:concat-string #:length #:null + #:defined + #:undefined #:@ + #:with-lambda + #:stringp + #:numberp + #:functionp + #:objectp + #:memoize + #:append + #:apply + #:destructuring-bind ;; js runtime utils #:*ps-lisp-library* @@ -190,56 +206,95 @@ #:append #:set-difference )) - "All symbols considered part of the Parenscript language.") + (defparameter *parenscript-interface-exports* + '(;; compiler + #:compile-script + #:ps + #:ps-doc + #:ps-doc* + #:ps* + #:ps1* + #: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-once-only + #:*ps-gensym-counter* + + ;; naming and namespaces + #:ps-package-prefix + #:obfuscate-package + #:unobfuscate-package + + ;; printer + #:symbol-to-js-string + #:*js-string-delimiter* + #:*js-inline-string-delimiter* + #:*ps-print-pretty* + #:*indent-num-spaces* + )) + (defparameter *parenscript-interface-deprecated-exports* + '(;; deprecated interface + #:define-script-symbol-macro + #:gen-js-name + #:with-unique-js-names + #:defjsmacro + #:js-compile + #:js-inline + #:js-inline* + #:js + #:js* + #:symbol-to-js + )) + + (defparameter *javascript-exports* + '(;; for representing js code as s-expressions + #:? + #:if + #:unary-operator + #:-- + #:! + #:block + #:literal + #:break + #:continue + #:return + #:throw + #:array + #:aref + #:++ + #:+= + #:operator + #:-= + #:- + #:= + #:cond + #:lambda + #:object + #:variable + #:slot-value + #:new + #:funcall + #:instanceof + #:in + #: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*) + ) - ;;; symbols that form the interface to the Parenscript compiler - (:export - ;; compiler - #:compile-script - #:ps - #:ps-doc - #: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-once-only - #:*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 - #:with-unique-js-names - #:defjsmacro - #:js-compile - #:js-inline - #:js-inline* - #:js - #:js* - )) - -(defpackage :parenscript-special-forms - (:use))