Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to split namespace by package
Previously, Common Lisp pacage is used only for grouping variables and functions. Then, when they are output as JavaScript code, the namespace is not split. This commit introduces namespace also in JavaScript code by using closure. But some (dirty) hacks were required. First, to refer un-exported symbols, each package has a "_internal" member, then internal symbols can be referred as "<package>._internal.<symbol>". In addition, to identify un-imported symbol, ps:symbol-to-js-string is overwritten. Second, to send type-specifier to other package, quote is removed if it is attached to a type-specifier symbol. In Common Lisp, type-specifier can be specified using symbol, but it is converted to just a string by Parenscript. In other words, the information of package is lost. So in other package, we can no longer extract the type. To achieve this, "quote" in Parenscript is overwritten. Note: Variable, function and type-specfier are in a same namespace in a package unlike Common Lisp namespace. Note: Parenscript has a namespace system. It splits namespaces by adding prefix to all symbols in the package. But I wanted to achieve more Common Lisp like one that has symbol importing and exporting.
- Loading branch information