Add current pages from Chez Scheme site
wget --mirror --no-parent --cut-dirs 1 https://scheme.com/syntax-case/
This commit is contained in:
commit
ee82d1a5bf
|
@ -0,0 +1,66 @@
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/html4/loose.dtd"><!-- DO NOT EDIT THIS FILE-->
|
||||||
|
<!-- Edit the .tex version instead-->
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Portable syntax-case</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1 >Portable syntax-case</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="http://www.cs.indiana.edu/~aghuluom/">Abdulaziz Ghuloum</a>,
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/">R. Kent Dybvig</a>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The portable syntax-case macro system implements the restricted high-level
|
||||||
|
<tt>syntax-rules</tt> and equally high-level but general-purpose
|
||||||
|
<tt>syntax-case</tt> macros of the
|
||||||
|
<a href="http://www.r6rs.org">Revised<sup>6</sup> Report on Scheme</a> (R6RS).
|
||||||
|
It also implements R6RS libraries and all built-in R6RS syntactic forms.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The system is documented in the R6RS and also described, with numerous
|
||||||
|
examples, in Section 3.1 and Chapter 8 of
|
||||||
|
<a href="../tspl4/index.html">The Scheme Programming
|
||||||
|
Language, 4th edition</a>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Aspects of the macro system and its implementation are described in
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/pubs/LaSC-5-4-pp295-326-abstract.html">Syntactic
|
||||||
|
abstraction in Scheme</a>.
|
||||||
|
Additional examples of its use are given in
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/pubs/tr356-abstract.html">Writing
|
||||||
|
hygienic macros in Scheme with syntax-case</a>.
|
||||||
|
Aspects of the library system and its implementation are described in
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/pubs/implicit-phasing-abstract.html">Implicit
|
||||||
|
phasing for R6RS libraries</a>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The portable system is designed to be adaptable with minimal effort to
|
||||||
|
any R6RS or R5RS implementation of Scheme, with the
|
||||||
|
provision of a small set of implementation-dependent hooks.
|
||||||
|
Along with a reader, the system forms a complete front-end for Scheme.
|
||||||
|
If the reader and evaluator support source annotations (e.g., file
|
||||||
|
and line number information), these are handled as well to provide
|
||||||
|
source-object correlation.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
More information on the psyntax system and links to the implementation
|
||||||
|
can be found at Aziz Ghuloum's
|
||||||
|
<a href="http://ikarus-scheme.org/r6rs-libraries">psyntax page</a>,
|
||||||
|
a backup copy of which is <a href="r6rs-libraries/index.html">here</a>.
|
||||||
|
The system was created by Abdulaziz Ghuloum and Kent Dybvig based on an
|
||||||
|
<a href="old-psyntax.html">earlier implementation</a> by Kent Dybvig,
|
||||||
|
Oscar Waddell, Bob Hieb, and Carl Bruggeman.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,545 @@
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/html4/loose.dtd"><!-- DO NOT EDIT THIS FILE-->
|
||||||
|
<!-- Edit the .tex version instead-->
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Pre-R6RS Portable syntax-case</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1 >Pre-R6RS Portable syntax-case</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/">R. Kent Dybvig</a>,
|
||||||
|
<a href="http://www.cs.indiana.edu/~owaddell/">Oscar Waddell</a>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The syntax-case macro system implements the restricted high-level
|
||||||
|
<tt>syntax-rules</tt> macros of the Revised<sup>5</sup> Report
|
||||||
|
as well as the equally high-level but general-purpose
|
||||||
|
<tt>syntax-case</tt> macros.
|
||||||
|
It also supports a compatible module system that allows import and
|
||||||
|
export of macro bindings as well as bindings for variables and
|
||||||
|
modules.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The system is documented in Section 3.1 and Chapter 8 of
|
||||||
|
<a href="http://www.scheme.com/tspl3/">The Scheme Programming
|
||||||
|
Language, third edition</a> and in Chapter 9 of the
|
||||||
|
<a href="http://www.scheme.com/csug7/">Chez Scheme Version 7 User's
|
||||||
|
Guide</a>.
|
||||||
|
The former has more introductory material and examples, while the
|
||||||
|
latter documents some
|
||||||
|
aspects of the system not covered by the former.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Aspects of the system and its implementation are described in
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/pubs/LaSC-5-4-pp295-326-abstract.html">Syntactic
|
||||||
|
abstraction in Scheme</a>
|
||||||
|
and
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/pubs/popl99-abstract.html">Extending
|
||||||
|
the Scope of Syntactic Abstraction</a>
|
||||||
|
Additional examples of its use are given in
|
||||||
|
<a href="http://www.cs.indiana.edu/~dyb/pubs/tr356-abstract.html">Writing
|
||||||
|
hygienic macros in Scheme with syntax-case</a>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The portable system is designed to be adaptable with minimal effort to
|
||||||
|
any Revised<sup>5</sup> Report implementation of Scheme, with the
|
||||||
|
provision of a small set of implementation-dependent hooks to install
|
||||||
|
the expander.
|
||||||
|
Included with the portable expander are definitions of each of the
|
||||||
|
syntactic forms supported by the Revised<sup>5</sup> Report.
|
||||||
|
Along with a reader, the system forms a complete front-end for Scheme.
|
||||||
|
If the reader and evaluator support source annotations (e.g., file
|
||||||
|
and line number information), these are handled as well to provide
|
||||||
|
source-object correlation.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The portable syntax-case implementation consists of one file,
|
||||||
|
<a href="psyntax.ss">psyntax.ss</a>.
|
||||||
|
The file <a href="psyntax.pp">psyntax.pp</a> is
|
||||||
|
an expanded version of the file that may be used for bootstrapping
|
||||||
|
the system.
|
||||||
|
See the porting notes in psyntax.ss
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Please let us know if you successfully port this code to a new Scheme
|
||||||
|
implementation, and also please allow us to include the hooks you
|
||||||
|
develop in doing the port in this directory for use by others.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Please also contact us if you have difficulty porting to a new Scheme
|
||||||
|
implementation or if you discover that the implementation depends on
|
||||||
|
nonportable features of Chez Scheme in some undocumented way.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h2>Release Notes</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Version numbers refer to the version of Chez Scheme from which the
|
||||||
|
portable version was extracted.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 7.3 (2/26/2007)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="7.3/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="7.3/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li>The <tt>quasiquote</tt> form now guarantees that new pairs or vectors
|
||||||
|
will be allocated any time a nonempty <tt>unquote</tt> or
|
||||||
|
<tt>unquote-splicing</tt> form is used, even if the unquoted object
|
||||||
|
is itself a constant.
|
||||||
|
For example, while <tt>`(a . b)</tt> is equivalent to <tt>'(a . b)</tt>
|
||||||
|
and returns a constant pair (the same one each time the
|
||||||
|
<tt>quasiquote</tt> expression is evaluated, e.g., in a loop or procedure
|
||||||
|
called multiple times) <tt>`(,'a . ,'b)</tt> is equivalent to
|
||||||
|
<tt>(cons 'a 'b)</tt> so that a new pair is allocated each time the
|
||||||
|
<tt>quasiquote</tt> expression is evaluated.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>The <tt>generate-temporaries</tt> procedure no longer creates a
|
||||||
|
gensym but instead creates an ordinary symbol.
|
||||||
|
The symbols differ in name one from each other over the course of a
|
||||||
|
run and are given a special "tmp" mark to distinguish them from
|
||||||
|
other identifiers.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 7.1 (8/1/2006)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="7.1/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="7.1/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li><tt>syntax</tt> now disallows vectors starting with an
|
||||||
|
ellipsis, e.g., <tt>#'#(... foo)</tt>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>A new <tt>syntax->vector</tt> procedure, similar to <tt>syntax->list</tt>
|
||||||
|
has been added.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Support for <tt>quasisyntax</tt>, <tt>unsyntax</tt>, and
|
||||||
|
<tt>unsyntax-splicing</tt> forms has been added.
|
||||||
|
Implementations are encouraged to supply hash-backquote
|
||||||
|
( <tt>#`</tt> ), hash-comma ( <tt>#,</tt> ), and
|
||||||
|
hash-comma-at ( <tt>#,@</tt> ) abbreviations for the three new forms.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 7.0 (9/2/2005)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="7.0/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="7.0/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li><tt>quasiquote</tt> now leaves <tt>unquote</tt> untouched in
|
||||||
|
<tt>`#(a ... unqoute b)</tt> rather than trying to treat it as the
|
||||||
|
equivalent of <tt>(list->vector `(a ... . (unquote b)))</tt>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Some portability problems have been eliminated:
|
||||||
|
<tt>#4(---)</tt> in <tt>syntax-case</tt> is now <tt>#(---)</tt>;
|
||||||
|
a <tt>format</tt> call has been replaced with a call to
|
||||||
|
<tt>symbol->string</tt>; a call to <tt>list*</tt> has been
|
||||||
|
replaced with a <tt>quasiquote</tt> form;
|
||||||
|
<tt>remq</tt> is now defined where it is used (<tt>update-mode-set</tt>);
|
||||||
|
and dummy definitions have been added (but are commented out) for the
|
||||||
|
variables defined (assigned) by the system for implementations that
|
||||||
|
require them.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li><tt>syntax-rules</tt> now allows fenders.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Two new derived forms, <tt>with-implicit</tt> and <tt>datum</tt>,
|
||||||
|
and one new procedure, <tt>syntax->list</tt>, have been added.
|
||||||
|
See the <a href="http://www.scheme.com/csug7">Chez Scheme Version 7 User's Guide</a>
|
||||||
|
for descriptions.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li><tt>import-only</tt> at top level is officially treated as an
|
||||||
|
<tt>import</tt>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>An identifier <tt><i>x</i></tt> imported from a module <tt><i>m</i></tt> is now treated
|
||||||
|
in the importing context as if the corresponding export identifier had
|
||||||
|
been present in the import form along with <tt><i>m</i></tt>.
|
||||||
|
See the <a href="http://www.scheme.com/csug7">Chez Scheme Version 7 User's Guide</a>
|
||||||
|
for a description of the now current <tt>import</tt> semantics.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 6.9c (9/2/2004)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="6.9c/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="6.9c/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li>Added a meta prefix for definitions that tells the expander that
|
||||||
|
any variable definition resulting from the definition is to be an
|
||||||
|
expand-time definition available only on the right-hand sides of other
|
||||||
|
meta definitions and, most importantly, to transformer expressions.
|
||||||
|
It is used to define expand-time helpers and other information for use
|
||||||
|
by one or more <tt>syntax-case</tt> transformers.
|
||||||
|
See the comments in the code for examples of its use.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Added a new definition form <tt>alias</tt> which
|
||||||
|
may be used to create aliases from one identifier to another.
|
||||||
|
<tt>(alias <i>new-id</i> <i>old-id</i>)</tt> makes
|
||||||
|
<tt><i>new-id</i></tt> behave like <tt><i>old-id</i></tt>.
|
||||||
|
It is implemented by mapping <tt>new-id</tt>
|
||||||
|
to the same label, which may be <tt><i>old-id</i></tt> itself if <tt><i>old-id</i></tt>
|
||||||
|
is a top-level identifier.
|
||||||
|
(This feature was added to support the new <tt>import</tt> syntax
|
||||||
|
below.)
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Extended the syntax of <tt>import</tt> to allow for selection and
|
||||||
|
renaming of imports.
|
||||||
|
An <tt>import</tt> form now has the following syntax:
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p><tt>(import <i>spec</i> ...)</tt>
|
||||||
|
<p>Where <tt><i>spec</i></tt> is defined by the following grammar:
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TABLE><TR><TD nowrap align="left">
|
||||||
|
<i>spec</i></TD><TD nowrap align="center"><img src="math/site/0.gif" alt="<graphic>"></TD><TD nowrap align="left"><i>id</i></TD></TR><TR><TD nowrap align="left">
|
||||||
|
</TD><TD nowrap align="center">|</TD><TD nowrap align="left"><tt>(only</tt> <i>spec</i> <i>id</i>*<tt>)</tt></TD></TR><TR><TD nowrap align="left">
|
||||||
|
</TD><TD nowrap align="center">|</TD><TD nowrap align="left"><tt>(except</tt> <i>spec</i> <i>id</i>*<tt>)</tt></TD></TR><TR><TD nowrap align="left">
|
||||||
|
</TD><TD nowrap align="center">|</TD><TD nowrap align="left"><tt>(add-prefix</tt> <i>spec</i> <i>id</i><tt>)</tt></TD></TR><TR><TD nowrap align="left">
|
||||||
|
</TD><TD nowrap align="center">|</TD><TD nowrap align="left"><tt>(drop-prefix</tt> <i>spec</i> <i>id</i><tt>)</tt></TD></TR><TR><TD nowrap align="left">
|
||||||
|
</TD><TD nowrap align="center">|</TD><TD nowrap align="left"><tt>(rename</tt> <i>spec</i> (<i>new-id</i> <i>old-id</i>)*<tt>)</tt></TD></TR><TR><TD nowrap align="left">
|
||||||
|
</TD><TD nowrap align="center">|</TD><TD nowrap align="left"><tt>(alias</tt> <i>spec</i> (<i>new-id</i> <i>old-id</i>)*<tt>)</tt>
|
||||||
|
</TD></TR></TABLE>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<tt>only</tt> imports only the listed identifiers;
|
||||||
|
<tt>except</tt> imports all but the listed identifiers;
|
||||||
|
<tt>add-prefix</tt> adds the given prefix to the imports;
|
||||||
|
<tt>drops-prefix</tt> drops the given prefix to the imports, which must
|
||||||
|
all share the given prefix;
|
||||||
|
rename provides new names for the listed imports; and
|
||||||
|
alias provides additional names for the listed imports.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Eliminated separate per-body-form <tt>r</tt> and <tt>mr</tt> and with
|
||||||
|
them the need to destructively update environments.
|
||||||
|
The per-body-form <tt>r</tt> and <tt>mr</tt> did nothing more than control
|
||||||
|
the extent of <tt>let-syntax</tt>/<tt>letrec-syntax</tt> bindings to
|
||||||
|
prevent things like
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p><tt>(let ()<br>
|
||||||
|
|
||||||
|
(let-syntax ((a (identifier-syntax 3)))<br>
|
||||||
|
|
||||||
|
(define-syntax b (identifier-syntax a)))<br>
|
||||||
|
|
||||||
|
b)</tt>
|
||||||
|
<p>where <tt>a</tt> is not actually run until expand-time control has left the
|
||||||
|
<tt>let-syntax</tt> form.
|
||||||
|
This kind of thing is harmless, though, and in any case, <tt>a</tt> is
|
||||||
|
visible only within the body of the <tt>let-syntax</tt> form by virtue of the
|
||||||
|
wrap.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Replaced some uses of continuation-passing style in the <tt>chi</tt>
|
||||||
|
and <tt>parse</tt> procedures.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Cleaned up chi-top-module.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 6.9a (5/13/2003)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="6.9a/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="6.9a/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li>Made several modifications to support environments.
|
||||||
|
Changed name of <tt>put-global-definition-hook</tt> to
|
||||||
|
<tt>put-cte-hook</tt>.
|
||||||
|
Added new <tt>put-global-definition-hook</tt> that actually
|
||||||
|
does what you'd expect, i.e., install a binding that can be
|
||||||
|
retrieved by <tt>get-global-definition-hook</tt>.
|
||||||
|
Added third <tt><i>top-token</i></tt> argument to both <tt>$sc-put-cte</tt>
|
||||||
|
and <tt>build-cte-install</tt>,
|
||||||
|
identifying the top-level environment into which the binding
|
||||||
|
should be installed.
|
||||||
|
Added new <tt>read-only-binding?</tt> hook that can be used to
|
||||||
|
identify bindings that are read only (currently always returns false).
|
||||||
|
Added <tt>put-import-binding</tt>, which installs bindings
|
||||||
|
that can be retrieved by <tt>get-import-binding</tt>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>The new user-visible environment features are an <tt>environment?</tt>
|
||||||
|
predicate and <tt>interaction-environment</tt>.
|
||||||
|
Another new procedure, <tt>$make-environment</tt>, is also defined
|
||||||
|
by the system but is intended as a low-level feature to be
|
||||||
|
used by the host implementation to define other environments, such as
|
||||||
|
<tt>ieee</tt>, <tt>scheme-report</tt>, and <tt>null</tt>,
|
||||||
|
and possibly even user-defined environments, that are not directly
|
||||||
|
supported by the portable <tt>syntax-case</tt> expander.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li><tt>import-only</tt> is now supported at top level.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li><tt>define-syntax</tt> now supports the "defun" syntax, e.g.:
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p><tt>(define-syntax (foo x) (syntax-case x ---))</tt>
|
||||||
|
<p><li><tt>module</tt>, <tt>import</tt>, and <tt>import-only</tt>
|
||||||
|
are now macros that expand into
|
||||||
|
<tt>$module</tt>, <tt>$import</tt>, and <tt>$import-only</tt>.
|
||||||
|
This change was made primarily to simplify the expander by moving the
|
||||||
|
handling of anonymous modules into the macro versions.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>The build procedures, e.g., <tt>build-application</tt>,
|
||||||
|
now receive the entire annotated expression rather than just the source
|
||||||
|
extracted from the source annotation.
|
||||||
|
Along with this change,
|
||||||
|
renamed <tt>source</tt>, <tt>src</tt> and <tt>s</tt>
|
||||||
|
to <tt>ae</tt>
|
||||||
|
(for annotated expression) in many places, since the object passed
|
||||||
|
around is now the annotated expression rather than the source
|
||||||
|
extracted from the annotated expression.
|
||||||
|
<tt>annotation-stripped</tt> is now expected to return the stripped version
|
||||||
|
of an annotated expression, i.e., <tt>strip-annotation</tt> simply
|
||||||
|
grabs for the stripped version rather than traversing the (possibly
|
||||||
|
cyclic) annotated expression.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Added a new <tt>built-lambda?</tt> predicate that is used to recognize
|
||||||
|
<tt>lambda</tt> expressions built by <tt>build-lambda</tt>.
|
||||||
|
(This is used in handling deferred transformer bindings; see below.)
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Modified <tt>build-begin</tt> to weed out leading calls to
|
||||||
|
<tt>void</tt> and suppress the <tt>begin</tt> wrapper when
|
||||||
|
only one subexpression is present.
|
||||||
|
It assumes built <tt>void</tt> calls are represented as ordinary
|
||||||
|
s-expressions; change this if your <tt>build-application</tt>
|
||||||
|
uses some other representation for applications.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li><tt>make-binding</tt> now builds quoted structure if type is
|
||||||
|
known and value is false.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li><tt>transformer-env</tt> now strips out syntax variables, as it
|
||||||
|
should have been doing all along.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>So we can't be caught being lazy, we defer the evaluation of a
|
||||||
|
local transformer only if it is a <tt>lambda</tt> expression.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 6.9 (7/12/2002)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="6.9/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="6.9/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li>Changed <tt>chi-top-module</tt> so that definitions and initialization
|
||||||
|
forms in compiled files are not evaluated (by default) at visit time.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Recoded <tt>generate-id</tt> so that generated symbols have a
|
||||||
|
standard print representation and to avoid ASCII dependencies.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Extended the syntax of <tt>syntax-case</tt> patterns to allow a
|
||||||
|
fixed number of items after an ellipsis.
|
||||||
|
Ellipses are therefore no longer constrained to appear only at the end
|
||||||
|
of a list- or vector-structured form, but only one ellipsis can appear
|
||||||
|
at a given level of a list- or vector-structured form.
|
||||||
|
For example, <tt>(a ... b)</tt> matches a list of one or more
|
||||||
|
elements, with <tt>b</tt> bound to the last element and
|
||||||
|
<tt>a ...</tt> to all but the last element.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Added a local definition for a one-clause version of <tt>let-values</tt>
|
||||||
|
and recoded uses of <tt>call-with-values</tt> using
|
||||||
|
<tt>let-values</tt>.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Fixed two bugs in the portable expander.
|
||||||
|
One resulted in an error in <tt>vector-ref</tt> when redefining
|
||||||
|
a variable at top level that was previously imported from a module.
|
||||||
|
The other caused the wrong identifier to be exported in certain
|
||||||
|
circumstances, perhaps resulting in an inappropriate identifier out of
|
||||||
|
context error.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 6.8 (2/6/2002)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="6.8/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="6.8/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li>Added support for <tt>visit</tt> and <tt>revisit</tt> procedures,
|
||||||
|
which are relevant for systems that support <tt>compile-file</tt>:
|
||||||
|
<tt>visit</tt> is like <tt>load</tt> but loads only compile-time
|
||||||
|
information, and <tt>revisit</tt> is like <tt>load</tt> but loads
|
||||||
|
only run-time information.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Cleaned up and extended <tt>eval-when</tt> to handle new situations
|
||||||
|
<tt>visit</tt> and <tt>revisit</tt>.
|
||||||
|
A translation table that clearly shows what happens with nested
|
||||||
|
<tt>eval-when</tt> forms is given in the source.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Added <tt>literal-identifier=?</tt>.
|
||||||
|
<tt>literal-identifier=?</tt> is similar to
|
||||||
|
<tt>free-identifier=?</tt> except that the former equates
|
||||||
|
top-level identifiers that come from different modules, even if they
|
||||||
|
do not necessarily resolve to the same binding.
|
||||||
|
<tt>syntax-rules</tt> and <tt>syntax-case</tt> employ
|
||||||
|
literal-identifier=? to compare identifiers listed in the literals list
|
||||||
|
against input identifiers.
|
||||||
|
<tt>literal-identifier=?</tt> is intended for the
|
||||||
|
comparison of auxiliary keywords such as
|
||||||
|
<tt>else</tt> in <tt>cond</tt> and <tt>case</tt>, where
|
||||||
|
no actual binding is involved.
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<li>Fixed a bug in the portable expander that caused an application of
|
||||||
|
<tt>cdr</tt> to the empty list in <tt>build-sequence</tt>
|
||||||
|
for top-level modules with no exported definitions other than
|
||||||
|
reexports, e.g.,
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p><tt>(module m1 (a) (define a 3))<br>
|
||||||
|
|
||||||
|
(module m2 (a) (import m1))<br>
|
||||||
|
|
||||||
|
(let () (import m2) a) <img src="math/site/1.gif" alt="<graphic>"> 3</tt>
|
||||||
|
<p><li>Fixed a bug in the portable expander that prevented use of "hidden"
|
||||||
|
top-level definitions in the output of a macro, e.g.:
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p><tt>(define-syntax counter<br>
|
||||||
|
|
||||||
|
(syntax-rules ()<br>
|
||||||
|
|
||||||
|
((_ ref incr e)<br>
|
||||||
|
|
||||||
|
(begin<br>
|
||||||
|
|
||||||
|
(define hidden e)<br>
|
||||||
|
|
||||||
|
(define ref (lambda () hidden))<br>
|
||||||
|
|
||||||
|
(define incr (lambda (n) (set! hidden (+ hidden n))))))))<br>
|
||||||
|
|
||||||
|
(counter get bump 17)<br>
|
||||||
|
|
||||||
|
(get) <img src="math/site/1.gif" alt="<graphic>"> 17<br>
|
||||||
|
|
||||||
|
(bump 4)<br>
|
||||||
|
|
||||||
|
(get) <img src="math/site/1.gif" alt="<graphic>"> 21<br>
|
||||||
|
|
||||||
|
hidden <img src="math/site/1.gif" alt="<graphic>"> unbound error</tt>
|
||||||
|
<p><li>An incompatible change to the expander has been
|
||||||
|
made to reduce the loss of source information when one macro generates
|
||||||
|
another macro definition: List and vector structure in the subexpression
|
||||||
|
of a syntax form is no longer guaranteed to be list and vector structure
|
||||||
|
in the output form except where pattern variables are contained within
|
||||||
|
that structure.
|
||||||
|
For example, <tt>#'(a ...)</tt>, where <tt>a</tt> is a pattern
|
||||||
|
variable, is guaranteed to evaluate to a list, but the constant
|
||||||
|
structure <tt>(a b c d)</tt>, none of <tt>a</tt>, <tt>b</tt>,
|
||||||
|
<tt>c</tt>, and <tt>d</tt> are pattern variables, may not.
|
||||||
|
The practical consequence of this change is that constant
|
||||||
|
structures must be deconstructed using <tt>syntax-case</tt> or
|
||||||
|
<tt>syntax-rules</tt> rather than <tt>car</tt>, <tt>cdr</tt>,
|
||||||
|
and other list-processing operations.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<h3>Version 6.3 (8/30/2000)</h3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<a href="6.3/psyntax.ss">psyntax.ss</a>,
|
||||||
|
<a href="6.3/psyntax.pp">psyntax.pp</a>]
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li>The portable syntax-case macro system is now up-to-date with respect to
|
||||||
|
<a href="http://www.scheme.com/tspl2/">The Scheme Programming
|
||||||
|
Language, second edition</a> and the
|
||||||
|
<a href="http://www.scheme.com/csug/">Chez Scheme User's
|
||||||
|
Guide</a>.
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,472 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||||
|
<title>The portable R6RS library and syntax-case system</title>
|
||||||
|
<link href="style.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="mainPan">
|
||||||
|
<div id="topPan">
|
||||||
|
<!--<a href="index.html"><img src="images/logo.gif"
|
||||||
|
alt="Aquatic" width="136" height="31" border="0" class="logo"
|
||||||
|
title="Aquatic"/></a>
|
||||||
|
<p class="caption">leo pede eleifend</p>
|
||||||
|
-->
|
||||||
|
<div id="topcontactPan">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="headerPan">
|
||||||
|
<ul class="leftmenu">
|
||||||
|
<!-- <li><a href="../index.html">Ikarus</a></li>
-->
|
||||||
|
<li class="Solutions">psyntax</li>
|
||||||
|
<!--
|
||||||
|
<li><a href="#">About me</a></li>
|
||||||
|
<li><a href="#">Downloads</a></li>
|
||||||
|
<li><a href="#">Roadmap</a></li>
|
||||||
|
<li><a href="#">Development</a></li>
|
||||||
|
<li><a href="#">Changes</a></li>
|
||||||
|
<li><a href="#">License</a></li>
|
||||||
|
-->
|
||||||
|
<!--<li class="clients"><a href="#">Clients</a></li>-->
|
||||||
|
</ul>
|
||||||
|
<!--
|
||||||
|
<ul class="botton">
|
||||||
|
<li class="home"><a href="#">home</a></li>
|
||||||
|
<li class="aboutus"><a href="#">home</a></li>
|
||||||
|
<li class="contact"><a href="#">home</a></li>
|
||||||
|
</ul>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
<div id="bodyPan">
|
||||||
|
<div id="leftPan">
|
||||||
|
<h2>psyntax</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#about"><span>About psyntax</span></a></li>
|
||||||
|
<li><a href="#downloads"><span>Downloads</span></a></li>
|
||||||
|
<li><a href="#development"><span>Development</span></a></li>
|
||||||
|
<li><a href="#usage"><span>Basic Usage</span></a></li>
|
||||||
|
<li><a href="#structure"><span>Structure</span></a></li>
|
||||||
|
<li><a href="#nonr6"><span>Non-R6RS Req.</span></a></li>
|
||||||
|
<li><a href="#changes"><span>Changes</span></a></li>
|
||||||
|
<li><a href="#license"><span>License</span></a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<h2>Solutions</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#">Magna vel</a></li>
|
||||||
|
<li><a href="#">Neque porttitor</a></li>
|
||||||
|
<li><a href="#">Mollis. In</a></li>
|
||||||
|
<li><a href="#">Eleifend, risu</a></li>
|
||||||
|
<li><a href="#">Hendreritamc</a></li>
|
||||||
|
<li><a href="#">Tempor, pur</a></li>
|
||||||
|
</ul>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="rightPan">
|
||||||
|
|
||||||
|
<h1 id="about">About psyntax</h1>
|
||||||
|
|
||||||
|
<p>This page contains a reference implementation of the
|
||||||
|
proposed implicitly-phased libraries for R6RS. The
|
||||||
|
implementation is portable, depending only on a small set of
|
||||||
|
common primitives that are readily available in many
|
||||||
|
implementations. The implementation is also written as a
|
||||||
|
collection of R6RS libraries in order to take advantage of the
|
||||||
|
key R6RS libraries benefit: to easily isolate
|
||||||
|
implementation-dependent extensions in a mechanical way.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <p class="more"><a href="#">read more</a></p> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Supported Platforms</h1>
|
||||||
|
|
||||||
|
<p> The system is known to load and bootstrap itself properly
|
||||||
|
on the following Scheme implementations: </p>
|
||||||
|
|
||||||
|
<ul class="services">
|
||||||
|
<li> Bigloo 3.0b</li>
|
||||||
|
<li> Chez Scheme 7.2</li>
|
||||||
|
<li> Chicken 2.710</li>
|
||||||
|
<li> Gambit 4.0.1</li>
|
||||||
|
<li> Gauche 0.8.11</li>
|
||||||
|
<li> Ikarus (Build 2007-09-24)</li>
|
||||||
|
<li> Larceny 0.93</li>
|
||||||
|
<li> MIT-Scheme 7.7.90.+</li>
|
||||||
|
<li> MzScheme v371 [3m]</li>
|
||||||
|
<li> Petite Chez Scheme 7.2</li>
|
||||||
|
<li> Scheme48 1.7</li>
|
||||||
|
<li> SISC (1.16.6)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p> For every supported platform, there is a
|
||||||
|
"<tt><impl>.r6rs.ss</tt>"
|
||||||
|
file containing a small number of compatibility definitions
|
||||||
|
that allow loading the expanded system (e.g. <tt>psyntax.pp</tt>)
|
||||||
|
properly. </p>
|
||||||
|
|
||||||
|
<p> To port to another system, start by loading "<tt>psyntax.pp</tt>".
|
||||||
|
If you get an error about undefined variables, look for how
|
||||||
|
these variables are defined in the other <tt>*.r6rs.ss</tt> files and
|
||||||
|
port them over to your implementation. It would help to start
|
||||||
|
with a supported implementation that's most familiar to you.
|
||||||
|
Please let me know (email: aghuloum at cs.indiana.edu) if you
|
||||||
|
get the system ported to another platform. </p>
|
||||||
|
|
||||||
|
<h1 id="downloads">Downloads</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Download
|
||||||
|
<a href="psyntax-r6rs-rev4.tgz"><tt>psyntax-r6rs-rev4.tgz</tt></a>
|
||||||
|
(released Oct 27, 2007).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>Older versions</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="psyntax-r6rs-rev1.tgz"><tt>psyntax-r6rs-rev1.tgz</tt></a>
|
||||||
|
released on Oct 3, 2007.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h1 id="development">Development</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<p> Development of the portable syntax-case system is
|
||||||
|
continuing. For the latest snapshot, and to submit bug reports
|
||||||
|
and feature requests, please visit:
|
||||||
|
<a href="https://launchpad.net/r6rs-libraries/">Launchpad's
|
||||||
|
r6rs-libraries</a> project.</p>
|
||||||
|
|
||||||
|
<p>Access to the latest development snapshot is through
|
||||||
|
<a href="http://bazaar-vcs.org/">Bazaar Version Control</a>.
|
||||||
|
If you have <tt>bzr</tt>, you get the software by typing the
|
||||||
|
following command at your terminal:
|
||||||
|
</p>
|
||||||
|
<pre>
|
||||||
|
$ bzr branch http://bazaar.launchpad.net/~aghuloum/r6rs-libraries/r6rs-libraries.dev
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<h1 id="usage">Basic Usage</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<p>To run an r6rs script on your system, you'll need the
|
||||||
|
following files:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li> The script you want to run (say <tt>hello-world.ss</tt>).</li>
|
||||||
|
<li> The <tt>host.r6rs.ss</tt> file for your platform.</li>
|
||||||
|
<li> The <tt>pre-built/psyntax-host.pp</tt> file.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>For example, we may have a script that looks like:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
$ cat hello-world.ss
|
||||||
|
(import (rnrs io simple))
|
||||||
|
(display "Hello World\n")
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<p>We copy our host's <tt>pre-built/psyntax-host.pp</tt> to
|
||||||
|
<tt>psyntax.pp</tt>
|
||||||
|
For Petite Chez Scheme, we'd do:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
$ cp pre-built/psyntax-petite.pp .
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<p>Run your implementation's <tt>r6rs.ss</tt> file passing the
|
||||||
|
script name as an extra argument. For example, under petite,
|
||||||
|
we do:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
$ petite --script petite.r6rs.ss hello-world.ss
|
||||||
|
r6rs psyntax ready
|
||||||
|
Hello World
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<p> If you want to write a library, say <tt>(my-library)</tt> as:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
$ cat my-library.ss
|
||||||
|
(library (my-library)
|
||||||
|
(export print-hello)
|
||||||
|
(import (rnrs))
|
||||||
|
(define (print-hello)
|
||||||
|
(display "Hello World\n")))
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<p>And then write your <tt>hello-world.ss</tt> script as:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
$ cat hello-world.ss
|
||||||
|
(import (my-library))
|
||||||
|
(print-hello)
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<p>Then, you can run it as before:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
$ petite --script petite.r6rs.ss hello-world.ss
|
||||||
|
r6rs psyntax ready
|
||||||
|
Hello World
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p>The library system takes care of mapping the library names
|
||||||
|
that you import to file names via a primitive simple
|
||||||
|
mapping:</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
(foo) => ./foo.ss
|
||||||
|
(foo bar) => ./foo/bar.ss
|
||||||
|
...
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<p> To avoid any problems now, stick with names that contain
|
||||||
|
characters in <tt>[a..z]</tt>, <tt>[A..Z]</tt>,
|
||||||
|
<tt>[0..9]</tt>, "<tt>-</tt>", "<tt>_</tt>", "<tt>~</tt>", and
|
||||||
|
"<tt>.</tt>". If you have ideas about a general
|
||||||
|
library-name->file-name mapping that you'd like to share,
|
||||||
|
please do email me.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p> That's pretty much it as far as basic usage is concerned.
|
||||||
|
Let me know if you have any problems.</p>
|
||||||
|
|
||||||
|
<h1 id="structure">Structure of the system</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><tt>Makefile</tt> Used to build the system under all supported
|
||||||
|
platforms.</li>
|
||||||
|
|
||||||
|
<li><tt>README.txt</tt> The file you're reading right now.</li>
|
||||||
|
|
||||||
|
<li><tt>psyntax-buildscript.ss</tt>
|
||||||
|
An r6rs script that's used to bootstrap the whole system.</li>
|
||||||
|
|
||||||
|
<li><tt>*.r6rs.ss</tt>
|
||||||
|
Compatibility files for supported platforms with the exception of
|
||||||
|
<tt>kawa.r6rs.ss</tt> which is not working yet.</li>
|
||||||
|
|
||||||
|
<li><tt>pre-built/*.pp</tt>
|
||||||
|
Pre-built expanded files for the supported platforms.</li>
|
||||||
|
|
||||||
|
<li><tt>session-id</tt>
|
||||||
|
Used by gensym to generate unique ids across sessions.</li>
|
||||||
|
|
||||||
|
<li><tt>examples hello-world.ss</tt>
|
||||||
|
Example scripts.</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li><tt>psyntax/internal.ss</tt> <tt>(psyntax internal)</tt><br/>
|
||||||
|
Contains definitions of some internal procedures that are used by
|
||||||
|
the system but may need to be modified to get optimal performance
|
||||||
|
and usability on any platform. It is currently written as a
|
||||||
|
common-denominator of all supported platforms.</li>
|
||||||
|
|
||||||
|
<li><tt>psyntax/builders.ss</tt>
|
||||||
|
<tt>(psyntax builders)</tt> <br/>
|
||||||
|
Exports procedures/macros that are used by the expander to build
|
||||||
|
the output expression. For example, build-letrec is used to build
|
||||||
|
letrec expressions. Implementations with tight integration may
|
||||||
|
replace the builders with constructors of compiler-internal data
|
||||||
|
structures.</li>
|
||||||
|
|
||||||
|
<li><tt>psyntax/expander.ss</tt>
|
||||||
|
<tt>(psyntax expander)</tt><br/>
|
||||||
|
The core of the expander.</li>
|
||||||
|
|
||||||
|
<li><tt>psyntax/library-manager.ss</tt>
|
||||||
|
<tt>(psyntax library-manager)</tt><br/>
|
||||||
|
The library manager keeps track of what libraries are installed
|
||||||
|
and available on the system. It takes care of visiting/invoking
|
||||||
|
such libraries as well as loading them from source files. </li>
|
||||||
|
|
||||||
|
<li><tt>psyntax/config.ss</tt>
|
||||||
|
<tt>(psyntax config)</tt><br/>
|
||||||
|
This is a compile-time configuration file for determining what
|
||||||
|
forms the implementation supports (e.g. is case-lambda supported
|
||||||
|
or should it be expanded). The provided configuration is one that
|
||||||
|
works for all implementation (common denominator).</li>
|
||||||
|
|
||||||
|
<li><tt>psyntax/compat.ss</tt>
|
||||||
|
<tt>(psyntax compat)</tt><br/>
|
||||||
|
This is a compatibility file for some non-r6rs forms that are used
|
||||||
|
in other libraries but can be implemented portably in terms of
|
||||||
|
other r6rs features. make-parameter, parameterize, and
|
||||||
|
define-record.</li>
|
||||||
|
|
||||||
|
<li><tt>psyntax/main.ss</tt>
|
||||||
|
<tt>(psyntax main)</tt><br/>
|
||||||
|
This library is the main entry point to the r6rs world. It
|
||||||
|
prints a greeting message and processes the file given in the
|
||||||
|
command line argument as an r6rs-script.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h1 id="nonr6">Non-R6RS requirements</h1>
|
||||||
|
|
||||||
|
<p> <tt>void</tt>: The procedure void is used in the output of the
|
||||||
|
expander when we don't care about a value (e.g. to provide the
|
||||||
|
initial values for the <tt>letrec*</tt>/internal-defines). A call
|
||||||
|
to void should not signal any errors. <tt>(define (void) (if #f
|
||||||
|
#f))</tt> suffices for this purpose.</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p><tt>pretty-print</tt>: The procedure pretty-print should take
|
||||||
|
one or two values: an expression (code) to be printed and,
|
||||||
|
optionally, an output port. It should pretty-print the code to that
|
||||||
|
port (or the current-output-port if a port is not provided.
|
||||||
|
Implementations with no pretty printer can <tt>(define pretty-print
|
||||||
|
write)</tt> for this purpose but the output won't be very
|
||||||
|
readable.</p>
|
||||||
|
|
||||||
|
<p><tt>eval-core</tt>: This procedure should take a core s-expression and
|
||||||
|
evaluate it in a "top-level" environment. R5RS implementations can
|
||||||
|
define it as</p>
|
||||||
|
<pre>
|
||||||
|
(define (eval-core x) (eval x (interaction-environment)))
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
<p><tt>gensym</tt>: The procedure gensym should create a globally unique symbol
|
||||||
|
with read/write invariance. It is used to create unique locations
|
||||||
|
for exported identifiers, unique names for lexical variables, and
|
||||||
|
unique labels in the expand-time environment. Of the supported
|
||||||
|
Scheme implementations, only Chez Scheme and Ikarus provide a usable
|
||||||
|
gensym implementation for this purpose; yet their printed
|
||||||
|
represenation of gensyms are not portable (cannot be read by the
|
||||||
|
other R5RS implementations). For this, we provide a gensym
|
||||||
|
implementation that's semi portable but relies on an external state
|
||||||
|
(session-id file) to ensure that the sequence of symbols generated
|
||||||
|
are unique across sessions. Gensym takes an optional argument that
|
||||||
|
is either a string or a symbol that can be used to correlate the
|
||||||
|
source name of the identifier with its unique name. The output of
|
||||||
|
our implementation of gensym looks like</p>
|
||||||
|
<pre>
|
||||||
|
<name>$<session-id>$<gensym-id>
|
||||||
|
</pre>
|
||||||
|
where both session-id and gensym-id are nonnegative integers.
|
||||||
|
|
||||||
|
<p><tt>symbol-value</tt>: This procedure takes a symbol
|
||||||
|
(typically a gensym) and returns the value associated with it
|
||||||
|
in the global environment. The symbol is guaranteed to be
|
||||||
|
initialized either via a global <tt>define</tt> or via
|
||||||
|
<tt>set-symbol-value!</tt> (below).</p>
|
||||||
|
|
||||||
|
<p><tt>set-symbol-value!</tt>: This procedure takes a symbol
|
||||||
|
(typically a gensym) and a value and associates the value with
|
||||||
|
the symbol in the global environment (in a way that eval-core
|
||||||
|
can properly see it).</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h1 id="changes">Changes</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><p>Oct 27, 2007:
|
||||||
|
All of R6RS core syntactic forms are now supported by the
|
||||||
|
expander including <tt>define-record-type</tt>,
|
||||||
|
<tt>record-type-descriptor</tt>,
|
||||||
|
<tt>record-constructor-descriptor</tt>,
|
||||||
|
<tt>define-condition-type</tt>, <tt>define-enumeration</tt>,
|
||||||
|
and <tt>guard</tt>.
|
||||||
|
The expander now parses and enforces
|
||||||
|
version and subversion requirements for imported libraries.
|
||||||
|
The initial library set have proper version names,
|
||||||
|
<tt>(6)</tt>.
|
||||||
|
</p></li>
|
||||||
|
|
||||||
|
<li><p>Oct 3, 2007: Initial release (at ICFP 2007).
|
||||||
|
Implements most of the core functionality of R6RS including
|
||||||
|
the expander and the library manager.</p> </li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h1 id="license">License</h1>
|
||||||
|
|
||||||
|
<p>The following license applies to all of the distributed
|
||||||
|
psyntax files: </p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
Copyright (c) 2006, 2007 Abdulaziz Ghuloum and Kent Dybvig
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person
|
||||||
|
obtaining a copy of this software and associated documentation files
|
||||||
|
(the "Software"), to deal in the Software without restriction,
|
||||||
|
including without limitation the rights to use, copy, modify, merge,
|
||||||
|
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||||
|
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE. </pre>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<ul class="services">
|
||||||
|
<li class="captionone">Quis magna vel</li>
|
||||||
|
<li><a href="#">Amet, consectetuer</a></li>
|
||||||
|
<li><a href="#">Adipiscing elit.</a></li>
|
||||||
|
<li><a href="#">Praesent scing ips</a></li>
|
||||||
|
<li><a href="#">Um Id nislpo.</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="servicestwo">
|
||||||
|
<li class="captiontwo">Quis magna vel</li>
|
||||||
|
<li><a href="#">Amet, consectetuer</a></li>
|
||||||
|
<li><a href="#">Adipiscing elit.</a></li>
|
||||||
|
<li><a href="#">Praesent scing ips</a></li>
|
||||||
|
<li><a href="#">Um Id nislpo.</a></li>
|
||||||
|
</ul>
|
||||||
|
<p class="more"><a href="#">read more</a></p>
|
||||||
|
<h4>current events</h4>
|
||||||
|
<ul class="events">
|
||||||
|
<li class="captionthree">24.07.06</li>
|
||||||
|
<li><a href="#">Amet, consectetuer Adipiscing elit. Praesent </a></li>
|
||||||
|
<li><a href="#">Scing ipconvallis, leo pede eleifend orci, sed</a></li>
|
||||||
|
<li><a href="#">lobortis orci tortor id erat. Etiam facilisis. Etiam</a></li>
|
||||||
|
<li><a href="#">Rutrum nuncs</a></li>
|
||||||
|
</ul>
|
||||||
|
<p class="more"><a href="#">read more</a></p>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="footermainPan">
|
||||||
|
<div id="footerPan">
|
||||||
|
<ul>
|
||||||
|
<li><a href="../index.html">Ikarus</a>| </li>
|
||||||
|
<li><a href="#about">psyntax</a></li>
|
||||||
|
</ul>
|
||||||
|
<!--<p class="copyright">©aquatic. All right reserved.</p>-->
|
||||||
|
<div id="footerPanhtml"><a href="http://validator.w3.org/check?uri=referer" target="_blank">XHTML</a></div>
|
||||||
|
<div id="footerPancss"><a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">css</a></div>
|
||||||
|
<ul class="templateworld">
|
||||||
|
<li>original design by:</li>
|
||||||
|
<li><a href="http://www.templateworld.com" target="_blank">Template World</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,155 @@
|
||||||
|
/* CSS Document */
|
||||||
|
body{padding:0px; margin:0px; background:url(images/main-bg.gif) 0 0
|
||||||
|
repeat-x #fff;
|
||||||
|
/* color:#5F7A77; */
|
||||||
|
color:#205050;
|
||||||
|
font:14px/19px Arial, Helvetica, sans-serif;}
|
||||||
|
div, p, ul, h2, h3, h4, h5, img{padding:0px; margin:0px;}
|
||||||
|
body pre{ font:14px/19px Monaco, monospace; }
|
||||||
|
body tt{ font:14px/19px Monaco, monospace; }
|
||||||
|
ul{list-style-type:none}
|
||||||
|
|
||||||
|
/*----MAIN PANEL----*/
|
||||||
|
#mainPan{width:778px; position:relative; margin:0 auto;}
|
||||||
|
|
||||||
|
/*----TOP PANEL----*/
|
||||||
|
#topPan{width:778px; height:65px;
|
||||||
|
background:url(images/topbg.jpg) 0 0 no-repeat #fff;
|
||||||
|
color:#828282; position:relative; margin:0 auto;}
|
||||||
|
#topPan img.logo{width:136px; height:31px; position:absolute; top:12px; left:235px;}
|
||||||
|
#topPan p.caption{width:200px; background:#fff; color:#828282; position:absolute; top:43px; left:235px;}
|
||||||
|
#topcontactPan{width:181px; height:36px;
|
||||||
|
/* background:url(images/icon1.jpg) 68px 0px no-repeat; */
|
||||||
|
/* position:absolute; top:11px; left:567px; padding:7px 0 0; */
|
||||||
|
}
|
||||||
|
|
||||||
|
#topcontactPan p.callus{width:63px; height:17px; display:block; background:#DDC40C; color:#fff; font:14px/17px "Trebuchet MS", Arial, Helvetica, sans-serif; font-weight:bold; text-transform:uppercase; text-align:center;}
|
||||||
|
#topcontactPan p.tollfree{width:63px; height:20px; display:block; background:#fff; color:#A99607; font:11px/20px "Trebuchet MS", Arial, Helvetica, sans-serif; font-weight:bold; text-transform:uppercase; text-align:center;}
|
||||||
|
#topcontactPan p.phoneno{width:88px; height:28px; display:block; position:absolute; top:7px; left:91px; background:#fff; color:#00473E; border:1px solid #A2C1C0; font-size:11px; line-height:14px; text-align:center;}
|
||||||
|
/*----/TOP PANEL----*/
|
||||||
|
|
||||||
|
/*----HEADER PANEL----*/
|
||||||
|
#headerPan{width:686px; height:153px;
|
||||||
|
background:url(images/header.png) 0 0 no-repeat;
|
||||||
|
position:relative; margin:0 auto; padding:11px 0 0 92px;}
|
||||||
|
|
||||||
|
#headerPan ul.leftmenu{width:87px;}
|
||||||
|
#headerPan ul.leftmenu li{width:87px; height:22px; border-bottom:1px dashed #AECCCA;}
|
||||||
|
#headerPan ul.leftmenu li a{width:72px; height:22px; display:block; background:url(images/bullet-normal.gif) 0 7px no-repeat #fff; color:#305E5C; line-height:22px; text-decoration:none; padding:0 0 0 15px;}
|
||||||
|
#headerPan ul.leftmenu li a:hover{background:url(images/bullet-hover.gif) 0 7px no-repeat #fff; color:#305E5C; line-height:22px; text-decoration:none; padding:0 0 0 15px;}
|
||||||
|
#headerPan ul.leftmenu li.Solutions{width:72px; height:22px; display:block; background:url(images/bullet-hover.gif) 0 7px no-repeat #fff; color:#305E5C; line-height:22px; text-decoration:none; padding:0 0 0 15px;}
|
||||||
|
#headerPan ul.leftmenu li.clients{width:87px; height:22px; border-bottom:none;}
|
||||||
|
|
||||||
|
#headerPan ul.botton{width:150px; height:45px; position:absolute; top:118px; left:250px;}
|
||||||
|
#headerPan ul.botton li{float:left; height:45px;}
|
||||||
|
#headerPan ul.botton li.home a{width:42px; height:45px; display:block; background:url(images/home-normal.gif) 0 0 no-repeat; text-indent:-200000px; margin:0 12px 0 0;}
|
||||||
|
#headerPan ul.botton li.home a:hover{background:url(images/home-hover.gif) 0 0 no-repeat;}
|
||||||
|
|
||||||
|
#headerPan ul.botton li.aboutus a{width:42px; height:45px; display:block; background:url(images/aboutus-normal.gif) 0 0 no-repeat; text-indent:-200000px; margin:0 12px 0 0;}
|
||||||
|
#headerPan ul.botton li.aboutus a:hover{background:url(images/aboutus-hover.gif) 0 0 no-repeat;}
|
||||||
|
|
||||||
|
#headerPan ul.botton li.contact a{width:42px; height:45px; display:block; background:url(images/contact-normal.gif) 0 0 no-repeat; text-indent:-200000px; margin:0px;}
|
||||||
|
#headerPan ul.botton li.contact a:hover{background:url(images/contact-hover.gif) 0 0 no-repeat;}
|
||||||
|
/*----/HEADER PANEL----*/
|
||||||
|
|
||||||
|
/*----BODY PANEL----*/
|
||||||
|
#bodyPan{width:686px; background:url(images/bodybg.gif) 0 0 no-repeat; position:relative; margin:0 auto; padding:22px 0 0 92px;}
|
||||||
|
/*----Body Left Panel----*/
|
||||||
|
#leftPan{width:114px; float:left;}
|
||||||
|
|
||||||
|
#leftPan h2{width:114px; height:34px; background:#fff; color:#5F7A77; font-size:18px; line-height:34px;}
|
||||||
|
|
||||||
|
#leftPan ul{width:114px;}
|
||||||
|
#leftPan ul li{width:114px; height:24px;}
|
||||||
|
#leftPan ul li a{width:102px; height:24px; display:block; background:url(images/bullet2-normal.gif) 0 10px no-repeat #fff; color:#5F7A77; text-decoration:none; line-height:24px; padding:0 0 0 12px;}
|
||||||
|
#leftPan ul li a:hover{background:url(images/bullet2-hover.gif) 0 10px no-repeat #fff; color:#5F7A77; text-decoration:none;}
|
||||||
|
#leftPan ul li span{text-decoration:underline;}
|
||||||
|
/*----/Body Left Panel----*/
|
||||||
|
/*----Body Right Panel----*/
|
||||||
|
#rightPan{width:511px; float:left; border-left:1px solid #C8E8E2; margin:28px 0 0; padding:0 30px;}
|
||||||
|
#rightPan p{padding:0 0 10px 0;}
|
||||||
|
#rightPan p.more{width:502px; height:25px; float:left; background:url(images/sky-color-bg.gif) 0 10px repeat-x; padding:0 0 20px 0;}
|
||||||
|
#rightPan p.more a{width:92px; height:21px; display:block; background:url(images/icon2.jpg) 0 0 no-repeat #fff; color:#958201; line-height:21px; text-transform:uppercase; text-decoration:none; margin:0 0 0 328px; padding:4px 0 0 50px;}
|
||||||
|
#rightPan p.more a:hover{background:url(images/icon2.jpg) 0 0 no-repeat #fff; color:#645804; text-decoration:none;}
|
||||||
|
|
||||||
|
#rightPan h1{
|
||||||
|
width:300px;
|
||||||
|
/* height:37px; */
|
||||||
|
/* float:left; */
|
||||||
|
display:block;
|
||||||
|
/* background:url(images/bullet-normal.gif) no-repeat 12px 20px #B1DED5; */
|
||||||
|
background:url(images/bullet-normal.gif) no-repeat 12px 20px #A0C0C0;
|
||||||
|
/* background:#bdd; */
|
||||||
|
color:#ffffff;
|
||||||
|
font-size:18px;
|
||||||
|
font-weight:bold;
|
||||||
|
line-height:18px;
|
||||||
|
text-transform:uppercase;
|
||||||
|
padding:16px 16px 16px 32px;
|
||||||
|
margin:20px 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#rightPan a{
|
||||||
|
color:#408080;
|
||||||
|
text-decoration:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#rightPan a:hover{
|
||||||
|
color:#408080;
|
||||||
|
text-decoration:underline; }
|
||||||
|
|
||||||
|
#rightPan ul{
|
||||||
|
border:0px
|
||||||
|
solid #B1DED5;
|
||||||
|
background:#fff;
|
||||||
|
padding:7px 7px 7px 25px;
|
||||||
|
margin:0 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#rightPan ul li{
|
||||||
|
display:block;
|
||||||
|
background:url(images/bullet2-normal.gif) 0 10px no-repeat #fff;
|
||||||
|
text-decoration:none; line-height:24px;
|
||||||
|
padding:2px 0 0 12px;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#rightPan h4{width:96px; height:77px; float:left; display:block; background:url(images/icon4.jpg) 8px 38px no-repeat #DFD79C; color:#fff; font-size:16px; font-weight:bold; line-height:18px; text-transform:uppercase; padding:46px 0 0 75px; margin:0 0 5px 0;}
|
||||||
|
|
||||||
|
#rightPan ul.events{width:305px; height:114px; float:left; border:1px solid #B1DED5; background:#fff; color:#5F7A77; padding:7px 0 0 25px;}
|
||||||
|
|
||||||
|
#rightPan ul.events li.captionthree{background:#fff; color:#AC9601; font-size:12px; font-weight:bold; text-decoration:none;}
|
||||||
|
|
||||||
|
#rightPan ul.events li{width:305px; height:20px;}
|
||||||
|
#rightPan ul.events li a{width:293px; height:20px; display:block; background:url(images/bullet2-normal.gif) 0 7px no-repeat #fff; color:#959595; text-decoration:underline; line-height:20px; padding:0 0 0 12px;}
|
||||||
|
#rightPan ul.events li a:hover{background:url(images/bullet2-hover.gif) 0 7px no-repeat #fff; color:#5F7A77; text-decoration:underline;}
|
||||||
|
|
||||||
|
/*----/Body Right Panel----*/
|
||||||
|
/*----/BODY PANEL----*/
|
||||||
|
/*----/MAIN PANEL----*/
|
||||||
|
|
||||||
|
/*----FOOTER PANEL----*/
|
||||||
|
#footermainPan{height:103px; background:url(images/footerbg.gif) 0 0 repeat-x #D3F0F0; color:#2F5958; font:13px/20px "Trebuchet MS", Arial, Helvetica, sans-serif; position:relative; margin:0 auto; clear:both; padding:36px 0 0;}
|
||||||
|
#footerPan{width:778px; position:relative; margin:0 auto;}
|
||||||
|
|
||||||
|
#footerPan ul{width:608px; height:20px; position:relative; margin:0 auto;}
|
||||||
|
#footerPan li{float:left; }
|
||||||
|
#footerPan ul li a{padding:0 10px 0; color:#2F5958; background:#EBF8F7; text-decoration:none; font-size:13px;}
|
||||||
|
#footerPan ul li a:hover{text-decoration:underline;}
|
||||||
|
|
||||||
|
#footerPan p.copyright{width:250px; margin:10px 0 0 92px;}
|
||||||
|
|
||||||
|
#footerPan ul.templateworld{width:250px; background:#D3F0F0; color:#007163; display:block; font-size:10px; position:absolute; top:49px; left:92px;}
|
||||||
|
#footerPan ul.templateworld li{height:20px;}
|
||||||
|
#footerPan ul.templateworld li a{background:#D3F0F0; display:block; color:#007163; text-decoration:none; padding:0px; font-size:10px;}
|
||||||
|
#footerPan ul.templateworld li a:hover{text-decoration:underline;}
|
||||||
|
|
||||||
|
#footerPanhtml{width:70px; height:24px; display:block; position:absolute; top:35px; left:549px;}
|
||||||
|
#footerPanhtml a{width:64px; height:24px; display:block; background:url(images/html-normal.gif) 0 0 no-repeat #D3F0F0; color:#fff; font-size:13px; line-height:23px; font-weight:bold; text-decoration:none;text-transform:uppercase; padding:0 0 0 7px;}
|
||||||
|
#footerPanhtml a:hover{background:url(images/html-hover.gif) 0 0 no-repeat #D3F0F0; color:#fff;}
|
||||||
|
#footerPancss{width:58px; height:24px; display:block; position:absolute; top:35px; left:624px;}
|
||||||
|
#footerPancss a{width:49px; height:24px; display:block; background:url(images/css-normal.gif) 0 0 no-repeat #D3F0F0; color:#fff; font-size:13px; line-height:24px; font-weight:bold; text-decoration:none; text-transform:uppercase; padding:0 0 0 10px;}
|
||||||
|
#footerPancss a:hover{background:url(images/css-hover.gif) 0 0 no-repeat #D3F0F0; color:#fff; text-decoration:none;}
|
||||||
|
/*----/FOOTER PANEL----*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue