<br><br>If you want alpha testers or help in any way, please let me know. <br><br>I have one comment,<br>It would be a good thing if the name-mangling/code generation is implemented so it can be tweaked. Your example suggest to make functions with prefixed names on the global object, like "friendlyScript_helloWorld". But some might want to generate the code in another way, for example make a literal object called friendlyScript with "helloWorld" as one key and the code (function/lambda) as value. It would be nice if both ways and others could be supported. I don't mean you should implement both, but have a generic function or similar interface for generating the function definitions and one for generating the function calls.
<br><br>Thanks, I'm looking forward to this.<br><br>/Henrik Hjelte<br><br><br><br><br><div><span class="gmail_quote">On 6/27/07, <b class="gmail_sendername">Red Daly</b> <<a href="mailto:firstname.lastname@example.org">email@example.com
<br><br>A Parenscript package (or "script package" or simply "package," as opposed to a "Lisp package") has a few main properties: a name and list of nicknames, an primary associated Lisp package, a list of exported identifiers, and a collection of macros defined in the associated Lisp package. We must also introduce and formalize a two other concepts: Parenscript identifiers (analog of Lisp symbols), and a compilation environment.
<br><br>A Parenscript package is defined and exists in the context of a compilation environment. A compilation environment simply keeps track of compiler state; when any Parenscript code is compiled, a new compilation environment is created or an existing one is passed to the compiler. The environment is modified to reflect the lexical scope as forms are processed. Specifically, the compilation environment will consist of a stack of Parenscript identifiers (introduced by defun and defvar forms); a stack of macros and symbol macros; a list of defined script packages; and the current script package.
<br><br>An identifier in Parenscript is analogous to a Lisp symbol, but it only exists during compile time. An identifier has a string value and associated Parenscript package.<br><br>Now I will run through a simple example to demonstrate these new developments:
<br><br>Script packages are primarily defined using a Parenscript form analogous to the Lisp defpackage:<br><br>(defpackage friendly-script<br> (:use parenscript psos)<br> (:export hello-world)<br> (:lisp-package friendly)
<br> (:documentation "Scripts for issuing greetings."))<br><br>This introduces a new package into the compilation environment. We enter the package system after it is defined as in Lisp:<br><br>;; enter the friendly-script package
<br>; changes the current package in the compilation environment to :friendly-script<br>(in-package :friendly-script)<br><br>;; define the hello-world function, which we export<br>; adds friendly-script::hello-world to the identifier stack in the compilation env.
<br>(defun hello-world ()<br> (alert "hello world."))<br><br>;; enter the user package<br>; changes current package in compilation environment<br>(in-package :parenscript-user)<br><br>;; call the friendly-script's hello-world function
<br><br>friendlyScript_helloWorld();<br><br><br>In terms of implementation, the package system will introduce a few new classes (script-package, identifier, and compilation-environment); uproot existing parsing procedures and replant them around the package system; and add a semantic analysis phase into the compilation pipeline. I will fill in details and announce problems with the implementation as it moves forward.
<br><br>Anyhow, I look forward to comments on this proposal. Happy hacking!<br><span class="sg"><br>Red<br>
</span><br>_______________________________________________<br>parenscript-devel mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:firstname.lastname@example.org">email@example.com
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a>