From mevenson at common-lisp.net Sat Oct 1 20:38:06 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sat, 01 Oct 2011 13:38:06 -0700 Subject: [armedbear-cvs] r13610 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sat Oct 1 13:38:05 2011 New Revision: 13610 Log: More grinding out the manual. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Fri Sep 30 07:33:22 2011 (r13609) +++ trunk/abcl/doc/manual/abcl.tex Sat Oct 1 13:38:05 2011 (r13610) @@ -17,18 +17,17 @@ implementation for users of the system. \subsection{Version} -This manual corresponds to abcl-0.27.0, as yet unreleased. - +This manual corresponds to abcl-0.28.0, as yet unreleased. \chapter{Running} ABCL is packaged as a single jar file (usually named either -``abcl.jar'' or something like``abcl-0.27.1.jar'' if you are using a +``abcl.jar'' or something like``abcl-0.28.0.jar'' if you are using a versioned package) that can be executed under the control of a suitable JVM as follows \begin{listing-shell} - cmd\$ java -jar abcl.jar + cmd$ java -jar abcl.jar \end{listing-shell} For this command to work, the ``java'' executable needs to be in your @@ -40,7 +39,7 @@ simply as: \begin{listing-shell} - cmd\$ abcl + cmd$ abcl \end{listing-shell} \section{Options} @@ -90,8 +89,9 @@ to the following (known) issues: \begin{itemize} - \item Lack of long form of DEFINE-METHOD-COMBINATION \item Missing statement of conformance in accompanying documentation + \item The generic function sigatures of the DOCUMENTATION symbol do + not match the CLHS. \end{itemize} ABCL aims to be be a fully conforming ANSI Common Lisp @@ -101,13 +101,15 @@ In addition to ANSI conformance, ABCL strives to implement features expected of a contemporary Common Lisp. \begin{itemize} - \item Incomplete MOP + \item Incomplete (A)MOP % N.B. % TODO go through AMOP with symbols, starting by looking for % matching function signature. % XXX is this really blocking ANSI conformance? Answer: we have % to start with such a ``census'' to determine what we have. - \item Incomplete Gray Streams + \item Incomplete Streams: need suitable abstraction between ANSI + and Gray streams. + \end{itemize} \chapter{Interaction with host JVM} @@ -189,12 +191,13 @@ life-cycle is a bit out of your control (like in a Java servlet), a safer invocation pattern might be: -\begin{code}[java] +\begin{listing-java} Interpreter interpreter = Interpreter.getInstance(); if (interpreter == null) { interpreter = Interpreter.createInstance(); } -\end{code} +\end{listing-java} + The Lisp \code{eval} primitive may be simply passed strings for evaluation, as follows @@ -323,8 +326,31 @@ specification which are either widely adopted or are especially useful in working with the hosting JVM. -\section{Extensible Sequences} +\section{Implementation Dependent} +\begin{enumerate} + \item Compiler to JVM 5 bytecode + \item Pathname extensionsn +\end{enumerate} + +\section{Pathname} + +ABCL has created three specializations of the ANSI Pathname construct +to enable to use of URIs to address dynamically loaded resources for +the JVM. + +PATHNAME : URL-PATHNAME : JAR-PATHNAME + : LOGICAL-PATHNAME +Among other neat befits, this allows the ABCL user to laod dynamically +code from URIs like Quicklisp. + +\begin{listing-lisp} + CL-USER> (load ''http://beta.quicklisp.org/quicklisp.lisp'') +\end{listing-lisp} + + + +\section{Extensible Sequences} \ref{RHODES2007} @@ -393,6 +419,9 @@ maintainers, who have strived to improve its usability as a contemporary Common Lisp implementation. +In 201x, with the publication of this Manual stating its confformance +to ANSI, we released abcl-1.0. + \end{document} From mevenson at common-lisp.net Sun Oct 2 08:04:45 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 01:04:45 -0700 Subject: [armedbear-cvs] r13611 - trunk/abcl/doc/design/pathnames Message-ID: Author: mevenson Date: Sun Oct 2 01:04:44 2011 New Revision: 13611 Log: Start article describing the implementation of URL-PATHNAME. Added: trunk/abcl/doc/design/pathnames/notes.tex trunk/abcl/doc/design/pathnames/pathnames.tex Added: trunk/abcl/doc/design/pathnames/notes.tex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/doc/design/pathnames/notes.tex Sun Oct 2 01:04:44 2011 (r13611) @@ -0,0 +1,493 @@ +\begin{verbatim} +JARs and JAR entries in ABCL +============================ + + Mark Evenson + Created: 09 JAN 2010 + Modified: 21 JUN 2011 + +Notes towards an implementation of "jar:" references to be contained +in Common Lisp `PATHNAME`s within ABCL. + +Goals +----- + +1. Use Common Lisp pathnames to refer to entries in a jar file. + +2. Use `'jar:'` schema as documented in [`java.net.JarURLConnection`][jarURLConnection] for + namestring representation. + + An entry in a JAR file: + + #p"jar:file:baz.jar!/foo" + + A JAR file: + + #p"jar:file:baz.jar!/" + + A JAR file accessible via URL + + #p"jar:http://example.org/abcl.jar!/" + + An entry in a ABCL FASL in a URL accessible JAR file + + #p"jar:jar:http://example.org/abcl.jar!/foo.abcl!/foo-1.cls" + +[jarUrlConnection]: http://java.sun.com/javase/6/docs/api/java/net/JarURLConnection.html + +3. `MERGE-PATHNAMES` working for jar entries in the following use cases: + + (merge-pathnames "foo-1.cls" "jar:jar:file:baz.jar!/foo.abcl!/foo._") + ==> "jar:jar:file:baz.jar!/foo.abcl!/foo-1.cls" + + (merge-pathnames "foo-1.cls" "jar:file:foo.abcl!/") + ==> "jar:file:foo.abcl!/foo-1.cls" + +4. TRUENAME and PROBE-FILE working with "jar:" with TRUENAME + cannonicalizing the JAR reference. + +5. DIRECTORY working within JAR files (and within JAR in JAR). + +6. References "jar:" for all strings that java.net.URL can + resolve works. + +7. Make jar pathnames work as a valid argument for OPEN with +:DIRECTION :INPUT. + +8. Enable the loading of ASDF systems packaged within jar files. + +9. Enable the matching of jar pathnames with PATHNAME-MATCH-P + + (pathname-match-p + "jar:file:/a/b/some.jar!/a/system/def.asd" + "jar:file:/**/*.jar!/**/*.asd") + ==> t + +Status +------ + +All the above goals have been implemented and tested. + + +Implementation +-------------- + +A PATHNAME refering to a file within a JAR is known as a JAR PATHNAME. +It can either refer to the entire JAR file or an entry within the JAR +file. + +A JAR PATHNAME always has a DEVICE which is a proper list. This +distinguishes it from other uses of Pathname. + +The DEVICE of a JAR PATHNAME will be a list with either one or two +elements. The first element of the JAR PATHNAME can be either a +PATHNAME representing a JAR on the filesystem, or a URL PATHNAME. + +A PATHNAME occuring in the list in the DEVICE of a JAR PATHNAME is +known as a DEVICE PATHNAME. + +Only the first entry in the the DEVICE list may be a URL PATHNAME. + +Otherwise the the DEVICE PATHAME denotes the PATHNAME of the JAR file. + +The DEVICE PATHNAME list of enclosing JARs runs from outermost to +innermost. The implementaion currently limits this list to have at +most two elements. + +The DIRECTORY component of a JAR PATHNAME should be a list starting +with the :ABSOLUTE keyword. Even though hierarchial entries in jar +files are stored in the form "foo/bar/a.lisp" not "/foo/bar/a.lisp", +the meaning of DIRECTORY component is better represented as an +absolute path. + +A jar Pathname has type JAR-PATHNAME, derived from PATHNAME. + + +BNF +--- + +An incomplete BNF of the syntax of JAR PATHNAME would be: + + JAR-PATHNAME ::= "jar:" URL "!/" [ ENTRY ] + + URL ::= + | JAR-FILE-PATHNAME + + JAR-FILE-PATHNAME ::= "jar:" "file:" JAR-NAMESTRING "!/" [ ENTRY ] + + JAR-NAMESTRING ::= ABSOLUTE-FILE-NAMESTRING + | RELATIVE-FILE-NAMESTRING + + ENTRY ::= [ DIRECTORY "/"]* FILE + + +### Notes + +1. `ABSOLUTE-FILE-NAMESTRING` and `RELATIVE-FILE-NAMESTRING` can use +the local filesystem conventions, meaning that on Windows this could +contain '\' as the directory separator, which are always normalized to +'/'. An `ENTRY` always uses '/' to separate directories within the +jar archive. + + +Use Cases +--------- + + // UC1 -- JAR + pathname: { + namestring: "jar:file:foo/baz.jar!/" + device: ( + pathname: { + device: "jar:file:" + directory: (:RELATIVE "foo") + name: "baz" + type: "jar" + } + ) + } + + + // UC2 -- JAR entry + pathname: { + namestring: "jar:file:baz.jar!/foo.abcl" + device: ( pathname: { + device: "jar:file:" + name: "baz" + type: "jar" + }) + name: "foo" + type: "abcl" + } + + + // UC3 -- JAR file in a JAR entry + pathname: { + namestring: "jar:jar:file:baz.jar!/foo.abcl!/" + device: ( + pathname: { + name: "baz" + type: "jar" + } + pathname: { + name: "foo" + type: "abcl" + } + ) + } + + // UC4 -- JAR entry in a JAR entry with directories + pathname: { + namestring: "jar:jar:file:a/baz.jar!/b/c/foo.abcl!/this/that/foo-20.cls" + device: ( + pathname { + directory: (:RELATIVE "a") + name: "bar" + type: "jar" + } + pathname { + directory: (:RELATIVE "b" "c") + name: "foo" + type: "abcl" + } + ) + directory: (:RELATIVE "this" "that") + name: "foo-20" + type: "cls" + } + + // UC5 -- JAR Entry in a JAR Entry + pathname: { + namestring: "jar:jar:file:a/foo/baz.jar!/c/d/foo.abcl!/a/b/bar-1.cls" + device: ( + pathname: { + directory: (:RELATIVE "a" "foo") + name: "baz" + type: "jar" + } + pathname: { + directory: (:RELATIVE "c" "d") + name: "foo" + type: "abcl" + } + ) + directory: (:ABSOLUTE "a" "b") + name: "bar-1" + type: "cls" + } + + // UC6 -- JAR entry in a http: accessible JAR file + pathname: { + namestring: "jar:http://example.org/abcl.jar!/org/armedbear/lisp/Version.class", + device: ( + pathname: { + namestring: "http://example.org/abcl.jar" + } + pathname: { + directory: (:RELATIVE "org" "armedbear" "lisp") + name: "Version" + type: "class" + } + } + + // UC7 -- JAR Entry in a JAR Entry in a URL accessible JAR FILE + pathname: { + namestring "jar:jar:http://example.org/abcl.jar!/foo.abcl!/foo-1.cls" + device: ( + pathname: { + namestring: "http://example.org/abcl.jar" + } + pathname: { + name: "foo" + type: "abcl" + } + ) + name: "foo-1" + type: "cls" + } + + // UC8 -- JAR in an absolute directory + + pathame: { + namestring: "jar:file:/a/b/foo.jar!/" + device: ( + pathname: { + directory: (:ABSOLUTE "a" "b") + name: "foo" + type: "jar" + } + ) + } + + // UC9 -- JAR in an relative directory with entry + pathname: { + namestring: "jar:file:a/b/foo.jar!/c/d/foo.lisp" + device: ( + directory: (:RELATIVE "a" "b") + name: "foo" + type: "jar" + ) + directory: (:ABSOLUTE "c" "d") + name: "foo" + type: "lisp + } + + +URI Encoding +------------ + +As a subtype of URL-PATHNAMES, JAR-PATHNAMES follow all the rules for +that type. Most notably this means that all #\Space characters should +be encoded as '%20' when dealing with jar entries. + + +History +------- + +Previously, ABCL did have some support for jar pathnames. This support +used the convention that the if the device field was itself a +pathname, the device pathname contained the location of the jar. + +In the analysis of the desire to treat jar pathnames as valid +locations for `LOAD`, we determined that we needed a "double" pathname +so we could refer to the components of a packed FASL in jar. At first +we thought we could support such a syntax by having the device +pathname's device refer to the inner jar. But with in this use of +`PATHNAME`s linked by the `DEVICE` field, we found the problem that UNC +path support uses the `DEVICE` field so JARs located on UNC mounts can't +be referenced. via '\\', i.e. + + jar:jar:file:\\server\share\a\b\foo.jar!/this\that!/foo.java + +would not have a valid representation. + +So instead of having `DEVICE` point to a `PATHNAME`, we decided that the +`DEVICE` shall be a list of `PATHNAME`, so we would have: + + pathname: { + namestring: "jar:jar:file:\\server\share\foo.jar!/foo.abcl!/" + device: ( + pathname: { + host: "server" + device: "share" + name: "foo" + type: "jar" + } + pathname: { + name: "foo" + type: "abcl" + } + ) + } + +Although there is a fair amount of special logic inside `Pathname.java` +itself in the resulting implementation, the logic in `Load.java` seems +to have been considerably simplified. + +When we implemented URL Pathnames, the special syntax for URL as an +abstract string in the first position of the device list was naturally +replaced with a URL pathname. + +\end{verbatim} +\begin{verbatim} + + + +URL Pathnames ABCL +================== + + Mark Evenson + Created: 25 MAR 2010 + Modified: 21 JUN 2011 + +Notes towards an implementation of URL references to be contained in +Common Lisp `PATHNAME` objects within ABCL. + + +References +---------- + +RFC3986 Uniform Resource Identifier (URI): Generic Syntax + + +URL vs URI +---------- + +We use the term URL as shorthand in describing the URL Pathnames, even +though the corresponding encoding is more akin to a URI as described +in RFC3986. + + +Goals +----- + +1. Use Common Lisp pathnames to refer to representations referenced +by a URL. + +2. The URL schemes supported shall include at least "http", and those +enabled by the URLStreamHandler extension mechanism. + +3. Use URL schemes that are understood by the java.net.URL object. + + Example of a Pathname specified by URL: + + #p"http://example.org/org/armedbear/systems/pgp.asd" + +4. MERGE-PATHNAMES + + (merge-pathnames "url.asd" + "http://example/org/armedbear/systems/pgp.asd") + ==> "http://example/org/armedbear/systems/url.asd" + +5. PROBE-FILE returning the state of URL accesibility. + +6. TRUENAME "aliased" to PROBE-FILE signalling an error if the URL is +not accessible (see "Non-goal 1"). + +7. DIRECTORY works for non-wildcards. + +8. URL pathname work as a valid argument for OPEN with :DIRECTION :INPUT. + +9. Enable the loading of ASDF2 systems referenced by a URL pathname. + +10. Pathnames constructed with the "file" scheme +(i.e. #p"file:/this/file") need to be properly URI encoded according +to RFC3986 or otherwise will signal FILE-ERROR. + +11. The "file" scheme will continue to be represented by an +"ordinary" Pathname. Thus, after construction of a URL Pathname with +the "file" scheme, the namestring of the resulting PATHNAME will no +longer contain the "file:" prefix. + +12. The "jar" scheme will continue to be represented by a jar +Pathname. + + +Non-goals +--------- + +1. We will not implement canonicalization of URL schemas (such as +following "http" redirects). + +2. DIRECTORY will not work for URL pathnames containing wildcards. + + +Implementation +-------------- + +A PATHNAME refering to a resource referenced by a URL is known as a +URL PATHNAME. + +A URL PATHNAME always has a HOST component which is a proper list. +This list will be an property list (plist). The property list +values must be character strings. + + :SCHEME + Scheme of URI ("http", "ftp", "bundle", etc.) + :AUTHORITY + Valid authority according to the URI scheme. For "http" this + could be "example.org:8080". + :QUERY + The query of the URI + :FRAGMENT + The fragment portion of the URI + +The DIRECTORY, NAME and TYPE fields of the PATHNAME are used to form +the URI `path` according to the conventions of the UNIX filesystem +(i.e. '/' is the directory separator). In a sense the HOST contains +the base URL, to which the `path` is a relative URL (although this +abstraction is violated somwhat by the storing of the QUERY and +FRAGMENT portions of the URI in the HOST component). + +For the purposes of PATHNAME-MATCH-P, two URL pathnames may be said to +match if their HOST compoments are EQUAL, and all other components are +considered to match according to the existing rules for Pathnames. + +A URL pathname must have a DEVICE whose value is NIL. + +Upon creation, the presence of ".." and "." components in the +DIRECTORY are removed. The DIRECTORY component, if present, is always +absolute. + +The namestring of a URL pathname shall be formed by the usual +conventions of a URL. + +A URL Pathname has type URL-PATHNAME, derived from PATHNAME. + + +URI Encoding +------------ + +For dealing with URI Encoding (also known as [Percent Encoding]() we +adopt the following rules + +[Percent Encoding]: http://en.wikipedia.org/wiki/Percent-encoding + +1. All pathname components are represented "as is" without escaping. + +2. Namestrings are suitably escaped if the Pathname is a URL-PATHNAME + or a JAR-PATHNAME. + +3. Namestrings should all "round-trip": + + (when (typep p 'pathname) + (equal (namestring p) + (namestring (pathname p)))) + + +Status +------ + +This design has been implemented. + + +History +------- + +26 NOV 2010 Changed implemenation to use URI encodings for the "file" + schemes including those nested with the "jar" scheme by like + aka. "jar:file:/location/of/some.jar!/". + +21 JUN 2011 Fixed implementation to properly handle URI encodings + refering nested jar archive. + +\end{verbatim} Added: trunk/abcl/doc/design/pathnames/pathnames.tex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/doc/design/pathnames/pathnames.tex Sun Oct 2 01:04:44 2011 (r13611) @@ -0,0 +1,22 @@ +% -*- mode: latex; -*- +% http://en.wikibooks.org/wiki/LaTeX/ +\documentclass[10pt]{article} +% \usepackage{abcl} + +\begin{document} +\title{An Implementation and Analysis of Addding IRI to Common Lisp's Pathname} +\date{October 2011} +\author{Mark~Evenson} + +\maketitle + +\section{Abstract} + +We implement the semantics for distributed resource description and +retrieval by URL/URI/IRI Pathname in the Armeedbear Common Lisp implementation. + +\section{Notes} +\include{notes} + +\end{document} + From mevenson at common-lisp.net Sun Oct 2 08:26:03 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 01:26:03 -0700 Subject: [armedbear-cvs] r13612 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Oct 2 01:26:03 2011 New Revision: 13612 Log: Edit for more consistent voice. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Oct 2 01:04:44 2011 (r13611) +++ trunk/abcl/doc/manual/abcl.tex Sun Oct 2 01:26:03 2011 (r13612) @@ -5,7 +5,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{August 4, 2011} +\date{October 2, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stallo, Ville~Voutilainen} \maketitle @@ -21,16 +21,18 @@ \chapter{Running} -ABCL is packaged as a single jar file (usually named either +ABCL is packaged as a single jar file usually named either ``abcl.jar'' or something like``abcl-0.28.0.jar'' if you are using a -versioned package) that can be executed under the -control of a suitable JVM as follows +versioned package from your system vendor. This byte archive can be +executed under the control of a suitable JVM by using the ``-jar'' +option to parse the manifest, and select the named class +(org.armedbear.lisp.Main) for excution: \begin{listing-shell} cmd$ java -jar abcl.jar \end{listing-shell} -For this command to work, the ``java'' executable needs to be in your +N.b. for this command to work, the ``java'' executable needs to be in your path. To make it easier to facilitate the use of ABCL in tool chains (such as @@ -232,14 +234,18 @@ \end{listing-java} If one is calling an primitive function in the CL package the syntax -becomes considerably simpler if we can locate the instance of -definition in the ABCL source, we can invoke the symbol directly. To -tell if a `LispObject` contains a reference to a symbol. +becomes considerably simpler. If we can locate the instance of +definition in the ABCL Java source, we can invoke the symbol directly. +For instnace, to tell if a `LispObject` contains a reference to a symbol. \begin{listing-java} boolean nullp(LispObject object) { LispObject result = Primitives.NULL.execute(object); - if (result == NIL) { + if (result == NIL) { // the symbol 'NIL' is explicity named in the Java + // namespace at ``Symbol.NIL'' + // but is always present in the + // localnamespace in its unadorned form for + // the convenience of the User. return false; } return true; @@ -263,8 +269,10 @@ boolean javaValue = object.getBooleanValue(); \end{listing-java} -Although since in Lisp, any value other than NIL means "true", the -use of Java equality it quite a bit easier and more optimal: +Although since in Lisp, any value other than NIL means "true" +(so-called generalized Boolean), the use of Java equality it quite a +bit easier to type and more optimal in terms of information it conveys +to the compiler would be: \begin{listing-java} boolean javaValue = (object != Symbol.NIL); @@ -334,6 +342,13 @@ \section{Pathname} +We implment an extension to the Pathname that allows for the +description and retrieval of resources named in a URI scheme that the +JVM ``understands''. Support is built-in to the ``http'' and +``https'' implementations but additional protocol handlers may be +installed at runtime by having JVM symbols present in the +sun.net.protocol.dynmamic pacakge. See [JAVA2006] for more details. + ABCL has created three specializations of the ANSI Pathname construct to enable to use of URIs to address dynamically loaded resources for the JVM. @@ -419,8 +434,12 @@ maintainers, who have strived to improve its usability as a contemporary Common Lisp implementation. -In 201x, with the publication of this Manual stating its confformance -to ANSI, we released abcl-1.0. +In 201x, with the publication of this Manual explicitly stating the +conformance of Armed Bear Common Lisp to ANSI, we release abcl-1.0. + +\section{References} + +[Java2000]: A New Era for Java Protocol Handlers. \url{http://java.sun.com/developer/onlineTraining/protocolhandlers} \end{document} From mevenson at common-lisp.net Sun Oct 2 08:33:04 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 01:33:04 -0700 Subject: [armedbear-cvs] r13613 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Oct 2 01:33:03 2011 New Revision: 13613 Log: Differention symbols as to functions, generic functions, and macros. Update scrape of docstrings Modified: trunk/abcl/doc/manual/extensions.tex trunk/abcl/doc/manual/java.tex Modified: trunk/abcl/doc/manual/extensions.tex ============================================================================== --- trunk/abcl/doc/manual/extensions.tex Sun Oct 2 01:26:03 2011 (r13612) +++ trunk/abcl/doc/manual/extensions.tex Sun Oct 2 01:33:03 2011 (r13613) @@ -1,12 +1,12 @@ \begin{verbatim} %CADDR - Function: (not documented) + Macro: (not documented) %CADR - Function: (not documented) + Macro: (not documented) %CAR - Function: (not documented) + Macro: (not documented) %CDR - Function: (not documented) + Macro: (not documented) *AUTOLOAD-VERBOSE* Variable: (not documented) *BATCH-MODE* @@ -54,7 +54,7 @@ AUTOLOADP Function: (not documented) AVER - Function: (not documented) + Macro: (not documented) CANCEL-FINALIZATION Function: (not documented) CHAR-TO-UTF8 @@ -64,7 +64,7 @@ CLASSP Function: (not documented) COLLECT - Function: (not documented) + Macro: (not documented) COMPILE-FILE-IF-NEEDED Function: (not documented) COMPILE-SYSTEM @@ -144,7 +144,7 @@ NIL-VECTOR Class: (not documented) PATHNAME-JAR-P - Function: Predicate for whether PATHNAME references a JAR. + Function: (not documented) PATHNAME-URL-P Function: Predicate for whether PATHNAME references a URL. PRECOMPILE @@ -226,7 +226,7 @@ STYLE-WARN Function: (not documented) TRULY-THE - Function: (not documented) + Special Operator: (not documented) UPTIME Function: (not documented) URI-DECODE Modified: trunk/abcl/doc/manual/java.tex ============================================================================== --- trunk/abcl/doc/manual/java.tex Sun Oct 2 01:26:03 2011 (r13612) +++ trunk/abcl/doc/manual/java.tex Sun Oct 2 01:33:03 2011 (r13613) @@ -1,247 +1,158 @@ \begin{verbatim} - %JGET-PROPERTY-VALUE Function: Gets a JavaBeans property on JAVA-OBJECT. - %JSET-PROPERTY-VALUE Function: Sets a JavaBean property on JAVA-OBJECT. - -*JAVA-OBJECT-TO-STRING-LENGTH* - Variable: Length to truncate toString() - PRINT-OBJECT output for an otherwise unspecialized JAVA-OBJECT. Can - be set to NIL to indicate no limit. - +*JAVA-OBJECT-TO-STRING-LENGTH* + Variable: Length to truncate toString() PRINT-OBJECT output for an otherwise unspecialized JAVA-OBJECT. Can be set to NIL to indicate no limit. ++FALSE+ + Variable: (not documented) ++NULL+ + Variable: (not documented) ++TRUE+ + Variable: (not documented) ADD-TO-CLASSPATH - Function: (not documented) - + Generic Function: (not documented) CHAIN - Function: (not documented) - + Macro: (not documented) DESCRIBE-JAVA-OBJECT Function: (not documented) - DUMP-CLASSPATH Function: (not documented) - ENSURE-JAVA-CLASS Function: (not documented) - ENSURE-JAVA-OBJECT Function: Ensures OBJ is wrapped in a JAVA-OBJECT, wrapping it if necessary. - +GET-CURRENT-CLASSLOADER + Function: (not documented) GET-DEFAULT-CLASSLOADER Function: (not documented) - JARRAY-COMPONENT-TYPE Function: Returns the component type of the array type ATYPE - JARRAY-LENGTH Function: (not documented) - JARRAY-REF - Function: Dereferences the Java array JAVA-ARRAY using the given - INDICIES, coercing the result into a Lisp object, if possible. - + Function: Dereferences the Java array JAVA-ARRAY using the given INDICIES, coercing the result into a Lisp object, if possible. JARRAY-REF-RAW - Function: Dereference the Java array JAVA-ARRAY using the given - INDICIES. Does not attempt to coerce the result into a Lisp object. - + Function: Dereference the Java array JAVA-ARRAY using the given INDICIES. Does not attempt to coerce the result into a Lisp object. JARRAY-SET Function: Stores NEW-VALUE at the given index in JAVA-ARRAY. - JAVA-CLASS Class: (not documented) - JAVA-EXCEPTION Class: (not documented) - JAVA-EXCEPTION-CAUSE - Function: Returns the cause of JAVA-EXCEPTION. (The cause is the Java Throwable - + Function: (not documented) JAVA-OBJECT Class: (not documented) - JAVA-OBJECT-P Function: Returns T if OBJECT is a JAVA-OBJECT. - JCALL - Function: Invokes the Java method METHOD-REF on INSTANCE with - arguments ARGS, coercing the result into a Lisp object, if possible. - + Function: Invokes the Java method METHOD-REF on INSTANCE with arguments ARGS, coercing the result into a Lisp object, if possible. JCALL-RAW - Function: Invokes the Java method METHOD-REF on INSTANCE with - arguments ARGS. Does not attempt to coerce the result into a Lisp - object. - + Function: Invokes the Java method METHOD-REF on INSTANCE with arguments ARGS. Does not attempt to coerce the result into a Lisp object. JCLASS - Function: Returns a reference to the Java class designated by - NAME-OR-CLASS-REF. If the CLASS-LOADER parameter is passed, the class - is resolved with respect to the given ClassLoader. - + Function: Returns a reference to the Java class designated by NAME-OR-CLASS-REF. If the CLASS-LOADER parameter is passed, the class is resolved with respect to the given ClassLoader. JCLASS-ARRAY-P Function: Returns T if CLASS is an array class - JCLASS-CONSTRUCTORS Function: Returns a vector of constructors for CLASS - JCLASS-FIELD Function: Returns the field named FIELD-NAME of CLASS - JCLASS-FIELDS - Function: Returns a vector of all (or just the declared/public, if - DECLARED/PUBLIC is true) fields of CLASS - + Function: Returns a vector of all (or just the declared/public, if DECLARED/PUBLIC is true) fields of CLASS JCLASS-INTERFACE-P Function: Returns T if CLASS is an interface - JCLASS-INTERFACES Function: Returns the vector of interfaces of CLASS - JCLASS-METHODS - Function: Return a vector of all (or just the declared/public, if - DECLARED/PUBLIC is true) methods of CLASS - + Function: Return a vector of all (or just the declared/public, if DECLARED/PUBLIC is true) methods of CLASS JCLASS-NAME - Function: When called with one argument, returns the name of the Java class - + Function: (not documented) JCLASS-OF Function: (not documented) - JCLASS-SUPERCLASS Function: Returns the superclass of CLASS, or NIL if it hasn't got one - JCLASS-SUPERCLASS-P Function: Returns T if CLASS-1 is a superclass or interface of CLASS-2 - JCOERCE - Function: Attempts to coerce OBJECT into a JavaObject of class - INTENDED-CLASS. Raises a TYPE-ERROR if no conversion is possible. - + Function: Attempts to coerce OBJECT into a JavaObject of class INTENDED-CLASS. Raises a TYPE-ERROR if no conversion is possible. JCONSTRUCTOR - Function: Returns a reference to the Java constructor of CLASS-REF - with the given PARAMETER-CLASS-REFS. - + Function: Returns a reference to the Java constructor of CLASS-REF with the given PARAMETER-CLASS-REFS. JCONSTRUCTOR-PARAMS Function: Returns a vector of parameter types (Java classes) for CONSTRUCTOR - JEQUAL Function: Compares obj1 with obj2 using java.lang.Object.equals() - JFIELD Function: Retrieves or modifies a field in a Java class or instance. - JFIELD-NAME Function: Returns the name of FIELD as a Lisp string - JFIELD-RAW Function: Retrieves or modifies a field in a Java class or instance. Does not - JFIELD-TYPE Function: Returns the type (Java class) of FIELD - JINSTANCE-OF-P Function: OBJ is an instance of CLASS (or one of its subclasses) - JINTERFACE-IMPLEMENTATION Function: Creates and returns an implementation of a Java interface with - JMAKE-INVOCATION-HANDLER Function: (not documented) - JMAKE-PROXY - Function: (not documented) - + Generic Function: (not documented) JMEMBER-PROTECTED-P Function: MEMBER is a protected member of its declaring class - JMEMBER-PUBLIC-P Function: MEMBER is a public member of its declaring class - JMEMBER-STATIC-P Function: MEMBER is a static member of its declaring class - JMETHOD - Function: Returns a reference to the Java method METHOD-NAME of - CLASS-REF with the given PARAMETER-CLASS-REFS. - + Function: Returns a reference to the Java method METHOD-NAME of CLASS-REF with the given PARAMETER-CLASS-REFS. JMETHOD-LET - Function: (not documented) - + Macro: (not documented) JMETHOD-NAME Function: Returns the name of METHOD as a Lisp string - JMETHOD-PARAMS Function: Returns a vector of parameter types (Java classes) for METHOD - JMETHOD-RETURN-TYPE Function: Returns the result type (Java class) of the METHOD - JNEW Function: Invokes the Java constructor CONSTRUCTOR with the arguments ARGS. - JNEW-ARRAY Function: Creates a new Java array of type ELEMENT-TYPE, with the given DIMENSIONS. - JNEW-ARRAY-FROM-ARRAY Function: Returns a new Java array with base type ELEMENT-TYPE (a string or a class-ref) - JNEW-ARRAY-FROM-LIST Function: (not documented) - JNEW-RUNTIME-CLASS Function: (not documented) - JNULL-REF-P Function: Returns a non-NIL value when the JAVA-OBJECT `object` is `null`, - JOBJECT-CLASS Function: Returns the Java class that OBJ belongs to - JOBJECT-LISP-VALUE Function: Attempts to coerce JAVA-OBJECT into a Lisp object. - JPROPERTY-VALUE Function: (not documented) - JREDEFINE-METHOD Function: (not documented) - JREGISTER-HANDLER Function: (not documented) - JRESOLVE-METHOD - Function: Finds the most specific Java method METHOD-NAME on - INSTANCE applicable to arguments ARGS. Returns NIL if no suitable - method is found. The algorithm used for resolution is the same used - by JCALL when it is called with a string as the first parameter - (METHOD-REF). - + Function: Finds the most specific Java method METHOD-NAME on INSTANCE applicable to arguments ARGS. Returns NIL if no suitable method is found. The algorithm used for resolution is the same used by JCALL when it is called with a string as the first parameter (METHOD-REF). JRUN-EXCEPTION-PROTECTED - Function: Invokes the function CLOSURE and returns the result. - Signals an error if stack or heap exhaustion occurs. - + Function: Invokes the function CLOSURE and returns the result. Signals an error if stack or heap exhaustion occurs. JRUNTIME-CLASS-EXISTS-P Function: (not documented) - JSTATIC Function: Invokes the static method METHOD on class CLASS with ARGS. - JSTATIC-RAW - Function: Invokes the static method METHOD on class CLASS with - ARGS. Does not attempt to coerce the arguments or result into a Lisp - object. - + Function: Invokes the static method METHOD on class CLASS with ARGS. Does not attempt to coerce the arguments or result into a Lisp object. MAKE-CLASSLOADER Function: (not documented) - MAKE-IMMEDIATE-OBJECT Function: Attempts to coerce a given Lisp object into a java-object of the - REGISTER-JAVA-EXCEPTION - Function: Registers the Java Throwable named by the symbol - EXCEPTION-NAME as the condition designated by CONDITION-SYMBOL. - Returns T if successful, NIL if not. - + Function: Registers the Java Throwable named by the symbol EXCEPTION-NAME as the condition designated by CONDITION-SYMBOL. Returns T if successful, NIL if not. UNREGISTER-JAVA-EXCEPTION Function: Unregisters the Java Throwable EXCEPTION-NAME previously registered by REGISTER-JAVA-EXCEPTION. From mevenson at common-lisp.net Sun Oct 2 14:11:31 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 07:11:31 -0700 Subject: [armedbear-cvs] r13614 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Oct 2 07:11:31 2011 New Revision: 13614 Log: Render documentation for variables: Java null, true, and false literal constants. Modified: trunk/abcl/doc/manual/java.tex Modified: trunk/abcl/doc/manual/java.tex ============================================================================== --- trunk/abcl/doc/manual/java.tex Sun Oct 2 01:33:03 2011 (r13613) +++ trunk/abcl/doc/manual/java.tex Sun Oct 2 07:11:31 2011 (r13614) @@ -6,11 +6,11 @@ *JAVA-OBJECT-TO-STRING-LENGTH* Variable: Length to truncate toString() PRINT-OBJECT output for an otherwise unspecialized JAVA-OBJECT. Can be set to NIL to indicate no limit. +FALSE+ - Variable: (not documented) + Variable: The JVM primitive value for boolean false. +NULL+ - Variable: (not documented) + Variable: The JVM null object reference. +TRUE+ - Variable: (not documented) + Variable: The JVM primitive value for boolean true. ADD-TO-CLASSPATH Generic Function: (not documented) CHAIN From mevenson at common-lisp.net Sun Oct 2 14:11:55 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 07:11:55 -0700 Subject: [armedbear-cvs] r13615 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Oct 2 07:11:55 2011 New Revision: 13615 Log: The start of a recipe for grovelling the docstrings of a runnin ABCL implementation. Added: trunk/abcl/doc/manual/index.lisp Added: trunk/abcl/doc/manual/index.lisp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/doc/manual/index.lisp Sun Oct 2 07:11:55 2011 (r13615) @@ -0,0 +1,4 @@ +;;; bootstrap documentation rendering + +#+elisp +(slime-apropos-package "JAVA") From mevenson at common-lisp.net Sun Oct 2 14:30:28 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 07:30:28 -0700 Subject: [armedbear-cvs] r13616 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Sun Oct 2 07:30:27 2011 New Revision: 13616 Log: A wrapping of the built-in Java thread pool of Executors. Provides a basis for experimenting with multi-core Lisp execution. In the future, java.util.concurrent.Callable would be the interface to make individual executions based upon. THREADS:START-SERVER will start a primitive, file-based message queue system that processes files as they are created in a given directory. Added: trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Added: trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Sun Oct 2 07:30:27 2011 (r13616) @@ -0,0 +1,92 @@ +;;;; Copyright (C) 2011 Mark Evenson + +(in-package #:threads) + +(require 'abcl-contrib) +(eval-when (:compile-toplevel) + (require 'jss)) + +(defparameter *server-running-p* nil) + +;;; XXX possibly need multiple thread pools +(defparameter *thread-pool* nil) +(defparameter *scheduled-futures* nil) +(defparameter *incoming-scheduled-future* nil) +(defparameter *watch-queue-future* nil) + + +;;;; Configure the directories for a threadpool from these defaults. +(defparameter *root* #p"/var/tmp/abcl-threads/") + +(defparameter *logs* (merge-pathnames "logs/" *root*)) + +(defparameter *incoming* (merge-pathnames "incoming/" *root*)) +(defparameter *dirs* (list *incoming*)) + +;;;; A simple logging abstraction. + +(defconstant +month-names+ '("Jan" "Feb" "Mar" "Apr" "May" "Jun" + "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) + +(defparameter *log* *standard-output*) + +(defun format-time (universal-time) + (multiple-value-bind + (second minute hour date month year day-of-week dst-p tz) + (decode-universal-time universal-time) + (format nil "~&~A ~A ~2,'0D:~2,'0D:~2,'0D" + (nth (1- month) +month-names+) date hour minute second))) + +(defmacro log (message &rest parameters) + `(when *log* + (format *log* "~A " (format-time (get-universal-time))) + (format *log* ,message , at parameters) + (format *log* "~&"))) + +;;; Start a pool of hungry philosophers. +(defun start-server () + (when *server-running-p* + (error "Server not recorded as stopped.")) + (unless + (mapcar #'ensure-directories-exist *dirs*) + (error "Failed to create directories under '~A'." *root*)) + (let ((logfile (merge-pathnames "abcl-threads.log" *logs*))) + (setf *log* + (open logfile :direction :output :if-exists :append :if-does-not-exist :create)) + (format *standard-output* "Logging to ~A." logfile)) + (log "Starts.") + (schedule-threads) + (setf *server-running-p* t)) + +(defun stop-server (&key (force nil)) + (unless force + (unless *server-running-p* + (error "Server not recorded as running."))) + (log "Stopping the server.") + (dolist (future `(,*incoming-scheduled-future* ,*watch-queue-future* ,@*scheduled-futures*)) + (when (not (or (#"isCancelled" future) + (#"isDone" future))) + (#"cancel" future t))) + (#"shutdown" *thread-pool*) + (close *log*) + (setf *server-running-p* nil)) + +(defun schedule-threads () + (log "Starting thread pool.") + (when *thread-pool* + (log "Removing existing incoming thread pool.")) + (setf *thread-pool* + (#"newScheduledThreadPool" 'java.util.concurrent.Executors 1)) + (#"setExecuteExistingDelayedTasksAfterShutdownPolicy" *thread-pool* nil) + (initialize-queue) + (log "Scheduling queue watcher.") + (setf *watch-queue-future* + (#"scheduleWithFixedDelay" + *thread-pool* + (make-watch-queue) 10 1 +seconds+)) + (log "Scheduling incoming watcher.") + (setf *incoming-scheduled-future* + (#"scheduleWithFixedDelay" + *thread-pool* + (make-process-incoming) 1 1 +seconds+))) + From mevenson at common-lisp.net Sun Oct 2 14:36:58 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 07:36:58 -0700 Subject: [armedbear-cvs] r13617 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Sun Oct 2 07:36:58 2011 New Revision: 13617 Log: Fix compile errors of the thread pool abstraction. Modified: trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Modified: trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Sun Oct 2 07:30:27 2011 (r13616) +++ trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Sun Oct 2 07:36:58 2011 (r13617) @@ -9,7 +9,8 @@ (defparameter *server-running-p* nil) ;;; XXX possibly need multiple thread pools -(defparameter *thread-pool* nil) +(defparameter *thread-pool* nil + "The current JVM class implementing the ScheduledThreadPool abstraction.") (defparameter *scheduled-futures* nil) (defparameter *incoming-scheduled-future* nil) (defparameter *watch-queue-future* nil) @@ -23,11 +24,16 @@ (defparameter *incoming* (merge-pathnames "incoming/" *root*)) (defparameter *dirs* (list *incoming*)) +(defparameter *queue* (merge-pathnames "queue/" *root*)) + +(defparameter *processed* (merge-pathnames "processed/" *root*)) + + ;;;; A simple logging abstraction. (defconstant +month-names+ '("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) - +(defconstant +seconds+ (java:jfield "java.util.concurrent.TimeUnit" "SECONDS")) (defparameter *log* *standard-output*) (defun format-time (universal-time) @@ -90,3 +96,38 @@ *thread-pool* (make-process-incoming) 1 1 +seconds+))) +(defun make-process-incoming () + (java:jinterface-implementation "java.lang.Runnable" "run" #'process-incoming)) + +(defun process-incoming () + (flet ((reject-input (file invalid) + (warn (format nil "~A is ~A" file invalid)))) + (let ((incoming (directory (merge-pathnames *incoming* "*")))) + (unless incoming + (return-from process-incoming)) + (log "Processing ~A incoming items." (length incoming)) + (let (table error) + (dolist (file incoming) + (setf error nil) + (log "Analyzing ~A." file) + (setf table + (handler-case + (load-table file) + (t (e) + (log "Failed to process ~A because ~A" file e) + (setf error e)))) + (if error + (reject-input file (if (listp error) error (list error))) + (multiple-value-bind (valid invalid) + (validate table) + (if invalid + (progn + (log "Rejecting ~A because of invalid rows." file) + (reject-input file invalid)) + (let ((incoming + (make-pathname :defaults *queue* + :name (pathname-name file) + :type (pathname-type file)))) + (log "Inserting ~A." incoming) + (rename-file file incoming)))))))))) + From mevenson at common-lisp.net Sun Oct 2 18:18:12 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 11:18:12 -0700 Subject: [armedbear-cvs] r13618 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Oct 2 11:18:12 2011 New Revision: 13618 Log: Clarify PATHNAME class hierarchy. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Oct 2 07:36:58 2011 (r13617) +++ trunk/abcl/doc/manual/abcl.tex Sun Oct 2 11:18:12 2011 (r13618) @@ -32,8 +32,8 @@ cmd$ java -jar abcl.jar \end{listing-shell} -N.b. for this command to work, the ``java'' executable needs to be in your -path. +N.b. for the proceeding command to work, the ``java'' executable needs +to be in your path. To make it easier to facilitate the use of ABCL in tool chains (such as SLIME) the invocation is wrapped in a Bourne shell script under UNIX @@ -88,7 +88,7 @@ \section{ANSI Common Lisp} ABCL is currently a non-conforming ANSI Common Lisp implementation due -to the following (known) issues: +to the following issues: \begin{itemize} \item Missing statement of conformance in accompanying documentation @@ -303,28 +303,52 @@ } \end{listing-java} +\chapter{Implementation Dependent Extensions} -\section{Java} +As outlined by the CLHS ANSI conformance guidelines, we document the +extensions to the Armed Bear Lisp implementation made accessible to +the user by virtue of being an exported symbol in the JAVA, THREADS, +or EXTENSIONS packages. + +\section{JAVA} + +\subsection{Modifying the JVM CLASSPATH} + +The JAVA:ADD-TO-CLASSPATH generic functions allows one to add the +specified pathname or list of pathnames to the current JVM classpath +allowing the dynamic loading of JVM objects: + +\begin{listing-lisp} +CL-USER> (add-to-classpath "/path/to/some.jar") +\end{listing-lisp}p + +\subsection{API} % include autogen docs for the JAVA package. \include{java} -\section{Multithreading} +\section{THREADS} + +Multithreading + +\subsection{API} % TODO document the THREADS package. \include{threads} -\section{Extensions} +\section{EXTENSIONS} -The symbols in the EXTENSIONS package constitutes extensions to the -ANSI standard that are potentially useful to the user. They include -functions for manipulating network sockets, running external programs, -registering object finalizers, constructing reference weakly held by -the garbage collector and others. +The symbols in the EXTENSIONS package (nicknamed ``EXT'') constitutes +extensions to the ANSI standard that are potentially useful to the +user. They include functions for manipulating network sockets, +running external programs, registering object finalizers, constructing +reference weakly held by the garbage collector and others. See \ref{Extensible Sequences} for a generic function interface to the native JVM contract for \code{java.util.List}. +\subsection{API} + \include{extensions} \chapter{Beyond ANSI} @@ -349,21 +373,35 @@ installed at runtime by having JVM symbols present in the sun.net.protocol.dynmamic pacakge. See [JAVA2006] for more details. -ABCL has created three specializations of the ANSI Pathname construct -to enable to use of URIs to address dynamically loaded resources for -the JVM. +ABCL has created specializations of the ANSI Pathname object to +enable to use of URIs to address dynamically loaded resources for the +JVM. A URL-PATHNAME has a corresponding URL whose cannoical +representation is defined to be the NAMESTRING of the Pathname. PATHNAME : URL-PATHNAME : JAR-PATHNAME - : LOGICAL-PATHNAME -Among other neat befits, this allows the ABCL user to laod dynamically -code from URIs like Quicklisp. +Both URL-PATHNAME and JAR-PATHNAME may be used anu where will a +PATHNAME is accepted witht the following caveats + +A stream obtained via OPEN on a URL-PATHNAME cannot be the target of +write operations. + +No canonicalization is performed on the underlying URI (i.e. the +implementation does not attempt to compute the current name of the +representing resource unless it is requested to be resolved.) Upon +resolution, any cannoicalization procedures followed in resolving the +resource (e.g. following redirects) are discarded. + +The implementation of URL-PATHNAME allows the ABCL user to laod dynamically +code from the network. For example, for Quicklisp. \begin{listing-lisp} - CL-USER> (load ''http://beta.quicklisp.org/quicklisp.lisp'') + CL-USER> (load "http://beta.quicklisp.org/quicklisp.lisp") \end{listing-lisp} +will load and execute the Quicklisp setup code. +\ref{XACH2011} \section{Extensible Sequences} @@ -439,7 +477,11 @@ \section{References} -[Java2000]: A New Era for Java Protocol Handlers. \url{http://java.sun.com/developer/onlineTraining/protocolhandlers} +[Java2000]: A New Era for Java Protocol Handlers. +\url{http://java.sun.com/developer/onlineTraining/protocolhandlers/} + +[Xach2011]: Quicklisp: A system for quickly constructing Common Lisp +libraries. \url{http://www.quicklisp.org/} \end{document} From mevenson at common-lisp.net Mon Oct 3 06:32:47 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 23:32:47 -0700 Subject: [armedbear-cvs] r13619 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Oct 2 23:32:46 2011 New Revision: 13619 Log: More incremental progress. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Oct 2 11:18:12 2011 (r13618) +++ trunk/abcl/doc/manual/abcl.tex Sun Oct 2 23:32:46 2011 (r13619) @@ -320,7 +320,7 @@ \begin{listing-lisp} CL-USER> (add-to-classpath "/path/to/some.jar") -\end{listing-lisp}p +\end{listing-lisp} \subsection{API} @@ -333,7 +333,7 @@ \subsection{API} -% TODO document the THREADS package. +% include autogen docs for the THREADS package. \include{threads} \section{EXTENSIONS} @@ -349,6 +349,7 @@ \subsection{API} +% include autogen docs for the EXTENSIONS package. \include{extensions} \chapter{Beyond ANSI} @@ -361,7 +362,7 @@ \section{Implementation Dependent} \begin{enumerate} \item Compiler to JVM 5 bytecode - \item Pathname extensionsn + \item Pathname extensions \end{enumerate} \section{Pathname} @@ -407,7 +408,7 @@ \ref{RHODES2007} -The SEQUENCE pacakge fully implements Christopher Rhodes' proposal for +The SEQUENCE package fully implements Christopher Rhodes' proposal for extensible sequences. These user extensible sequences are used directly in \code{java-collections.lisp} provide these CLOS abstractions on the standard Java collection classes as defined by the @@ -460,6 +461,42 @@ the corresponding Unicode character is output for characters whose code is greater than 0x00ff. +\section{ASDF} + +asdf-2.017 is packaged as core component of ABCL. By default, ASDF is +not loaded, as it relies on the CLOS subsystem which can take a bit of +time to initialize. + +\begin{listing-lisp} +CL-USER> (require 'asdf) +\end{listing-lisp} + +\chapter{Contrib} + +\section{abcl-asdf} + +Allow ASDF system definition which dynamically loads JVM artifacts +such as jar archives via a Maven encapsulation. + +ASDF components added: JAR-FILE, JAR-DIRECTORY, CLASS-FILE-DIRECTORY +and MVN. + +\section{asdf-install} + +An implementation of ASDF-INSTALL. Superceded by Quicklisp (qv.) + +\section{asdf-jar} + +ASDF-JAR provides a system for packaging ASDF systems into jar +archives for ABCL. Given a running ABCL image with loadable ASDF +systems the code in this package will recursively package all the +required source and fasls in a jar archive. + +\section{jss} + +Java Syntax sucks, so we introduce this #" macro + + \chapter{History} ABCL was originally the extension language for the J editor, which was @@ -475,6 +512,9 @@ In 201x, with the publication of this Manual explicitly stating the conformance of Armed Bear Common Lisp to ANSI, we release abcl-1.0. + + + \section{References} [Java2000]: A New Era for Java Protocol Handlers. From mevenson at common-lisp.net Mon Oct 3 06:32:59 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 23:32:59 -0700 Subject: [armedbear-cvs] r13620 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Oct 2 23:32:58 2011 New Revision: 13620 Log: Escape # character which is apparently a macro in latex. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Oct 2 23:32:46 2011 (r13619) +++ trunk/abcl/doc/manual/abcl.tex Sun Oct 2 23:32:58 2011 (r13620) @@ -494,7 +494,7 @@ \section{jss} -Java Syntax sucks, so we introduce this #" macro +Java Syntax sucks, so we introduce the \#" macro. \chapter{History} From mevenson at common-lisp.net Mon Oct 3 06:33:12 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 02 Oct 2011 23:33:12 -0700 Subject: [armedbear-cvs] r13621 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Sun Oct 2 23:33:12 2011 New Revision: 13621 Log: Continue to refine runnable names. Modified: trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Modified: trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Sun Oct 2 23:32:58 2011 (r13620) +++ trunk/abcl/src/org/armedbear/lisp/threads-jss.lisp Sun Oct 2 23:33:12 2011 (r13621) @@ -101,7 +101,10 @@ (defun process-incoming () (flet ((reject-input (file invalid) - (warn (format nil "~A is ~A" file invalid)))) + (warn (format nil "~A is ~A" file invalid))) + (process (file) + nil)) + (let ((incoming (directory (merge-pathnames *incoming* "*")))) (unless incoming (return-from process-incoming)) @@ -112,7 +115,7 @@ (log "Analyzing ~A." file) (setf table (handler-case - (load-table file) + (process file) (t (e) (log "Failed to process ~A because ~A" file e) (setf error e)))) From mevenson at common-lisp.net Mon Oct 3 09:47:33 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 03 Oct 2011 02:47:33 -0700 Subject: [armedbear-cvs] r13622 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Mon Oct 3 02:47:32 2011 New Revision: 13622 Log: Documentation process for loading the SEQUENCE package. It would be nice to allow a simple (require 'sequence) invocation work instead of (require 'extensible-sequences). Maybe in the Great Renaming. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Oct 2 23:33:12 2011 (r13621) +++ trunk/abcl/doc/manual/abcl.tex Mon Oct 3 02:47:32 2011 (r13622) @@ -414,6 +414,12 @@ abstractions on the standard Java collection classes as defined by the \code{java.util.List} contract. +This extension is not automatically loaded by the implementation. It +may be loaded via: + +\begin{listing-lisp} +CL-USER> (require 'extensible-sequences) +\end{listing-lisp} \section{Extensions to CLOS} From ehuelsmann at common-lisp.net Sun Oct 9 20:05:58 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 09 Oct 2011 13:05:58 -0700 Subject: [armedbear-cvs] r13623 - trunk/abcl/doc/manual Message-ID: Author: ehuelsmann Date: Sun Oct 9 13:05:57 2011 New Revision: 13623 Log: Add some documentation to the Java->Lisp and Lisp->Java sections. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Mon Oct 3 02:47:32 2011 (r13622) +++ trunk/abcl/doc/manual/abcl.tex Sun Oct 9 13:05:57 2011 (r13623) @@ -123,31 +123,95 @@ \section{Lisp to Java} -ABCL offers a number of mechanisms to manipulate Java libraries from -Lisp. +ABCL offers a number of mechanisms to interact with Java from +its lisp environment. It allows calling methods (and static methods) of +Java objects, manipulation of fields and static fields and construction +of new Java objects. + +When calling Java routines, some values will automatically be converted +by the FFI from Lisp values to Java values. These conversions typically +apply to strings, integers and floats. Other values need to be converted +to their Java equivalents by the programmer before calling the Java +object method. + +\subsection{Lowlevel Java API} + +There's a higher level Java API defined in the +\ref{topic:Higher level Java API: JSS}(JSS package) which is available +in the contrib/ directory. This package is described later in this +document. This section covers the lower level API directly available +after evaluating \code{(require 'JAVA)}. + +\subsubsection{Calling Java object methods} + +There are two ways to call a Java object method in the basic API: \begin{itemize} -\item Java values are accessible as objects of type JAVA:JAVA-OBJECT. -\item The Java FFI presents a Lisp package (JAVA) with many useful - symbols for manipulating the artifacts of expectation on the JVM, - including creation of new objects \ref{JAVA:JNEW}, \ref{JAVA:JMETHOD}), the - introspection of values \ref{JAVA:JFIELD}, the execution of methods - (\ref{JAVA:JCALL}, \ref{JAVA:JCALL-RAW}, \ref{JAVA:JSTATIC}) -\item The JSS package (\ref{JSS}) in contrib introduces a convenient macro - syntax \ref{JSS:SHARPSIGN_DOUBLEQUOTE_MACRO} for accessing Java - methods, and additional convenience functions. -\item Java classes and libraries may be dynamically added to the - classpath at runtime (JAVA:ADD-TO-CLASSPATH). +\item Call a specific method reference (pre-acquired) +\item Dynamic dispatch using the method name and + the call-specific arguments provided by finding the + \ref{section:Parameter matching for FFI dynamic dispatch}{best match}. \end{itemize} +The dynamic dispatch variant is discussed in the next section. + +\code{JAVA:JMETHOD} is used to acquire a specific method reference. +The function takes at two or more arguments. The first is Java class designator +(a \code{JAVA:JAVA-CLASS} object returned by \code{JAVA:JCLASS} or a string naming +a Java class). The second is a string naming the method. + +Any arguments beyond the first two should be strings naming Java classes with +one exception as listed in the next paragraph. These +classes specify the types of the arguments for the method to be returned. + +There's additional calling convention to the \code{JAVA:JMETHOD} function: +When the method is called with three parameters and the last parameter is an +integer, the first method by that name and matching number of parameters is +returned. + +Once you have a reference to the method, you can call it using \code{JAVA:JCALL}, +which takes the method as the first argument. The second argument is the +object instance to call the method on. Any remaining parameters are used +as the remaining arguments for the call. + +\subsubsection{Calling Java object methods: dynamic dispatch} + +The second way of calling Java object methods is by using dynamic dispatch. +In this case \code{JAVA:JCALL} is used directly without acquiring a method +reference first. In this case, the first argument provided to \code{JAVA:JCALL} +is a string naming the method to be called. The second argument is the instance +on which the method should be called and any further arguments are used to +select the best matching method and dispatch the call. + +% ###TODO document ``intended class'' + +% \begin{itemize} +% \item Java values are accessible as objects of type JAVA:JAVA-OBJECT. +% \item The Java FFI presents a Lisp package (JAVA) with many useful +% symbols for manipulating the artifacts of expectation on the JVM, +% including creation of new objects \ref{JAVA:JNEW}, \ref{JAVA:JMETHOD}), the +% introspection of values \ref{JAVA:JFIELD}, the execution of methods +% (\ref{JAVA:JCALL}, \ref{JAVA:JCALL-RAW}, \ref{JAVA:JSTATIC}) +% \item The JSS package (\ref{JSS}) in contrib introduces a convenient macro +% syntax \ref{JSS:SHARPSIGN_DOUBLEQUOTE_MACRO} for accessing Java +% methods, and additional convenience functions. +% \item Java classes and libraries may be dynamically added to the +% classpath at runtime (JAVA:ADD-TO-CLASSPATH). +% \end{itemize} + +\subsubsection{Parameter matching for FFI dynamic dispatch} + + +... + \section{Lisp from Java} -Manipulation of the Lisp API is currently lacking a stable interface, -so the following documented interfaces are subject to change with -notice: +In order to access the Lisp world from Java, one needs to be aware +of a few things. The most important ones are listed below. \begin{itemize} \item All Lisp values are descendants of LispObject.java +\item In order to \item Lisp symbols are accessible via either directly referencing the Symbol.java instance or by dynamically introspecting the corresponding Package.java instance. From astalla at common-lisp.net Mon Oct 10 18:33:51 2011 From: astalla at common-lisp.net (astalla at common-lisp.net) Date: Mon, 10 Oct 2011 11:33:51 -0700 Subject: [armedbear-cvs] r13624 - trunk/abcl/doc/manual Message-ID: Author: astalla Date: Mon Oct 10 11:33:50 2011 New Revision: 13624 Log: Subsection on intended class and a few minor tweaks. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Oct 9 13:05:57 2011 (r13623) +++ trunk/abcl/doc/manual/abcl.tex Mon Oct 10 11:33:50 2011 (r13624) @@ -6,7 +6,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} \date{October 2, 2011} -\author{Mark~Evenson, Erik~Huelsmann, Alessio~Stallo, Ville~Voutilainen} +\author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle @@ -92,7 +92,7 @@ \begin{itemize} \item Missing statement of conformance in accompanying documentation - \item The generic function sigatures of the DOCUMENTATION symbol do + \item The generic function signatures of the DOCUMENTATION symbol do not match the CLHS. \end{itemize} @@ -132,7 +132,11 @@ by the FFI from Lisp values to Java values. These conversions typically apply to strings, integers and floats. Other values need to be converted to their Java equivalents by the programmer before calling the Java -object method. +object method. Java values returned to Lisp are also generally converted +back to their Lisp counterparts. Some operators make an exception to this +rule and do not perform any conversion; those are the ``raw'' counterparts +of certain FFI functions and are recognizable by their name ending with +\code{-RAW}. \subsection{Lowlevel Java API} @@ -171,8 +175,8 @@ Once you have a reference to the method, you can call it using \code{JAVA:JCALL}, which takes the method as the first argument. The second argument is the -object instance to call the method on. Any remaining parameters are used -as the remaining arguments for the call. +object instance to call the method on, or \code{NIL} in case of a static method. +Any remaining parameters are used as the remaining arguments for the call. \subsubsection{Calling Java object methods: dynamic dispatch} @@ -183,7 +187,63 @@ on which the method should be called and any further arguments are used to select the best matching method and dispatch the call. -% ###TODO document ``intended class'' +\subsubsection{Dynamic dispatch: caveats} + +Dynamic dispatch is performed by using the Java reflection API. Generally +it works fine, but there are corner cases where the API does not correctly +reflect all the details involved in calling a Java method. An example is +the following Java code: + +\begin{listing-java} +ZipFile jar = new ZipFile("/path/to/some.jar"); +Object els = jar.entries(); +Method method = els.getClass().getMethod("hasMoreElements"); +method.invoke(els); +\end{listing-java} + +even though the method \code{hasMoreElements} is public in \code{Enumeration}, +the above code fails with + +\begin{listing-java} +java.lang.IllegalAccessException: Class ... can +not access a member of class java.util.zip.ZipFile$2 with modifiers +"public" + at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) + at java.lang.reflect.Method.invoke(Method.java:583) + at ... +\end{listing-java} + +because the method has been overridden by a non-public class and the +reflection API, unlike javac, is not able to handle such a case. + +While code like that is uncommon in Java, it is typical of ABCL's FFI +calls. The code above corresponds to the following Lisp code: + +\begin{listing-lisp} +(let ((jar (jnew "java.util.zip.ZipFile" "/path/to/some.jar"))) + (let ((els (jcall "entries" jar))) + (jcall "hasMoreElements" els))) +\end{listing-lisp} + +except that the dynamic dispatch part is not shown. + +To avoid such pitfalls, all Java objects in ABCL carry an extra +field representing the ``intended class'' of the object. That is the class +that is used first by \code{JAVA:JCALL} and similar to resolve methods; +the actual class of the object is only tried if the method is not found +in the intended class. Of course, the intended class is always a superclass +of the actual class - in the worst case, they coincide. The intended class +is deduced by the return type of the method that originally returned +the Java object; in the case above, the intended class of \code{ELS} +is \code{java.util.Enumeration} because that's the return type of +the \code{entries} method. + +While this strategy is generally effective, there are cases where the +intended class becomes too broad to be useful. The typical example +is the extraction of an element from a collection, since methods in +the collection API erase all types to \code{Object}. The user can +always force a more specific intended class by using the \code{JAVA:JCOERCE} +operator. % \begin{itemize} % \item Java values are accessible as objects of type JAVA:JAVA-OBJECT. @@ -201,8 +261,11 @@ \subsubsection{Parameter matching for FFI dynamic dispatch} +The algorithm used to resolve the best matching method given the name +and the arguments' types is the same as described in the Java Language +Specification. Any deviance should be reported as a bug. -... +% ###TODO reference to correct JLS section \section{Lisp from Java} From ehuelsmann at common-lisp.net Mon Oct 10 20:56:40 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Mon, 10 Oct 2011 13:56:40 -0700 Subject: [armedbear-cvs] r13625 - trunk/abcl/doc/manual Message-ID: Author: ehuelsmann Date: Mon Oct 10 13:56:39 2011 New Revision: 13625 Log: More documentation of the Java FFI. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Mon Oct 10 11:33:50 2011 (r13624) +++ trunk/abcl/doc/manual/abcl.tex Mon Oct 10 13:56:39 2011 (r13625) @@ -259,14 +259,39 @@ % classpath at runtime (JAVA:ADD-TO-CLASSPATH). % \end{itemize} +\subsubsection{Calling Java class static methods} + +Like with non-static methods, references to static methods can be acquired +by using the \code{JAVA:JMETHOD} primitive. In order to call this method, +it's not possible to use the \code{JAVA:JCALL} primitive however: there's a +separate API to retrieve a reference to static methods. This +primitive is called \code{JAVA:JSTATIC}. + +Like \code{JAVA:JCALL}, \code{JAVA:JSTATIC} supports dynamic dispatch by +passing the name of the method as a string instead of passing a method reference. +The parameter values should be values to pass in the function call instead of +a specification of classes for each parameter. + \subsubsection{Parameter matching for FFI dynamic dispatch} The algorithm used to resolve the best matching method given the name and the arguments' types is the same as described in the Java Language -Specification. Any deviance should be reported as a bug. +Specification. Any deviation should be reported as a bug. % ###TODO reference to correct JLS section +\subsubsection{Instantiating Java objects} + +Java objects can be instantiated (created) from Lisp by calling +a constructor from the class of the object to be created. The same way +\code{JAVA:JMETHOD} is used to acquire a method reference, the +\code{JAVA:JCONSTRUCTOR} primitive can be used to acquire a constructor +reference. It's arguments specify the types of arguments of the constructor +method the same way as with \code{JAVA:JMETHOD}. + +The constructor can't be passed to \code{JAVA:JCALL}, but instead should +be passed as an argument to \code{JAVA:JNEW}. + \section{Lisp from Java} In order to access the Lisp world from Java, one needs to be aware From astalla at common-lisp.net Wed Oct 12 21:13:15 2011 From: astalla at common-lisp.net (astalla at common-lisp.net) Date: Wed, 12 Oct 2011 14:13:15 -0700 Subject: [armedbear-cvs] r13626 - trunk/abcl/doc/manual Message-ID: Author: astalla Date: Wed Oct 12 14:13:12 2011 New Revision: 13626 Log: Manual: documented the JSR-223 implementation. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Mon Oct 10 13:56:39 2011 (r13625) +++ trunk/abcl/doc/manual/abcl.tex Wed Oct 12 14:13:12 2011 (r13626) @@ -443,7 +443,7 @@ ... } \end{listing-java} - + A more Lispy way to iterated down a list is to use the `cdr()` access function just as like one would traverse a list in Lisp:; @@ -455,6 +455,89 @@ } \end{listing-java} +\subsection{Java Scripting API (JSR-223)} + +ABCL can be built with support for JSR-223, which offers a language-agnostic +API to invoke other languages from Java. The binary distribution downloadable +from ABCL's common-lisp.net home is built with JSR-223 support. If you're building +ABCL from source on a pre-1.6 JVM, you need to have a JSR-223 implementation in your +CLASSPATH (such as Apache Commons BSF 3.x or greater) in order to build ABCL +with JSR-223 support; otherwise, this feature will not be built. + +This section describes the design decisions behind the ABCL JSR-223 support. It is not a description of what JSR-223 is or a tutorial on how to use it. See http://trac.common-lisp.net/armedbear/browser/trunk/abcl/examples/jsr-223 for example usage. + +\subsubsection{Conversions} + +In general, ABCL's implementation of the JSR-223 API performs implicit conversion from Java objects to Lisp objects when invoking Lisp from Java, and the opposite when returning values from Java to Lisp. This potentially reduces coupling between user code and ABCL. To avoid such conversions, wrap the relevant objects in \code{JavaObject} instances. + +\subsubsection{Implemented JSR-223 interfaces} + +JSR-223 defines three main interfaces, of which two (Invocable and Compilable) are optional. ABCL implements all the three interfaces - ScriptEngine and the two optional ones - almost completely. While the JSR-223 API is not specific to a single scripting language, it was designed with languages with a more or less Java-like object model in mind: languages such as Javascript, Python, Ruby, which have a concept of "class" or "object" with "fields" and "methods". Lisp is a bit different, so certain adaptations were made, and in one case a method has been left unimplemented since it does not map at all to Lisp. + +\subsubsection{The ScriptEngine} + +The main interface defined by JSR-223, javax.script.ScriptEngine, is implemented by the class \code{org.armedbear.lisp.scripting.AbclScriptEngine}. AbclScriptEngine is a singleton, reflecting the fact that ABCL is a singleton as well. You can obtain an instance of AbclScriptEngine using the AbclScriptEngineFactory or by using the service provider mechanism through ScriptEngineManager (refer to the javax.script documentation). + +\subsubsection{Startup and configuration file} + +At startup (i.e. when its constructor is invoked, as part of the static initialization phase of AbclScriptEngineFactory) the ABCL script engine attempts to load an "init file" from the classpath (/abcl-script-config.lisp). If present, this file can be used to customize the behaviour of the engine, by setting a number of variables in the ABCL-SCRIPT package. Here is a list of the available variables: + +\begin{itemize} +\item *use-throwing-debugger* Controls whether ABCL uses a non-standard debugging hook function to throw a Java exception instead of dropping into the debugger in case of unhandled error conditions. + \begin{itemize} + \item Default value: T + \item Rationale: it is more convenient for Java programmers using Lisp as a scripting language to have it return exceptions to Java instead of handling them in the Lisp world. + \item Known Issues: the non-standard debugger hook has been reported to misbehave in certain circumstances, so consider disabling it if it doesn't work for you. + \end{itemize} +\item *launch-swank-at-startup* If true, Swank will be launched at startup. See *swank-dir* and *swank-port*. + \begin{itemize} + \item Default value: NIL + \end{itemize} +\item *swank-dir* The directory where Swank is installed. Must be set if *launch-swank-at-startup* is true. +\item *swank-port* The port where Swank will listen for connections. Must be set if *launch-swank-at-startup* is true. + \begin{itemize} + \item Default value: 4005 + \end{itemize} +\end{itemize} + +Additionally, at startup the AbclScriptEngine will \code{(require 'asdf)} - in fact, it uses asdf to load Swank. + +\subsubsection{Evaluation} + +Code is read and evaluated in the package ABCL-SCRIPT-USER. This packages USEs the COMMON-LISP, JAVA and ABCL-SCRIPT packages. Future versions of the script engine might make this default package configurable. The \code{CL:LOAD} function is used under the hood for evaluating code, and thus the same behavior of LOAD is guaranteed. This allows, among other things, \code{IN-PACKAGE} forms to change the package in which the loaded code is read. + +It is possible to evaluate code in what JSR-223 calls a "ScriptContext" (basically a flat environment of name->value pairs). This context is used to establish special bindings for all the variables defined in it; since variable names are strings from Java's point of view, they are first interned using READ-FROM-STRING with, as usual, ABCL-SCRIPT-USER as the default package. Variables are declared special because CL's \code{LOAD}, \code{EVAL} and \code{COMPILE} functions work in a null lexical environment and would ignore non-special bindings. + +Contrary to what the function \code{LOAD} does, evaluation of a series of forms returns the value of the last form instead of T, so the evaluation of short scripts does the Right Thing. + +\subsubsection{Compilation} + +AbclScriptEngine implements the javax.script.Compilable interface. Currently it only supports compilation using temporary files. Compiled code, returned as an instance of javax.script.CompiledScript, is read, compiled and executed by default in the ABCL-SCRIPT-USER package, just like evaluated code. Differently from evaluated code, though, due to the way the ABCL compiler works, compiled code contains no reference to top-level self-evaluating objects (like numbers or strings). Thus, when evaluated, a piece of compiled code will return the value of the last non-self-evaluating form: for example the code "(do-something) 42" will return 42 when interpreted, but will return the result of (do-something) when compiled and later evaluated. To ensure consistency of behavior between interpreted and compiled code, make sure the last form is always a compound form - at least (identity some-literal-object). Note that this issue should not matter in real code, where it is unlikely a top-level self-evaluating form will appear as the last form in a file (in fact, the Common Lisp load function always returns T upon success; with JSR-223 this policy has been changed to make evaluation of small code snippets work as intended). + +\subsubsection{Invocation of functions and methods} + +AbclScriptEngine implements the \code{javax.script.Invocable} interface, which allows to directly call Lisp functions and methods, and to obtain Lisp implementations of Java interfaces. This is only partially possible with Lisp since it has functions, but not methods - not in the traditional OO sense, at least, since Lisp methods are not attached to objects but belong to generic functions. Thus, the method \code{invokeMethod()} is not implemented and throws an UnsupportedOperationException when called. The \code{invokeFunction()} method should be used to call both regular and generic functions. + +\subsubsection{Implementation of Java interfaces in Lisp} + +ABCL can use the Java reflection-based proxy feature to implement Java interfaces in Lisp. It has several built-in ways to implement an interface, and supports definition of new ones. The \code{JAVA:JMAKE-PROXY} generic function is used to make such proxies. It has the following signature: + +\code{jmake-proxy interface implementation \&optional lisp-this ==> proxy} + +\code{interface} is a Java interface metaobject (e.g. obtained by invoking \code{jclass}) or a string naming a Java interface. \code{implementation} is the object used to implement the interface - several built-in methods of jmake-proxy exist for various types of implementations. \code{lisp-this} is an object passed to the closures implementing the Lisp "methods" of the interface, and defaults to \code{NIL}. + +The returned proxy is an instance of the interface, with methods implemented with Lisp functions. + +Built-in interface-implementation types include: + +\begin{itemize} +\item a single Lisp function which upon invocation of any method in the interface will be passed the method name, the Lisp-this object, and all the parameters. Useful for interfaces with a single method, or to implement custom interface-implementation strategies. +\item a hash-map of method-name -> Lisp function mappings. Function signature is \code{(lisp-this \&rest args)}. +\item a Lisp package. The name of the Java method to invoke is first transformed in an idiomatic Lisp name (\code{javaMethodName} becomes \code{JAVA-METHOD-NAME}) and a symbol with that name is searched in the package. If it exists and is fbound, the corresponding function will be called. Function signature is as the hash-table case. +\end{itemize} + +This functionality is exposed by the AbclScriptEngine with the two methods getInterface(Class) and getInterface(Object, Class). The former returns an interface implemented with the current Lisp package, the latter allows the programmer to pass an interface-implementation object which will in turn be passed to the jmake-proxy generic function. + \chapter{Implementation Dependent Extensions} As outlined by the CLHS ANSI conformance guidelines, we document the @@ -467,13 +550,17 @@ \subsection{Modifying the JVM CLASSPATH} The JAVA:ADD-TO-CLASSPATH generic functions allows one to add the -specified pathname or list of pathnames to the current JVM classpath -allowing the dynamic loading of JVM objects: +specified pathname or list of pathnames to the current classpath +used by ABCL, allowing the dynamic loading of JVM objects: \begin{listing-lisp} CL-USER> (add-to-classpath "/path/to/some.jar") \end{listing-lisp} +NB \code{add-to-classpath} only affects the classloader used by ABCL +(the value of the special variable \code{JAVA:*CLASSLOADER*}. It has +no effect on Java code outside ABCL. + \subsection{API} % include autogen docs for the JAVA package. @@ -570,9 +657,23 @@ may be loaded via: \begin{listing-lisp} +CL-USER> (require 'java-collections) +\end{listing-lisp} + +if both extensible sequences and their application to Java collections +is required, or + +\begin{listing-lisp} CL-USER> (require 'extensible-sequences) \end{listing-lisp} +if only the extensible sequences API as specified in \ref{RHODES2007} is +required. + +Note that \code{(require 'java-collections)} must be issued before +\code{java.util.List} or any subclass is used as a specializer in a CLOS +method definition (see the section below). + \section{Extensions to CLOS} There is an additional syntax for specializing the parameter of a @@ -631,7 +732,7 @@ \chapter{Contrib} -\section{abcl-asdf} +\section{abcl-asdf} Allow ASDF system definition which dynamically loads JVM artifacts such as jar archives via a Maven encapsulation. @@ -661,7 +762,7 @@ started in 1998 by Peter Graves. Sometime in 2003, it seems that a lot of code that had previously not been released publically was suddenly committed that enabled ABCL to be plausibly termed an ANSI -Common Lisp implementation. +Common Lisp implementation. In 2006, the implementation was transferred to the current maintainers, who have strived to improve its usability as a From mevenson at common-lisp.net Thu Oct 13 05:05:06 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 12 Oct 2011 22:05:06 -0700 Subject: [armedbear-cvs] r13627 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Wed Oct 12 22:05:05 2011 New Revision: 13627 Log: Manually wrap text for JAVA docstrings. Modified: trunk/abcl/doc/manual/java.tex Modified: trunk/abcl/doc/manual/java.tex ============================================================================== --- trunk/abcl/doc/manual/java.tex Wed Oct 12 14:13:12 2011 (r13626) +++ trunk/abcl/doc/manual/java.tex Wed Oct 12 22:05:05 2011 (r13627) @@ -4,7 +4,9 @@ %JSET-PROPERTY-VALUE Function: Sets a JavaBean property on JAVA-OBJECT. *JAVA-OBJECT-TO-STRING-LENGTH* - Variable: Length to truncate toString() PRINT-OBJECT output for an otherwise unspecialized JAVA-OBJECT. Can be set to NIL to indicate no limit. + Variable: Length to truncate toString() PRINT-OBJECT output for an + otherwise unspecialized JAVA-OBJECT. Can be set to NIL to indicate + no limit. +FALSE+ Variable: The JVM primitive value for boolean false. +NULL+ @@ -32,9 +34,11 @@ JARRAY-LENGTH Function: (not documented) JARRAY-REF - Function: Dereferences the Java array JAVA-ARRAY using the given INDICIES, coercing the result into a Lisp object, if possible. + Function: Dereferences the Java array JAVA-ARRAY using the given + INDICIES, coercing the result into a Lisp object, if possible. JARRAY-REF-RAW - Function: Dereference the Java array JAVA-ARRAY using the given INDICIES. Does not attempt to coerce the result into a Lisp object. + Function: Dereference the Java array JAVA-ARRAY using the given + INDICIES. Does not attempt to coerce the result into a Lisp object. JARRAY-SET Function: Stores NEW-VALUE at the given index in JAVA-ARRAY. JAVA-CLASS @@ -48,11 +52,16 @@ JAVA-OBJECT-P Function: Returns T if OBJECT is a JAVA-OBJECT. JCALL - Function: Invokes the Java method METHOD-REF on INSTANCE with arguments ARGS, coercing the result into a Lisp object, if possible. + Function: Invokes the Java method METHOD-REF on INSTANCE with + arguments ARGS, coercing the result into a Lisp object, if possible. JCALL-RAW - Function: Invokes the Java method METHOD-REF on INSTANCE with arguments ARGS. Does not attempt to coerce the result into a Lisp object. + Function: Invokes the Java method METHOD-REF on INSTANCE with + arguments ARGS. Does not attempt to coerce the result into a Lisp + object. JCLASS - Function: Returns a reference to the Java class designated by NAME-OR-CLASS-REF. If the CLASS-LOADER parameter is passed, the class is resolved with respect to the given ClassLoader. + Function: Returns a reference to the Java class designated by + NAME-OR-CLASS-REF. If the CLASS-LOADER parameter is passed, the class + is resolved with respect to the given ClassLoader. JCLASS-ARRAY-P Function: Returns T if CLASS is an array class JCLASS-CONSTRUCTORS @@ -60,13 +69,15 @@ JCLASS-FIELD Function: Returns the field named FIELD-NAME of CLASS JCLASS-FIELDS - Function: Returns a vector of all (or just the declared/public, if DECLARED/PUBLIC is true) fields of CLASS + Function: Returns a vector of all (or just the declared/public, if + DECLARED/PUBLIC is true) fields of CLASS JCLASS-INTERFACE-P Function: Returns T if CLASS is an interface JCLASS-INTERFACES Function: Returns the vector of interfaces of CLASS JCLASS-METHODS - Function: Return a vector of all (or just the declared/public, if DECLARED/PUBLIC is true) methods of CLASS + Function: Return a vector of all (or just the declared/public, if + DECLARED/PUBLIC is true) methods of CLASS JCLASS-NAME Function: (not documented) JCLASS-OF @@ -76,9 +87,11 @@ JCLASS-SUPERCLASS-P Function: Returns T if CLASS-1 is a superclass or interface of CLASS-2 JCOERCE - Function: Attempts to coerce OBJECT into a JavaObject of class INTENDED-CLASS. Raises a TYPE-ERROR if no conversion is possible. + Function: Attempts to coerce OBJECT into a JavaObject of class + INTENDED-CLASS. Raises a TYPE-ERROR if no conversion is possible. JCONSTRUCTOR - Function: Returns a reference to the Java constructor of CLASS-REF with the given PARAMETER-CLASS-REFS. + Function: Returns a reference to the Java constructor of CLASS-REF + with the given PARAMETER-CLASS-REFS. JCONSTRUCTOR-PARAMS Function: Returns a vector of parameter types (Java classes) for CONSTRUCTOR JEQUAL @@ -106,7 +119,8 @@ JMEMBER-STATIC-P Function: MEMBER is a static member of its declaring class JMETHOD - Function: Returns a reference to the Java method METHOD-NAME of CLASS-REF with the given PARAMETER-CLASS-REFS. + Function: Returns a reference to the Java method METHOD-NAME of + CLASS-REF with the given PARAMETER-CLASS-REFS. JMETHOD-LET Macro: (not documented) JMETHOD-NAME @@ -138,22 +152,31 @@ JREGISTER-HANDLER Function: (not documented) JRESOLVE-METHOD - Function: Finds the most specific Java method METHOD-NAME on INSTANCE applicable to arguments ARGS. Returns NIL if no suitable method is found. The algorithm used for resolution is the same used by JCALL when it is called with a string as the first parameter (METHOD-REF). + Function: Finds the most specific Java method METHOD-NAME on + INSTANCE applicable to arguments ARGS. Returns NIL if no suitable + method is found. The algorithm used for resolution is the same used + by JCALL when it is called with a string as the first parameter + (METHOD-REF). JRUN-EXCEPTION-PROTECTED - Function: Invokes the function CLOSURE and returns the result. Signals an error if stack or heap exhaustion occurs. + Function: Invokes the function CLOSURE and returns the result. + Signals an error if stack or heap exhaustion occurs. JRUNTIME-CLASS-EXISTS-P Function: (not documented) JSTATIC Function: Invokes the static method METHOD on class CLASS with ARGS. JSTATIC-RAW - Function: Invokes the static method METHOD on class CLASS with ARGS. Does not attempt to coerce the arguments or result into a Lisp object. + Function: Invokes the static method METHOD on class CLASS with + ARGS. Does not attempt to coerce the arguments or result into a Lisp + object. MAKE-CLASSLOADER Function: (not documented) MAKE-IMMEDIATE-OBJECT Function: Attempts to coerce a given Lisp object into a java-object of the REGISTER-JAVA-EXCEPTION - Function: Registers the Java Throwable named by the symbol EXCEPTION-NAME as the condition designated by CONDITION-SYMBOL. Returns T if successful, NIL if not. + Function: Registers the Java Throwable named by the symbol + EXCEPTION-NAME as the condition designated by CONDITION-SYMBOL. + Returns T if successful, NIL if not. UNREGISTER-JAVA-EXCEPTION - Function: Unregisters the Java Throwable EXCEPTION-NAME previously registered by REGISTER-JAVA-EXCEPTION. - + Function: Unregisters the Java Throwable EXCEPTION-NAME previously + registered by REGISTER-JAVA-EXCEPTION. \end{verbatim} From mevenson at common-lisp.net Thu Oct 13 05:05:20 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 12 Oct 2011 22:05:20 -0700 Subject: [armedbear-cvs] r13628 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Wed Oct 12 22:05:20 2011 New Revision: 13628 Log: Adjustments to voice and presentation in the manual. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Wed Oct 12 22:05:05 2011 (r13627) +++ trunk/abcl/doc/manual/abcl.tex Wed Oct 12 22:05:20 2011 (r13628) @@ -5,7 +5,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{October 2, 2011} +\date{October 13, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle @@ -21,12 +21,12 @@ \chapter{Running} -ABCL is packaged as a single jar file usually named either +\textsc{ABCL} is packaged as a single jar file usually named either ``abcl.jar'' or something like``abcl-0.28.0.jar'' if you are using a versioned package from your system vendor. This byte archive can be executed under the control of a suitable JVM by using the ``-jar'' option to parse the manifest, and select the named class -(org.armedbear.lisp.Main) for excution: +(\code{org.armedbear.lisp.Main}) for excution: \begin{listing-shell} cmd$ java -jar abcl.jar @@ -46,7 +46,7 @@ \section{Options} -ABCL supports the following options: +ABCL supports the following command line options: \begin{verbatim} --help @@ -87,11 +87,10 @@ \chapter{Conformance} \section{ANSI Common Lisp} -ABCL is currently a non-conforming ANSI Common Lisp implementation due +\textsc{ABCL} is currently a non-conforming ANSI Common Lisp implementation due to the following issues: \begin{itemize} - \item Missing statement of conformance in accompanying documentation \item The generic function signatures of the DOCUMENTATION symbol do not match the CLHS. \end{itemize} @@ -100,7 +99,7 @@ implementation. Any other behavior should be reported as a bug. \section{Contemporary Common Lisp} -In addition to ANSI conformance, ABCL strives to implement features +In addition to ANSI conformance, \textsc{ABCL} strives to implement features expected of a contemporary Common Lisp. \begin{itemize} \item Incomplete (A)MOP @@ -123,26 +122,29 @@ \section{Lisp to Java} -ABCL offers a number of mechanisms to interact with Java from -its lisp environment. It allows calling methods (and static methods) of -Java objects, manipulation of fields and static fields and construction -of new Java objects. - -When calling Java routines, some values will automatically be converted -by the FFI from Lisp values to Java values. These conversions typically -apply to strings, integers and floats. Other values need to be converted -to their Java equivalents by the programmer before calling the Java -object method. Java values returned to Lisp are also generally converted -back to their Lisp counterparts. Some operators make an exception to this -rule and do not perform any conversion; those are the ``raw'' counterparts -of certain FFI functions and are recognizable by their name ending with -\code{-RAW}. +\textsc{ABCL} offers a number of mechanisms to interact with Java from its +Lisp environment. It allows calling both instance and static methods +of Java objects, manipulation of instance and static fields on Java +objects, and construction of new Java objects. + +When calling Java routines, some values will automatically be +converted by the FFI \footnote{FFI stands for Foreign Function + Interface which is the term of art which describes how a Lisp + implementation encapsulates invocation in other languages.} from +Lisp values to Java values. These conversions typically apply to +strings, integers and floats. Other values need to be converted to +their Java equivalents by the programmer before calling the Java +object method. Java values returned to Lisp are also generally +converted back to their Lisp counterparts. Some operators make an +exception to this rule and do not perform any conversion; those are +the ``raw'' counterparts of certain FFI functions and are recognizable +by their name ending with \code{-RAW}. \subsection{Lowlevel Java API} There's a higher level Java API defined in the \ref{topic:Higher level Java API: JSS}(JSS package) which is available -in the contrib/ directory. This package is described later in this +in the \code{contrib/} directory. This package is described later in this document. This section covers the lower level API directly available after evaluating \code{(require 'JAVA)}. @@ -189,10 +191,12 @@ \subsubsection{Dynamic dispatch: caveats} -Dynamic dispatch is performed by using the Java reflection API. Generally -it works fine, but there are corner cases where the API does not correctly -reflect all the details involved in calling a Java method. An example is -the following Java code: +Dynamic dispatch is performed by using the Java reflection +API \footnote{The Java reflection API is found in the + \code{java.lang.reflect} package}. Generally the dispatch works +fine, but there are corner cases where the API does not correctly +reflect all the details involved in calling a Java method. An example +is the following Java code: \begin{listing-java} ZipFile jar = new ZipFile("/path/to/some.jar"); @@ -201,7 +205,7 @@ method.invoke(els); \end{listing-java} -even though the method \code{hasMoreElements} is public in \code{Enumeration}, +even though the method \code{hasMoreElements()} is public in \code{Enumeration}, the above code fails with \begin{listing-java} @@ -227,7 +231,7 @@ except that the dynamic dispatch part is not shown. -To avoid such pitfalls, all Java objects in ABCL carry an extra +To avoid such pitfalls, all Java objects in \textsc{ABCL} carry an extra field representing the ``intended class'' of the object. That is the class that is used first by \code{JAVA:JCALL} and similar to resolve methods; the actual class of the object is only tried if the method is not found From mevenson at common-lisp.net Wed Oct 19 19:37:02 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 19 Oct 2011 12:37:02 -0700 Subject: [armedbear-cvs] r13629 - trunk/abcl Message-ID: Author: mevenson Date: Wed Oct 19 12:37:01 2011 New Revision: 13629 Log: Dust off the README a bit. Modified: trunk/abcl/README Modified: trunk/abcl/README ============================================================================== --- trunk/abcl/README Wed Oct 12 22:05:20 2011 (r13628) +++ trunk/abcl/README Wed Oct 19 12:37:01 2011 (r13629) @@ -172,13 +172,24 @@ BUGS ==== -A lot of (renewed) energy has been spent to make ABCL a compliant -and practically useable Common Lisp implementation. Because of this, -ABCL 0.25.0 now fails only 28 out of 21702 tests in the ANSI CL test -suite. In addition, Maxima's test suite runs without failures now -and ABCL's CLOS complete, with the exception of the long form of +ABCL is a conforming ANSI Common Lisp implementation. Any other +behavior should be reported as a bug. + +ABCL now has a manual stating its confomance to the ANSI standard, +providing a compliant and practicalCommon Lisp implementation. +Because of this, + + +### Tests + +ABCL 0.28.0 now fails only 28 out of 21702 tests in the ANSI +CL test suite (dervied from GCL). + +Maxima's test suite runs without failures. DEFINE-METHOD-COMBINATION - which is an ongoing effort. +### Deficencies + The MOP implementation is incomplete. Patches to address any of the issues mentioned above will @@ -192,4 +203,7 @@ On behalf of all ABCL development team and contributors, Erik Huelsmann -January 20, 2011 +Mark Evenson + +October 2011 + From mevenson at common-lisp.net Wed Oct 19 19:39:41 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 19 Oct 2011 12:39:41 -0700 Subject: [armedbear-cvs] r13630 - trunk/abcl Message-ID: Author: mevenson Date: Wed Oct 19 12:39:40 2011 New Revision: 13630 Log: The long form of DEFINE-METHOD-COMBINATION has been implemented. Modified: trunk/abcl/README Modified: trunk/abcl/README ============================================================================== --- trunk/abcl/README Wed Oct 19 12:37:01 2011 (r13629) +++ trunk/abcl/README Wed Oct 19 12:39:40 2011 (r13630) @@ -186,7 +186,6 @@ CL test suite (dervied from GCL). Maxima's test suite runs without failures. -DEFINE-METHOD-COMBINATION - which is an ongoing effort. ### Deficencies From mevenson at common-lisp.net Wed Oct 19 20:08:47 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 19 Oct 2011 13:08:47 -0700 Subject: [armedbear-cvs] r13631 - in trunk/abcl: . doc doc/design/pathnames Message-ID: Author: mevenson Date: Wed Oct 19 13:08:47 2011 New Revision: 13631 Log: Clean out all the mouse droppings from the corners. Modified: trunk/abcl/abcl.properties.in trunk/abcl/doc/design/pathnames/pathnames.tex trunk/abcl/doc/slime.markdown Modified: trunk/abcl/abcl.properties.in ============================================================================== --- trunk/abcl/abcl.properties.in Wed Oct 19 12:39:40 2011 (r13630) +++ trunk/abcl/abcl.properties.in Wed Oct 19 13:08:47 2011 (r13631) @@ -5,14 +5,15 @@ # Attempt to perform incremental compilation? #abcl.build.incremental=true -# skips the compilation of Lisp sources in Netbeans (for debugging) +# skips the compilation of Lisp sources in Netbeans +# (for debugging compiler-pass1.lisp and subsequent passes) #abcl.compile.lisp.skip=true # java.options sets the Java options in the abcl wrapper scripts -# Examples +# Examples: -# set the JVM to use a maximum of 1GB of RAM (only works for 64bit JVMs) +# Set the JVM to use a maximum of 1GB of RAM (only works for 64bit JVMs) #java.options=-d64 -Xmx1g # The unloading of class definitions is a per jvm policy. For those @@ -20,5 +21,5 @@ # help things out. #java.options=-d64 -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=1g -# Additional site specific startup code to be merged in 'system.lisp' +# Additional site specific startup code to be merged in 'system.lisp' at build time #abcl.startup.file=${basedir}/startup.lisp Modified: trunk/abcl/doc/design/pathnames/pathnames.tex ============================================================================== --- trunk/abcl/doc/design/pathnames/pathnames.tex Wed Oct 19 12:39:40 2011 (r13630) +++ trunk/abcl/doc/design/pathnames/pathnames.tex Wed Oct 19 13:08:47 2011 (r13631) @@ -13,7 +13,70 @@ \section{Abstract} We implement the semantics for distributed resource description and -retrieval by URL/URI/IRI Pathname in the Armeedbear Common Lisp implementation. +retrieval by URL/URI/IRI Pathname in the Armed Bear Common Lisp +implementation. + +\section{Plan of Attach} +\subsection{Goals} + +\begin{enumerate] +\item Use Common Lisp pathnames to refer to representations referenced + by a URL. + +\item The URL schemes supported shall include at least "http", and + those enabled by the URLStreamHandler extension mechanism. + +\item Use URL schemes that are understood by the java.net.URL object. + + +\item MERGE-PATHNAMES + + (merge-pathnames "url.asd" + "http://example/org/armedbear/systems/pgp.asd") + ==> "http://example/org/armedbear/systems/url.asd" + +\item PROBE-FILE returning the state of URL accesibility. + +\item TRUENAME "aliased" to PROBE-FILE signalling an error if the URL is +not accessible (see "Non-goal 1"). + +\item DIRECTORY works for non-wildcards. + +\item URL pathname work as a valid argument for OPEN with :DIRECTION :INPUT. + +\item Enable the loading of ASDF2 systems referenced by a URL pathname. + +\item Pathnames constructed with the "file" scheme +(i.e. #p"file:/this/file") need to be properly URI encoded according +to RFC3986 or otherwise will signal FILE-ERROR. + +\item. The "file" scheme will continue to be represented by an +"ordinary" Pathname. Thus, after construction of a URL Pathname with +the "file" scheme, the namestring of the resulting PATHNAME will no +longer contain the "file:" prefix. + +\item. The "jar" scheme will continue to be represented by a jar +Pathname. +\end{enumerate} + +\subsection{Non-goals} + +\begin{enumerate} + +\item We will not implement canonicalization of URL schemas (such as + following "http" redirects). + +\item \textsc{DIRECTORY} will not work for URL pathnames containing + wildcards. + +\end{enumerate} + +\subsubsection{Example} + Example of a Pathname specified by URL: + + #p"http://example.org/org/armedbear/systems/pgp.asd" + + \section{Notes} \include{notes} Modified: trunk/abcl/doc/slime.markdown ============================================================================== --- trunk/abcl/doc/slime.markdown Wed Oct 19 12:39:40 2011 (r13630) +++ trunk/abcl/doc/slime.markdown Wed Oct 19 13:08:47 2011 (r13631) @@ -12,10 +12,11 @@ ## Obtaining SLIME -SLIME does not follow a release process in the standard, so you are -best off with obtaining the [latest version from CVS][1]. [Daily -snapshots as gzipped tarballs are also available][2]. Your local OS -packaging system (i.e. MacPorts on OSX) may have a version as well. +SLIME does not follow a release process in the standard sense with +centrally versioned releases, so you are best off with obtaining the +[latest version from CVS][1]. [Daily snapshots as gzipped tarballs are also available][2]. +Your local OS packaging system (i.e. MacPorts on OSX) may have a +version as well. [1]: http://common-lisp.net/project/slime/#downloading [2]: http://common-lisp.net/project/slime/snapshots/slime-current.tgz @@ -86,3 +87,8 @@ connect to this port via issuing `M-x slime-connect` in Emacs. +### Historivia + +Luke Gorrie inherited a server implementation known as "Skank" which +he rejected on the grounds of pure taste. + From mevenson at common-lisp.net Thu Oct 20 06:56:50 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 19 Oct 2011 23:56:50 -0700 Subject: [armedbear-cvs] r13632 - trunk/abcl Message-ID: Author: mevenson Date: Wed Oct 19 23:56:49 2011 New Revision: 13632 Log: Create toplevel refernce to the manual constuction. THe User Manual may be constructed with 'pdflatex' on the command line The LaTeX sources start from 'doc/manual/abcl.tex'. Patches solicited. Added: trunk/abcl/MANUAL Added: trunk/abcl/MANUAL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/MANUAL Wed Oct 19 23:56:49 2011 (r13632) @@ -0,0 +1,7 @@ +The Armed Bear Common Lisp User Manual may be constructed via TeXLive +from the 'doc/manual' directory. + + solicits patches to improve the manual. + +Mark +October 2011 From mevenson at common-lisp.net Thu Oct 20 07:12:10 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 00:12:10 -0700 Subject: [armedbear-cvs] r13633 - trunk/abcl Message-ID: Author: mevenson Date: Thu Oct 20 00:12:07 2011 New Revision: 13633 Log: Ispell build.xml. Modified: trunk/abcl/build.xml Modified: trunk/abcl/build.xml ============================================================================== --- trunk/abcl/build.xml Wed Oct 19 23:56:49 2011 (r13632) +++ trunk/abcl/build.xml Thu Oct 20 00:12:07 2011 (r13633) @@ -445,7 +445,7 @@ - Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}' + Creates in-place executable shell wrapper in '${abcl.wrapper.file}' From mevenson at common-lisp.net Thu Oct 20 08:29:06 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 01:29:06 -0700 Subject: [armedbear-cvs] r13634 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 20 01:29:05 2011 New Revision: 13634 Log: Examples of JSS usage. Re-formatted JSR-223 constribution (Thanks Alessio!) Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Thu Oct 20 00:12:07 2011 (r13633) +++ trunk/abcl/doc/manual/abcl.tex Thu Oct 20 01:29:05 2011 (r13634) @@ -5,7 +5,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{October 13, 2011} +\date{October 20, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle @@ -26,7 +26,7 @@ versioned package from your system vendor. This byte archive can be executed under the control of a suitable JVM by using the ``-jar'' option to parse the manifest, and select the named class -(\code{org.armedbear.lisp.Main}) for excution: +(\code{org.armedbear.lisp.Main}) for execution: \begin{listing-shell} cmd$ java -jar abcl.jar @@ -140,7 +140,7 @@ the ``raw'' counterparts of certain FFI functions and are recognizable by their name ending with \code{-RAW}. -\subsection{Lowlevel Java API} +\subsection{Low-level Java API} There's a higher level Java API defined in the \ref{topic:Higher level Java API: JSS}(JSS package) which is available @@ -153,7 +153,7 @@ There are two ways to call a Java object method in the basic API: \begin{itemize} -\item Call a specific method reference (pre-acquired) +\item Call a specific method reference (which was previously acquired) \item Dynamic dispatch using the method name and the call-specific arguments provided by finding the \ref{section:Parameter matching for FFI dynamic dispatch}{best match}. @@ -235,7 +235,7 @@ field representing the ``intended class'' of the object. That is the class that is used first by \code{JAVA:JCALL} and similar to resolve methods; the actual class of the object is only tried if the method is not found -in the intended class. Of course, the intended class is always a superclass +in the intended class. Of course, the intended class is always a super-class of the actual class - in the worst case, they coincide. The intended class is deduced by the return type of the method that originally returned the Java object; in the case above, the intended class of \code{ELS} @@ -392,15 +392,15 @@ If one is calling an primitive function in the CL package the syntax becomes considerably simpler. If we can locate the instance of definition in the ABCL Java source, we can invoke the symbol directly. -For instnace, to tell if a `LispObject` contains a reference to a symbol. +For instance, to tell if a `LispObject` contains a reference to a symbol. \begin{listing-java} boolean nullp(LispObject object) { LispObject result = Primitives.NULL.execute(object); - if (result == NIL) { // the symbol 'NIL' is explicity named in the Java + if (result == NIL) { // the symbol 'NIL' is explicitly named in the Java // namespace at ``Symbol.NIL'' // but is always present in the - // localnamespace in its unadorned form for + // local namespace in its unadorned form for // the convenience of the User. return false; } @@ -461,86 +461,192 @@ \subsection{Java Scripting API (JSR-223)} -ABCL can be built with support for JSR-223, which offers a language-agnostic -API to invoke other languages from Java. The binary distribution downloadable -from ABCL's common-lisp.net home is built with JSR-223 support. If you're building -ABCL from source on a pre-1.6 JVM, you need to have a JSR-223 implementation in your -CLASSPATH (such as Apache Commons BSF 3.x or greater) in order to build ABCL -with JSR-223 support; otherwise, this feature will not be built. - -This section describes the design decisions behind the ABCL JSR-223 support. It is not a description of what JSR-223 is or a tutorial on how to use it. See http://trac.common-lisp.net/armedbear/browser/trunk/abcl/examples/jsr-223 for example usage. +ABCL can be built with support for JSR-223, which offers a +language-agnostic API to invoke other languages from Java. The binary +distribution downloadable from ABCL's common-lisp.net home is built +with JSR-223 support. If you're building ABCL from source on a pre-1.6 +JVM, you need to have a JSR-223 implementation in your CLASSPATH (such +as Apache Commons BSF 3.x or greater) in order to build ABCL with +JSR-223 support; otherwise, this feature will not be built. + +This section describes the design decisions behind the ABCL JSR-223 +support. It is not a description of what JSR-223 is or a tutorial on +how to use it. See +http://trac.common-lisp.net/armedbear/browser/trunk/abcl/examples/jsr-223 +for example usage. \subsubsection{Conversions} -In general, ABCL's implementation of the JSR-223 API performs implicit conversion from Java objects to Lisp objects when invoking Lisp from Java, and the opposite when returning values from Java to Lisp. This potentially reduces coupling between user code and ABCL. To avoid such conversions, wrap the relevant objects in \code{JavaObject} instances. +In general, ABCL's implementation of the JSR-223 API performs implicit +conversion from Java objects to Lisp objects when invoking Lisp from +Java, and the opposite when returning values from Java to Lisp. This +potentially reduces coupling between user code and ABCL. To avoid such +conversions, wrap the relevant objects in \code{JavaObject} instances. \subsubsection{Implemented JSR-223 interfaces} -JSR-223 defines three main interfaces, of which two (Invocable and Compilable) are optional. ABCL implements all the three interfaces - ScriptEngine and the two optional ones - almost completely. While the JSR-223 API is not specific to a single scripting language, it was designed with languages with a more or less Java-like object model in mind: languages such as Javascript, Python, Ruby, which have a concept of "class" or "object" with "fields" and "methods". Lisp is a bit different, so certain adaptations were made, and in one case a method has been left unimplemented since it does not map at all to Lisp. +JSR-223 defines three main interfaces, of which two (Invocable and +Compilable) are optional. ABCL implements all the three interfaces - +ScriptEngine and the two optional ones - almost completely. While the +JSR-223 API is not specific to a single scripting language, it was +designed with languages with a more or less Java-like object model in +mind: languages such as Javascript, Python, Ruby, which have a concept +of "class" or "object" with "fields" and "methods". Lisp is a bit +different, so certain adaptations were made, and in one case a method +has been left unimplemented since it does not map at all to Lisp. \subsubsection{The ScriptEngine} -The main interface defined by JSR-223, javax.script.ScriptEngine, is implemented by the class \code{org.armedbear.lisp.scripting.AbclScriptEngine}. AbclScriptEngine is a singleton, reflecting the fact that ABCL is a singleton as well. You can obtain an instance of AbclScriptEngine using the AbclScriptEngineFactory or by using the service provider mechanism through ScriptEngineManager (refer to the javax.script documentation). +The main interface defined by JSR-223, javax.script.ScriptEngine, is +implemented by the class +\code{org.armedbear.lisp.scripting.AbclScriptEngine}. AbclScriptEngine +is a singleton, reflecting the fact that ABCL is a singleton as +well. You can obtain an instance of AbclScriptEngine using the +AbclScriptEngineFactory or by using the service provider mechanism +through ScriptEngineManager (refer to the javax.script documentation). \subsubsection{Startup and configuration file} -At startup (i.e. when its constructor is invoked, as part of the static initialization phase of AbclScriptEngineFactory) the ABCL script engine attempts to load an "init file" from the classpath (/abcl-script-config.lisp). If present, this file can be used to customize the behaviour of the engine, by setting a number of variables in the ABCL-SCRIPT package. Here is a list of the available variables: +At startup (i.e. when its constructor is invoked, as part of the +static initialization phase of AbclScriptEngineFactory) the ABCL +script engine attempts to load an "init file" from the classpath +(/abcl-script-config.lisp). If present, this file can be used to +customize the behaviour of the engine, by setting a number of +variables in the ABCL-SCRIPT package. Here is a list of the available +variables: \begin{itemize} -\item *use-throwing-debugger* Controls whether ABCL uses a non-standard debugging hook function to throw a Java exception instead of dropping into the debugger in case of unhandled error conditions. +\item *use-throwing-debugger* Controls whether ABCL uses a + non-standard debugging hook function to throw a Java exception + instead of dropping into the debugger in case of unhandled error + conditions. \begin{itemize} \item Default value: T - \item Rationale: it is more convenient for Java programmers using Lisp as a scripting language to have it return exceptions to Java instead of handling them in the Lisp world. - \item Known Issues: the non-standard debugger hook has been reported to misbehave in certain circumstances, so consider disabling it if it doesn't work for you. + \item Rationale: it is more convenient for Java programmers using + Lisp as a scripting language to have it return exceptions to Java + instead of handling them in the Lisp world. + \item Known Issues: the non-standard debugger hook has been reported + to misbehave in certain circumstances, so consider disabling it if + it doesn't work for you. \end{itemize} -\item *launch-swank-at-startup* If true, Swank will be launched at startup. See *swank-dir* and *swank-port*. +\item *launch-swank-at-startup* If true, Swank will be launched at + startup. See *swank-dir* and *swank-port*. \begin{itemize} \item Default value: NIL \end{itemize} -\item *swank-dir* The directory where Swank is installed. Must be set if *launch-swank-at-startup* is true. -\item *swank-port* The port where Swank will listen for connections. Must be set if *launch-swank-at-startup* is true. +\item *swank-dir* The directory where Swank is installed. Must be set + if *launch-swank-at-startup* is true. +\item *swank-port* The port where Swank will listen for + connections. Must be set if *launch-swank-at-startup* is true. \begin{itemize} \item Default value: 4005 \end{itemize} \end{itemize} -Additionally, at startup the AbclScriptEngine will \code{(require 'asdf)} - in fact, it uses asdf to load Swank. +Additionally, at startup the AbclScriptEngine will \code{(require + 'asdf)} - in fact, it uses asdf to load Swank. \subsubsection{Evaluation} -Code is read and evaluated in the package ABCL-SCRIPT-USER. This packages USEs the COMMON-LISP, JAVA and ABCL-SCRIPT packages. Future versions of the script engine might make this default package configurable. The \code{CL:LOAD} function is used under the hood for evaluating code, and thus the same behavior of LOAD is guaranteed. This allows, among other things, \code{IN-PACKAGE} forms to change the package in which the loaded code is read. - -It is possible to evaluate code in what JSR-223 calls a "ScriptContext" (basically a flat environment of name->value pairs). This context is used to establish special bindings for all the variables defined in it; since variable names are strings from Java's point of view, they are first interned using READ-FROM-STRING with, as usual, ABCL-SCRIPT-USER as the default package. Variables are declared special because CL's \code{LOAD}, \code{EVAL} and \code{COMPILE} functions work in a null lexical environment and would ignore non-special bindings. - -Contrary to what the function \code{LOAD} does, evaluation of a series of forms returns the value of the last form instead of T, so the evaluation of short scripts does the Right Thing. +Code is read and evaluated in the package ABCL-SCRIPT-USER. This +packages USEs the COMMON-LISP, JAVA and ABCL-SCRIPT packages. Future +versions of the script engine might make this default package +configurable. The \code{CL:LOAD} function is used under the hood for +evaluating code, and thus the same behavior of LOAD is +guaranteed. This allows, among other things, \code{IN-PACKAGE} forms +to change the package in which the loaded code is read. + +It is possible to evaluate code in what JSR-223 calls a +"ScriptContext" (basically a flat environment of name->value +pairs). This context is used to establish special bindings for all the +variables defined in it; since variable names are strings from Java's +point of view, they are first interned using READ-FROM-STRING with, as +usual, ABCL-SCRIPT-USER as the default package. Variables are declared +special because CL's \code{LOAD}, \code{EVAL} and \code{COMPILE} +functions work in a null lexical environment and would ignore +non-special bindings. + +Contrary to what the function \code{LOAD} does, evaluation of a series +of forms returns the value of the last form instead of T, so the +evaluation of short scripts does the Right Thing. \subsubsection{Compilation} -AbclScriptEngine implements the javax.script.Compilable interface. Currently it only supports compilation using temporary files. Compiled code, returned as an instance of javax.script.CompiledScript, is read, compiled and executed by default in the ABCL-SCRIPT-USER package, just like evaluated code. Differently from evaluated code, though, due to the way the ABCL compiler works, compiled code contains no reference to top-level self-evaluating objects (like numbers or strings). Thus, when evaluated, a piece of compiled code will return the value of the last non-self-evaluating form: for example the code "(do-something) 42" will return 42 when interpreted, but will return the result of (do-something) when compiled and later evaluated. To ensure consistency of behavior between interpreted and compiled code, make sure the last form is always a compound form - at least (identity some-literal-object). Note that this issue should not matter in real code, where it is unlikely a top-level self-evaluating form will appear as the last form in a file (in fact, the Common Lisp load function always returns T upon success; with JSR-223 this policy has been changed to make evaluation of small code snippets work as intended). +AbclScriptEngine implements the javax.script.Compilable +interface. Currently it only supports compilation using temporary +files. Compiled code, returned as an instance of +javax.script.CompiledScript, is read, compiled and executed by default +in the ABCL-SCRIPT-USER package, just like evaluated code. Differently +from evaluated code, though, due to the way the ABCL compiler works, +compiled code contains no reference to top-level self-evaluating +objects (like numbers or strings). Thus, when evaluated, a piece of +compiled code will return the value of the last non-self-evaluating +form: for example the code "(do-something) 42" will return 42 when +interpreted, but will return the result of (do-something) when +compiled and later evaluated. To ensure consistency of behavior +between interpreted and compiled code, make sure the last form is +always a compound form - at least (identity some-literal-object). Note +that this issue should not matter in real code, where it is unlikely a +top-level self-evaluating form will appear as the last form in a file +(in fact, the Common Lisp load function always returns T upon success; +with JSR-223 this policy has been changed to make evaluation of small +code snippets work as intended). \subsubsection{Invocation of functions and methods} -AbclScriptEngine implements the \code{javax.script.Invocable} interface, which allows to directly call Lisp functions and methods, and to obtain Lisp implementations of Java interfaces. This is only partially possible with Lisp since it has functions, but not methods - not in the traditional OO sense, at least, since Lisp methods are not attached to objects but belong to generic functions. Thus, the method \code{invokeMethod()} is not implemented and throws an UnsupportedOperationException when called. The \code{invokeFunction()} method should be used to call both regular and generic functions. +AbclScriptEngine implements the \code{javax.script.Invocable} +interface, which allows to directly call Lisp functions and methods, +and to obtain Lisp implementations of Java interfaces. This is only +partially possible with Lisp since it has functions, but not methods - +not in the traditional OO sense, at least, since Lisp methods are not +attached to objects but belong to generic functions. Thus, the method +\code{invokeMethod()} is not implemented and throws an +UnsupportedOperationException when called. The \code{invokeFunction()} +method should be used to call both regular and generic functions. \subsubsection{Implementation of Java interfaces in Lisp} -ABCL can use the Java reflection-based proxy feature to implement Java interfaces in Lisp. It has several built-in ways to implement an interface, and supports definition of new ones. The \code{JAVA:JMAKE-PROXY} generic function is used to make such proxies. It has the following signature: +ABCL can use the Java reflection-based proxy feature to implement Java +interfaces in Lisp. It has several built-in ways to implement an +interface, and supports definition of new ones. The +\code{JAVA:JMAKE-PROXY} generic function is used to make such +proxies. It has the following signature: \code{jmake-proxy interface implementation \&optional lisp-this ==> proxy} -\code{interface} is a Java interface metaobject (e.g. obtained by invoking \code{jclass}) or a string naming a Java interface. \code{implementation} is the object used to implement the interface - several built-in methods of jmake-proxy exist for various types of implementations. \code{lisp-this} is an object passed to the closures implementing the Lisp "methods" of the interface, and defaults to \code{NIL}. +\code{interface} is a Java interface metaobject (e.g. obtained by +invoking \code{jclass}) or a string naming a Java +interface. \code{implementation} is the object used to implement the +interface - several built-in methods of jmake-proxy exist for various +types of implementations. \code{lisp-this} is an object passed to the +closures implementing the Lisp "methods" of the interface, and +defaults to \code{NIL}. -The returned proxy is an instance of the interface, with methods implemented with Lisp functions. +The returned proxy is an instance of the interface, with methods +implemented with Lisp functions. Built-in interface-implementation types include: \begin{itemize} -\item a single Lisp function which upon invocation of any method in the interface will be passed the method name, the Lisp-this object, and all the parameters. Useful for interfaces with a single method, or to implement custom interface-implementation strategies. -\item a hash-map of method-name -> Lisp function mappings. Function signature is \code{(lisp-this \&rest args)}. -\item a Lisp package. The name of the Java method to invoke is first transformed in an idiomatic Lisp name (\code{javaMethodName} becomes \code{JAVA-METHOD-NAME}) and a symbol with that name is searched in the package. If it exists and is fbound, the corresponding function will be called. Function signature is as the hash-table case. +\item a single Lisp function which upon invocation of any method in + the interface will be passed the method name, the Lisp-this object, + and all the parameters. Useful for interfaces with a single method, + or to implement custom interface-implementation strategies. +\item a hash-map of method-name -> Lisp function mappings. Function + signature is \code{(lisp-this \&rest args)}. +\item a Lisp package. The name of the Java method to invoke is first + transformed in an idiomatic Lisp name (\code{javaMethodName} becomes + \code{JAVA-METHOD-NAME}) and a symbol with that name is searched in + the package. If it exists and is fbound, the corresponding function + will be called. Function signature is as the hash-table case. \end{itemize} -This functionality is exposed by the AbclScriptEngine with the two methods getInterface(Class) and getInterface(Object, Class). The former returns an interface implemented with the current Lisp package, the latter allows the programmer to pass an interface-implementation object which will in turn be passed to the jmake-proxy generic function. +This functionality is exposed by the AbclScriptEngine with the two +methods getInterface(Class) and getInterface(Object, Class). The +former returns an interface implemented with the current Lisp package, +the latter allows the programmer to pass an interface-implementation +object which will in turn be passed to the jmake-proxy generic +function. \chapter{Implementation Dependent Extensions} @@ -726,9 +832,10 @@ \section{ASDF} -asdf-2.017 is packaged as core component of ABCL. By default, ASDF is -not loaded, as it relies on the CLOS subsystem which can take a bit of -time to initialize. +asdf-2.017 is packaged as core component of ABCL, but not intialized +by default, as it relies on the CLOS subsystem which can take a bit of +time to initialize. It may be initialized by the ANSI +\textsc{REQUIRE} mechanism as follows: \begin{listing-lisp} CL-USER> (require 'asdf) @@ -738,10 +845,11 @@ \section{abcl-asdf} -Allow ASDF system definition which dynamically loads JVM artifacts -such as jar archives via a Maven encapsulation. +This contrib to ABCL enables an additional syntax for ASDF system +definition which dynamically loads JVM artifacts such as jar archives +via a Maven encapsulation. -ASDF components added: JAR-FILE, JAR-DIRECTORY, CLASS-FILE-DIRECTORY +The following ASDF components are added: JAR-FILE, JAR-DIRECTORY, CLASS-FILE-DIRECTORY and MVN. \section{asdf-install} @@ -757,8 +865,20 @@ \section{jss} -Java Syntax sucks, so we introduce the \#" macro. +To one used to a syntax that can construct macros, the Java syntax +sucks, so we introduce the \#" macro. + +\subsection{JSS usage} + +Example: +\begin{listing-lisp} + CL-USER> (require 'jss) + + CL-USER) (#"getProperties" 'java.lang.System) + + CL-USER) (#"propertyNames" (#"getProperties" 'java.lang.System)) +\end{listing-lisp} \chapter{History} From mevenson at common-lisp.net Thu Oct 20 12:49:34 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 05:49:34 -0700 Subject: [armedbear-cvs] r13635 - in trunk/abcl: . src/org/armedbear/lisp Message-ID: Author: mevenson Date: Thu Oct 20 05:49:33 2011 New Revision: 13635 Log: Update README's account of passing the ANSI test suite with results for JDK6 on Solaris. Modified: trunk/abcl/README trunk/abcl/src/org/armedbear/lisp/clos.lisp Modified: trunk/abcl/README ============================================================================== --- trunk/abcl/README Thu Oct 20 01:29:05 2011 (r13634) +++ trunk/abcl/README Thu Oct 20 05:49:33 2011 (r13635) @@ -182,8 +182,8 @@ ### Tests -ABCL 0.28.0 now fails only 28 out of 21702 tests in the ANSI -CL test suite (dervied from GCL). +ABCL 0.28.0 now fails only 18 out of 21708 total tests in the ANSI CL +test suite (derived from the tests orginally written for GCL). Maxima's test suite runs without failures. @@ -196,13 +196,15 @@ Please report problems to the development mailing list: - armedbear-devel at common-lisp.net + Have fun! On behalf of all ABCL development team and contributors, Erik Huelsmann Mark Evenson +Alessio Stalla +Ville Voutilaninen October 2011 Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/clos.lisp Thu Oct 20 01:29:05 2011 (r13634) +++ trunk/abcl/src/org/armedbear/lisp/clos.lisp Thu Oct 20 05:49:33 2011 (r13635) @@ -2545,6 +2545,9 @@ (defmethod (setf documentation) (new-value (x package) (doc-type (eql 't))) (%set-documentation x doc-type new-value)) +(defmethod documentation ((x symbol) (doc-type (eql 'function))) + (%documentation x doc-type)) + ;;; Applicable methods (defgeneric compute-applicable-methods (gf args) From mevenson at common-lisp.net Thu Oct 20 18:05:31 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 11:05:31 -0700 Subject: [armedbear-cvs] r13636 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 20 11:05:30 2011 New Revision: 13636 Log: Document the ABCL-ASDF contrib which dynamically loads JVM dependencies. Smooth voice. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Thu Oct 20 05:49:33 2011 (r13635) +++ trunk/abcl/doc/manual/abcl.tex Thu Oct 20 11:05:30 2011 (r13636) @@ -22,7 +22,7 @@ \chapter{Running} \textsc{ABCL} is packaged as a single jar file usually named either -``abcl.jar'' or something like``abcl-0.28.0.jar'' if you are using a +``abcl.jar'' or possibly``abcl-0.28.0.jar'' if you are using a versioned package from your system vendor. This byte archive can be executed under the control of a suitable JVM by using the ``-jar'' option to parse the manifest, and select the named class @@ -93,6 +93,7 @@ \begin{itemize} \item The generic function signatures of the DOCUMENTATION symbol do not match the CLHS. + \item The TIME form does not return a proper VALUES to its caller. \end{itemize} ABCL aims to be be a fully conforming ANSI Common Lisp @@ -755,7 +756,7 @@ \section{Extensible Sequences} -\ref{RHODES2007} +See \ref{RHODES2007} RHODES2007 for the design. The SEQUENCE package fully implements Christopher Rhodes' proposal for extensible sequences. These user extensible sequences are used @@ -830,6 +831,11 @@ the corresponding Unicode character is output for characters whose code is greater than 0x00ff. +\subsection{JSS optionally extends the Reader} + +The JSS contrib consitutes an additional, optional extension to the +reader in the definition of the #\" reader macro. + \section{ASDF} asdf-2.017 is packaged as core component of ABCL, but not intialized @@ -852,10 +858,6 @@ The following ASDF components are added: JAR-FILE, JAR-DIRECTORY, CLASS-FILE-DIRECTORY and MVN. -\section{asdf-install} - -An implementation of ASDF-INSTALL. Superceded by Quicklisp (qv.) - \section{asdf-jar} ASDF-JAR provides a system for packaging ASDF systems into jar @@ -863,6 +865,53 @@ systems the code in this package will recursively package all the required source and fasls in a jar archive. +\section{abcl-asdf} + +ABCL specific contributions to ASDF system definition mainly concerned +with finding JVM artifacts such as jar archives to be dynamically loaded. + +\subsection{ABCL-ASDF Examples} + +\begin{listing-lisp} + ;;;; -*- Mode: LISP -*- + (in-package :asdf) + + (defsystem :log4j + :components ((:mvn "log4j/log4j" + :version "1.4.9"))) +\end{listing-lisp} + +\subsection{abcl-asdf API} + +We define an API as consisting of the following ASDF classes: + +\textsc[JAR-DIRECTORY}, \textsc{JAR-FILE}, and +\textsc{CLASS-FILE-DIRECTORY} for JVM artifacts that have a currently +valid pathname representation + +And the MVN and IRI classes descend from ASDF-COMPONENT, but do not +directly have a filesystem location. + +For use outside of ASDF, we currently define one method, +\textsc{RESOLVE-DEPENDENCIES} which locates, downloads, caches, and then loads +into the currently executing JVM process all recursive dependencies +annotated in the Maven pom.xml graph. + +\subsection{ABCL-ASDF Example 2} + +Bypassing ASDF, one can directly issue requests for the Maven +artifacts to be downloaded + +\begin{listing-lisp} + CL-USER> (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user") + WARNING: Using LATEST for unspecified version. + "/Users/evenson/.m2/repository/com/google/gwt/gwt-user/2.4.0-rc1/gwt-user-2.4.0-rc1.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar" +\end{listing-lisp} + +Notice that all recursive dependencies have been located and installed +as well. + + \section{jss} To one used to a syntax that can construct macros, the Java syntax @@ -880,6 +929,10 @@ CL-USER) (#"propertyNames" (#"getProperties" 'java.lang.System)) \end{listing-lisp} +\section{asdf-install} + +An implementation of ASDF-INSTALL. Superseded by Quicklisp (qv.) + \chapter{History} ABCL was originally the extension language for the J editor, which was From mevenson at common-lisp.net Thu Oct 20 22:42:28 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 15:42:28 -0700 Subject: [armedbear-cvs] r13637 - branches/1.0.x Message-ID: Author: mevenson Date: Thu Oct 20 15:42:26 2011 New Revision: 13637 Log: Added abcl 1.0.x branch. Added: branches/1.0.x/ From mevenson at common-lisp.net Thu Oct 20 22:46:27 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 15:46:27 -0700 Subject: [armedbear-cvs] r13638 - branches/1.0.x/abcl Message-ID: Author: mevenson Date: Thu Oct 20 15:46:26 2011 New Revision: 13638 Log: First plausible release canidate for abcl-1.0.0. Added: branches/1.0.x/abcl/ - copied from r13637, trunk/abcl/ From mevenson at common-lisp.net Thu Oct 20 22:52:30 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 15:52:30 -0700 Subject: [armedbear-cvs] r13639 - branches/1.0.x/abcl Message-ID: Author: mevenson Date: Thu Oct 20 15:52:29 2011 New Revision: 13639 Log: Set abcl-1.0.0 release date as October 22, 2011 Modified: branches/1.0.x/abcl/README Modified: branches/1.0.x/abcl/README ============================================================================== --- branches/1.0.x/abcl/README Thu Oct 20 15:46:26 2011 (r13638) +++ branches/1.0.x/abcl/README Thu Oct 20 15:52:29 2011 (r13639) @@ -47,7 +47,7 @@ which should result in output like the following - Armed Bear Common Lisp 0.25.0 + Armed Bear Common Lisp 1.0.0 Java 1.6.0_21 Sun Microsystems Inc. Java HotSpot(TM) Client VM Low-level initialization completed in 0.3 seconds. @@ -70,9 +70,10 @@ implementations for this process: SBCL, CMUCL, OpenMCL, Allegro CL, LispWorks or CLISP. -In all cases you need a Java 5 or later JDK (JDK 1.5 and 1.6 have been -tested). Just the JRE isn't enough, as you need the Java compiler -('javac') to compile the Java source of the ABCL implementation. +In all cases you need a Java 5 or later JDK (JDK 1.5, 1.6 and 1.7 have +been tested). Just the JRE isn't enough, as you need the Java +compiler ('javac') to compile the Java source of the ABCL +implementation. Note that when deploying ABCL having JDK isn't a requirement for the installation site, just the equivalent JRE, as ABCL compiles directly @@ -182,7 +183,7 @@ ### Tests -ABCL 0.28.0 now fails only 18 out of 21708 total tests in the ANSI CL +ABCL 1.0.0 now fails only 18 out of 21708 total tests in the ANSI CL test suite (derived from the tests orginally written for GCL). Maxima's test suite runs without failures. @@ -206,5 +207,5 @@ Alessio Stalla Ville Voutilaninen -October 2011 +October 22, 2011 From mevenson at common-lisp.net Thu Oct 20 22:52:32 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 15:52:32 -0700 Subject: [armedbear-cvs] r13640 - branches/1.0.x/abcl Message-ID: Author: mevenson Date: Thu Oct 20 15:52:31 2011 New Revision: 13640 Log: Don't warn if compiling under Java 7 as it seems to work fine. Modified: branches/1.0.x/abcl/build.xml Modified: branches/1.0.x/abcl/build.xml ============================================================================== --- branches/1.0.x/abcl/build.xml Thu Oct 20 15:52:29 2011 (r13639) +++ branches/1.0.x/abcl/build.xml Thu Oct 20 15:52:31 2011 (r13640) @@ -146,6 +146,7 @@ + From mevenson at common-lisp.net Thu Oct 20 22:53:12 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 15:53:12 -0700 Subject: [armedbear-cvs] r13641 - branches/1.0.x/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Thu Oct 20 15:53:12 2011 New Revision: 13641 Log: Update version to 1.0.0-dev. Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java ============================================================================== --- branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java Thu Oct 20 15:52:31 2011 (r13640) +++ branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java Thu Oct 20 15:53:12 2011 (r13641) @@ -41,7 +41,7 @@ { private Version() {} - static final String baseVersion = "0.28.0-dev"; + static final String baseVersion = "1.0.0-dev"; static void init() { try { From mevenson at common-lisp.net Thu Oct 20 23:38:00 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 16:38:00 -0700 Subject: [armedbear-cvs] r13642 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 20 16:38:00 2011 New Revision: 13642 Log: Restore buildable manual corresponding to ABCL-1.0.0. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 15:53:12 2011 (r13641) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:38:00 2011 (r13642) @@ -17,7 +17,7 @@ implementation for users of the system. \subsection{Version} -This manual corresponds to abcl-0.28.0, as yet unreleased. +This manual corresponds to abcl-1.0.0, release on October 22, 2011. \chapter{Running} @@ -29,7 +29,7 @@ (\code{org.armedbear.lisp.Main}) for execution: \begin{listing-shell} - cmd$ java -jar abcl.jar + cmd\$ java -jar abcl.jar \end{listing-shell} N.b. for the proceeding command to work, the ``java'' executable needs @@ -41,7 +41,7 @@ simply as: \begin{listing-shell} - cmd$ abcl + cmd\$ abcl \end{listing-shell} \section{Options} @@ -211,7 +211,7 @@ \begin{listing-java} java.lang.IllegalAccessException: Class ... can -not access a member of class java.util.zip.ZipFile$2 with modifiers +not access a member of class java.util.zip.ZipFile\$2 with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) at java.lang.reflect.Method.invoke(Method.java:583) @@ -834,7 +834,7 @@ \subsection{JSS optionally extends the Reader} The JSS contrib consitutes an additional, optional extension to the -reader in the definition of the #\" reader macro. +reader in the definition of the \#\" reader macro. \section{ASDF} @@ -885,7 +885,7 @@ We define an API as consisting of the following ASDF classes: -\textsc[JAR-DIRECTORY}, \textsc{JAR-FILE}, and +\textsc{JAR-DIRECTORY}, \textsc{JAR-FILE}, and \textsc{CLASS-FILE-DIRECTORY} for JVM artifacts that have a currently valid pathname representation From mevenson at common-lisp.net Thu Oct 20 23:38:03 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 16:38:03 -0700 Subject: [armedbear-cvs] r13643 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 20 16:38:03 2011 New Revision: 13643 Log: Smooth more nits in Manual. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:38:00 2011 (r13642) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:38:03 2011 (r13643) @@ -5,7 +5,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{October 20, 2011} +\date{October 21, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle @@ -22,7 +22,7 @@ \chapter{Running} \textsc{ABCL} is packaged as a single jar file usually named either -``abcl.jar'' or possibly``abcl-0.28.0.jar'' if you are using a +``abcl.jar'' or possibly``abcl-1.0.0.jar'' if you are using a versioned package from your system vendor. This byte archive can be executed under the control of a suitable JVM by using the ``-jar'' option to parse the manifest, and select the named class @@ -908,9 +908,15 @@ "/Users/evenson/.m2/repository/com/google/gwt/gwt-user/2.4.0-rc1/gwt-user-2.4.0-rc1.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar" \end{listing-lisp} -Notice that all recursive dependencies have been located and installed -as well. +To actually load the dependency, use the JAVA:ADD-TO-CLASSPATH generic +function: +\begin{listing-lisp} + CL-USER> (java:add-to-classpath (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user")) +\end{listing-lisp} + +Notice that all recursive dependencies have been located and installed +locally from the network as well. \section{jss} From mevenson at common-lisp.net Thu Oct 20 23:43:49 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 16:43:49 -0700 Subject: [armedbear-cvs] r13644 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 20 16:43:49 2011 New Revision: 13644 Log: Removed duplicated sections on abcl-asdf from Manual. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:38:03 2011 (r13643) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:43:49 2011 (r13644) @@ -853,10 +853,15 @@ This contrib to ABCL enables an additional syntax for ASDF system definition which dynamically loads JVM artifacts such as jar archives -via a Maven encapsulation. +via a Maven encapsulation. The Maven Aether can also be directly +manipulated by the function associated with the RESOLVE-DEPENDENCIES symbol. -The following ASDF components are added: JAR-FILE, JAR-DIRECTORY, CLASS-FILE-DIRECTORY -and MVN. +%ABCL specific contributions to ASDF system definition mainly concerned +%with finding JVM artifacts such as jar archives to be dynamically loaded. + + +The following ASDF components are added: \textsc{JAR-FILE}, \textsc[JAR-DIRECTORY}, +\textsc{CLASS-FILE-DIRECTORY} and \textsc{MVN}. \section{asdf-jar} @@ -865,10 +870,7 @@ systems the code in this package will recursively package all the required source and fasls in a jar archive. -\section{abcl-asdf} -ABCL specific contributions to ASDF system definition mainly concerned -with finding JVM artifacts such as jar archives to be dynamically loaded. \subsection{ABCL-ASDF Examples} From mevenson at common-lisp.net Thu Oct 20 23:44:37 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 16:44:37 -0700 Subject: [armedbear-cvs] r13645 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 20 16:44:37 2011 New Revision: 13645 Log: Fix LaTeX. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:43:49 2011 (r13644) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:44:37 2011 (r13645) @@ -860,7 +860,7 @@ %with finding JVM artifacts such as jar archives to be dynamically loaded. -The following ASDF components are added: \textsc{JAR-FILE}, \textsc[JAR-DIRECTORY}, +The following ASDF components are added: \textsc{JAR-FILE}, \textsc{JAR-DIRECTORY}, \textsc{CLASS-FILE-DIRECTORY} and \textsc{MVN}. \section{asdf-jar} From mevenson at common-lisp.net Thu Oct 20 23:55:28 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 16:55:28 -0700 Subject: [armedbear-cvs] r13646 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 20 16:55:27 2011 New Revision: 13646 Log: Getting out the burrs. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:44:37 2011 (r13645) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 16:55:27 2011 (r13646) @@ -17,19 +17,19 @@ implementation for users of the system. \subsection{Version} -This manual corresponds to abcl-1.0.0, release on October 22, 2011. +This manual corresponds to abcl-1.0.0, released on October 22, 2011. \chapter{Running} \textsc{ABCL} is packaged as a single jar file usually named either -``abcl.jar'' or possibly``abcl-1.0.0.jar'' if you are using a -versioned package from your system vendor. This byte archive can be -executed under the control of a suitable JVM by using the ``-jar'' -option to parse the manifest, and select the named class +``abcl.jar'' or possibly``abcl-1.0.0.jar'' if one is using a versioned +package from your system vendor. This byte archive can be executed +under the control of a suitable JVM by using the ``-jar'' option to +parse the manifest, and select the named class (\code{org.armedbear.lisp.Main}) for execution: \begin{listing-shell} - cmd\$ java -jar abcl.jar + cmd$ java -jar abcl.jar \end{listing-shell} N.b. for the proceeding command to work, the ``java'' executable needs @@ -41,7 +41,7 @@ simply as: \begin{listing-shell} - cmd\$ abcl + cmd$ abcl \end{listing-shell} \section{Options} @@ -96,31 +96,39 @@ \item The TIME form does not return a proper VALUES to its caller. \end{itemize} -ABCL aims to be be a fully conforming ANSI Common Lisp -implementation. Any other behavior should be reported as a bug. +ABCL aims to be be a fully conforming ANSI Common Lisp implementation. +Any other behavior should be reported as a bug. \section{Contemporary Common Lisp} In addition to ANSI conformance, \textsc{ABCL} strives to implement features expected of a contemporary Common Lisp. + +\subsection{Deficiencies} +The following known problems detract from \textsc{ABCL} being a proper +contemporary Comon Lisp. \begin{itemize} - \item Incomplete (A)MOP + \item Incomplete (A)MOP \footnote{Another Metaobject Protocol} % N.B. % TODO go through AMOP with symbols, starting by looking for % matching function signature. % XXX is this really blocking ANSI conformance? Answer: we have % to start with such a ``census'' to determine what we have. - \item Incomplete Streams: need suitable abstraction between ANSI - and Gray streams. + \item Incomplete streams work, in that \textsc{ABCL} needs suitable + abstraction between ANSI and Gray streams. \end{itemize} -\chapter{Interaction with host JVM} +\chapter{Interaction with Hosting JVM} % describe calling Java from Lisp, and calling Lisp from Java, % probably in two separate sections. Presumably, we can partition our % audience into those who are more comfortable with Java, and those % that are more comforable with Lisp +The Armedbear Common Lisp implementation is hosted on a Java Virtual +Machine. This chapter describes the mechanisms by which the +implementation interacts with that hosting mechanism. + \section{Lisp to Java} \textsc{ABCL} offers a number of mechanisms to interact with Java from its @@ -176,10 +184,11 @@ integer, the first method by that name and matching number of parameters is returned. -Once you have a reference to the method, you can call it using \code{JAVA:JCALL}, -which takes the method as the first argument. The second argument is the -object instance to call the method on, or \code{NIL} in case of a static method. -Any remaining parameters are used as the remaining arguments for the call. +Once one has a reference to the method, one may invoke it using +\code{JAVA:JCALL}, which takes the method as the first argument. The +second argument is the object instance to call the method on, or +\code{NIL} in case of a static method. Any remaining parameters are +used as the remaining arguments for the call. \subsubsection{Calling Java object methods: dynamic dispatch} @@ -573,7 +582,7 @@ \subsubsection{Compilation} -AbclScriptEngine implements the javax.script.Compilable +AbclScriptEngine implements the \code{javax.script.Compilable} interface. Currently it only supports compilation using temporary files. Compiled code, returned as an instance of javax.script.CompiledScript, is read, compiled and executed by default @@ -668,7 +677,7 @@ CL-USER> (add-to-classpath "/path/to/some.jar") \end{listing-lisp} -NB \code{add-to-classpath} only affects the classloader used by ABCL +N.b \code{add-to-classpath} only affects the classloader used by ABCL (the value of the special variable \code{JAVA:*CLASSLOADER*}. It has no effect on Java code outside ABCL. @@ -679,7 +688,10 @@ \section{THREADS} -Multithreading +The extensions for handling multithreaded execution are collected in +the \code{THREADS} package. Most of the abstractions in Doug Lea's +excellent \code{java.util.concurrent} packages may be manipulated +directly via the JSS contrib to great effect. \subsection{API} @@ -729,20 +741,26 @@ JVM. A URL-PATHNAME has a corresponding URL whose cannoical representation is defined to be the NAMESTRING of the Pathname. -PATHNAME : URL-PATHNAME : JAR-PATHNAME +\begin{verbatim} + JAR-PATHNAME isa URL-PATHNAME isa PATHNAME +\end{verbatim} + +Both URL-PATHNAME and JAR-PATHNAME may be used anywhere a PATHNAME is +accepted with the following caveats: -Both URL-PATHNAME and JAR-PATHNAME may be used anu where will a -PATHNAME is accepted witht the following caveats +\begin{itemize} -A stream obtained via OPEN on a URL-PATHNAME cannot be the target of -write operations. +\item A stream obtained via OPEN on a URL-PATHNAME cannot be the + target of write operations. -No canonicalization is performed on the underlying URI (i.e. the +\item No canonicalization is performed on the underlying URI (i.e. the implementation does not attempt to compute the current name of the representing resource unless it is requested to be resolved.) Upon resolution, any cannoicalization procedures followed in resolving the resource (e.g. following redirects) are discarded. +\end{itemize} + The implementation of URL-PATHNAME allows the ABCL user to laod dynamically code from the network. For example, for Quicklisp. @@ -863,13 +881,6 @@ The following ASDF components are added: \textsc{JAR-FILE}, \textsc{JAR-DIRECTORY}, \textsc{CLASS-FILE-DIRECTORY} and \textsc{MVN}. -\section{asdf-jar} - -ASDF-JAR provides a system for packaging ASDF systems into jar -archives for ABCL. Given a running ABCL image with loadable ASDF -systems the code in this package will recursively package all the -required source and fasls in a jar archive. - \subsection{ABCL-ASDF Examples} @@ -920,6 +931,14 @@ Notice that all recursive dependencies have been located and installed locally from the network as well. + +\section{asdf-jar} + +ASDF-JAR provides a system for packaging ASDF systems into jar +archives for ABCL. Given a running ABCL image with loadable ASDF +systems the code in this package will recursively package all the +required source and fasls in a jar archive. + \section{jss} To one used to a syntax that can construct macros, the Java syntax From mevenson at common-lisp.net Fri Oct 21 00:39:02 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 20 Oct 2011 17:39:02 -0700 Subject: [armedbear-cvs] r13647 - trunk/abcl Message-ID: Author: mevenson Date: Thu Oct 20 17:39:01 2011 New Revision: 13647 Log: Optimized runtime flags for Java 7 Modified: trunk/abcl/abcl.properties.in Modified: trunk/abcl/abcl.properties.in ============================================================================== --- trunk/abcl/abcl.properties.in Thu Oct 20 16:55:27 2011 (r13646) +++ trunk/abcl/abcl.properties.in Thu Oct 20 17:39:01 2011 (r13647) @@ -13,6 +13,9 @@ # Examples: +# Java7 on 64bit optimizations +#java.options=-d64 -Xmx16g -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2g + # Set the JVM to use a maximum of 1GB of RAM (only works for 64bit JVMs) #java.options=-d64 -Xmx1g From mevenson at common-lisp.net Fri Oct 21 07:48:45 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 00:48:45 -0700 Subject: [armedbear-cvs] r13648 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 00:48:44 2011 New Revision: 13648 Log: Manual editing, setting dates correctly. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Thu Oct 20 17:39:01 2011 (r13647) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 00:48:44 2011 (r13648) @@ -12,7 +12,7 @@ \chapter{Introduction} -Armed Bear is a mostly conforming implementation of the ANSI Common +Armed Bear is a (mostly) conforming implementation of the ANSI Common Lisp standard. This manual documents the Armed Bear Common Lisp implementation for users of the system. @@ -35,10 +35,11 @@ N.b. for the proceeding command to work, the ``java'' executable needs to be in your path. -To make it easier to facilitate the use of ABCL in tool chains (such as -SLIME) the invocation is wrapped in a Bourne shell script under UNIX -or a DOS command script under Windows so that ABCL may be executed -simply as: +To make it easier to facilitate the use of ABCL in tool chains (such +as SLIME \footnote{SLIME is the Superior Lisp Mode for Interaction + under Emacs}) the invocation is wrapped in a Bourne shell script +under UNIX or a DOS command script under Windows so that ABCL may be +executed simply as: \begin{listing-shell} cmd$ abcl @@ -82,7 +83,9 @@ directory and then interpret its contents. The user's home directory is determined by the value of the JVM system -property ``user.home''. +property ``user.home''. This value may--or may not--correspond to the +value of the HOME system environment variable at the discretion of the +JVM implementation that \textsc{ABCL} finds itself hosted upon. \chapter{Conformance} @@ -96,36 +99,53 @@ \item The TIME form does not return a proper VALUES to its caller. \end{itemize} +Somewhat confusingly, this statement of non-conformance +in the accompanying user documentation fullfills the requirements that +\textsc{ABCL} is a conforming ANSI Common Lisp implementation +according to the CLHS \footnote{Common Lisp Hyperspec language + reference document.}. Clarifications to this point are solicited. + ABCL aims to be be a fully conforming ANSI Common Lisp implementation. Any other behavior should be reported as a bug. \section{Contemporary Common Lisp} In addition to ANSI conformance, \textsc{ABCL} strives to implement features -expected of a contemporary Common Lisp. +expected of a contemporary Common Lisp \footnote{i.e. a Lisp of the + post 2005 Renaissance} \subsection{Deficiencies} The following known problems detract from \textsc{ABCL} being a proper contemporary Comon Lisp. \begin{itemize} - \item Incomplete (A)MOP \footnote{Another Metaobject Protocol} - % N.B. + \item An incomplete implementation of a properly named metaobject + protocol (viz. (A)MOP \footnote{Another Metaobject Protocol} ) + + % N.b. % TODO go through AMOP with symbols, starting by looking for % matching function signature. % XXX is this really blocking ANSI conformance? Answer: we have % to start with such a ``census'' to determine what we have. - \item Incomplete streams work, in that \textsc{ABCL} needs suitable - abstraction between ANSI and Gray streams. + + \item Incomplete streams abstraction, in that \textsc{ABCL} needs suitable + abstraction between ANSI and Gray streams. The streams could be + optimized to the JVM NIO abstractions at great profit for binary + byte-level manipulations. + \item Incomplete documentation (missing docstrings from exported + symbols. + \end{itemize} \chapter{Interaction with Hosting JVM} +% Plan of Attack +% % describe calling Java from Lisp, and calling Lisp from Java, % probably in two separate sections. Presumably, we can partition our % audience into those who are more comfortable with Java, and those % that are more comforable with Lisp -The Armedbear Common Lisp implementation is hosted on a Java Virtual +The Armed Bear Common Lisp implementation is hosted on a Java Virtual Machine. This chapter describes the mechanisms by which the implementation interacts with that hosting mechanism. @@ -151,15 +171,15 @@ \subsection{Low-level Java API} -There's a higher level Java API defined in the -\ref{topic:Higher level Java API: JSS}(JSS package) which is available -in the \code{contrib/} directory. This package is described later in this -document. This section covers the lower level API directly available -after evaluating \code{(require 'JAVA)}. +We define a higher level Java API in the \ref{topic:Higher level Java + API: JSS}(JSS package) which is available in the \code{contrib/} \ref{topic:contrib} +directory. This package is described later in this document. This +section covers the lower level API directly available after evaluating +\code{(require 'JAVA)}. -\subsubsection{Calling Java object methods} +\subsubsection{Calling Java Object Methods} -There are two ways to call a Java object method in the basic API: +There are two ways to call a Java object method in the low-level (basic) API: \begin{itemize} \item Call a specific method reference (which was previously acquired) @@ -199,7 +219,7 @@ on which the method should be called and any further arguments are used to select the best matching method and dispatch the call. -\subsubsection{Dynamic dispatch: caveats} +\subsubsection{Dynamic dispatch: Caveats} Dynamic dispatch is performed by using the Java reflection API \footnote{The Java reflection API is found in the @@ -963,17 +983,18 @@ \chapter{History} ABCL was originally the extension language for the J editor, which was -started in 1998 by Peter Graves. Sometime in 2003, it seems that a -lot of code that had previously not been released publically was -suddenly committed that enabled ABCL to be plausibly termed an ANSI -Common Lisp implementation. +started in 1998 by Peter Graves. Sometime in 2003, a whole lot of +code that had previously not been released publically was suddenly +committed that enabled ABCL to be plausibly termed an emergent ANSI +Common Lisp implementation canidate. In 2006, the implementation was transferred to the current maintainers, who have strived to improve its usability as a contemporary Common Lisp implementation. -In 201x, with the publication of this Manual explicitly stating the -conformance of Armed Bear Common Lisp to ANSI, we release abcl-1.0. +On October 22, 2011, with the publication of this Manual explicitly +stating the conformance of Armed Bear Common Lisp to ANSI, we released +abcl-1.0.0. @@ -986,10 +1007,12 @@ [Xach2011]: Quicklisp: A system for quickly constructing Common Lisp libraries. \url{http://www.quicklisp.org/} +[RHODES2007]: Christopher Rhodes + \end{document} % TODO % 1. Create mechanism for swigging DocString and Lisp docs into -% sections. +% sections ('grovel.lisp') From mevenson at common-lisp.net Fri Oct 21 07:57:52 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 00:57:52 -0700 Subject: [armedbear-cvs] r13649 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 00:57:51 2011 New Revision: 13649 Log: abcl-20111021a ABCL User Manual Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 00:48:44 2011 (r13648) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 00:57:51 2011 (r13649) @@ -19,6 +19,15 @@ \subsection{Version} This manual corresponds to abcl-1.0.0, released on October 22, 2011. +\subsection{License} + +The implementation is licensed under the terms of the GPL v2 of June +1991 with the ``classpath-exception'' that makes its deployment in +commercial settings quite reasonable. The license is viral in the +sense that if you change the implementation, and redistribute those +changes, you are required to provide the source to those changes back +to be merged with the public trunk. + \chapter{Running} \textsc{ABCL} is packaged as a single jar file usually named either @@ -26,7 +35,7 @@ package from your system vendor. This byte archive can be executed under the control of a suitable JVM by using the ``-jar'' option to parse the manifest, and select the named class -(\code{org.armedbear.lisp.Main}) for execution: +(\code{org.armedbear.lisp.Main}) for execution, viz: \begin{listing-shell} cmd$ java -jar abcl.jar @@ -72,7 +81,7 @@ the variable EXTENSIONS:*COMMAND-LINE-ARGUMENT-LIST*. \end{verbatim} -All of the command line arguments which follow the occurrence of ``--'' +All of the command line arguments which follow the occurrence of ``----'' are passed into a list bound to the EXT:*COMMAND-LINE-ARGUMENT-LIST* variable. @@ -90,17 +99,18 @@ \chapter{Conformance} \section{ANSI Common Lisp} -\textsc{ABCL} is currently a non-conforming ANSI Common Lisp implementation due -to the following issues: +\textsc{ABCL} is currently a (non)-conforming ANSI Common Lisp +implementation due to the following known issues: \begin{itemize} \item The generic function signatures of the DOCUMENTATION symbol do not match the CLHS. - \item The TIME form does not return a proper VALUES to its caller. + \item The TIME form does not return a proper VALUES environment to + its caller. \end{itemize} -Somewhat confusingly, this statement of non-conformance -in the accompanying user documentation fullfills the requirements that +Somewhat confusingly, this statement of non-conformance in the +accompanying user documentation fullfills the requirements that \textsc{ABCL} is a conforming ANSI Common Lisp implementation according to the CLHS \footnote{Common Lisp Hyperspec language reference document.}. Clarifications to this point are solicited. @@ -860,10 +870,14 @@ We implement a special hexadecimal escape sequence for specifying characters to the Lisp reader, namely we allow a sequences of the form -\# \textbackslash Uxxxx to be processed by the reader as character whose code is -specified by the hexadecimal digits ``xxxx''. The hexadecimal sequence -must be exactly four digits long, padded by leading zeros for values -less than 0x1000. +\# \textbackslash Uxxxx to be processed by the reader as character +whose code is specified by the hexadecimal digits ``xxxx''. The +hexadecimal sequence must be exactly four digits long \footnote{This + represents a compromise with contemporary in 2011 32bit hosting + architecures for which we wish to make text processing efficient. + Should the User require more control over UNICODE processing we + recommend Edi Weisz' excellent work with FLEXI-STREAMS which we + fully support}, padded by leading zeros for values less than 0x1000. Note that this sequence is never output by the implementation. Instead, the corresponding Unicode character is output for characters whose From mevenson at common-lisp.net Fri Oct 21 08:26:16 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 01:26:16 -0700 Subject: [armedbear-cvs] r13650 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 01:26:15 2011 New Revision: 13650 Log: Contributors section (needs formatting). Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 00:57:51 2011 (r13649) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 01:26:15 2011 (r13650) @@ -28,6 +28,18 @@ changes, you are required to provide the source to those changes back to be merged with the public trunk. +\subsection{Contributors} + +% TODO format this better, optionally link to URI + +Philip Marek +Douglas Miles +Alan Ruttenberg + +and of course + +Peter Graves + \chapter{Running} \textsc{ABCL} is packaged as a single jar file usually named either From mevenson at common-lisp.net Fri Oct 21 08:29:28 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 01:29:28 -0700 Subject: [armedbear-cvs] r13651 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 01:29:27 2011 New Revision: 13651 Log: Correct mispelling of Philipp Marek. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 01:26:15 2011 (r13650) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 01:29:27 2011 (r13651) @@ -32,8 +32,13 @@ % TODO format this better, optionally link to URI -Philip Marek +% Thanks for the markup +Philipp Marek + +% Thanks for the whacky IKVM stuff and keeping the flame alive Douglas Miles + +% Thanks for JSS Alan Ruttenberg and of course From mevenson at common-lisp.net Fri Oct 21 08:41:34 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 01:41:34 -0700 Subject: [armedbear-cvs] r13652 - branches/1.0.x/abcl/contrib/jss Message-ID: Author: mevenson Date: Fri Oct 21 01:41:34 2011 New Revision: 13652 Log: Correctly spell Alan Ruttenberg's name. Modified: branches/1.0.x/abcl/contrib/jss/README.markdown Modified: branches/1.0.x/abcl/contrib/jss/README.markdown ============================================================================== --- branches/1.0.x/abcl/contrib/jss/README.markdown Fri Oct 21 01:29:27 2011 (r13651) +++ branches/1.0.x/abcl/contrib/jss/README.markdown Fri Oct 21 01:41:34 2011 (r13652) @@ -1,7 +1,7 @@ JSS === -Created by Alan Ruttenburg +Created by Alan Ruttenberg JSS stands for either "Java Simple Syntax" or "Java Syntax Sucks", From ehuelsmann at common-lisp.net Fri Oct 21 09:14:45 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 21 Oct 2011 02:14:45 -0700 Subject: [armedbear-cvs] r13653 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Fri Oct 21 02:14:45 2011 New Revision: 13653 Log: Fix IRONCLAD compilation. Modified: trunk/abcl/src/org/armedbear/lisp/dump-form.lisp Modified: trunk/abcl/src/org/armedbear/lisp/dump-form.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/dump-form.lisp Fri Oct 21 01:41:34 2011 (r13652) +++ trunk/abcl/src/org/armedbear/lisp/dump-form.lisp Fri Oct 21 02:14:45 2011 (r13653) @@ -121,7 +121,7 @@ (t (unless *prevent-fasl-circle-detection* (assert (or (eq index t) - (fixnump object)))))))) + (integerp object)))))))) ;; strictly this should be 'long' (declaim (ftype (function (cons stream) t) dump-cons)) (defun dump-cons (object stream) From mevenson at common-lisp.net Fri Oct 21 11:29:17 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 04:29:17 -0700 Subject: [armedbear-cvs] r13654 - branches/1.0.x/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Fri Oct 21 04:29:16 2011 New Revision: 13654 Log: Backport r13653: Fix Ironclad compilation. Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/dump-form.lisp Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/dump-form.lisp ============================================================================== --- branches/1.0.x/abcl/src/org/armedbear/lisp/dump-form.lisp Fri Oct 21 02:14:45 2011 (r13653) +++ branches/1.0.x/abcl/src/org/armedbear/lisp/dump-form.lisp Fri Oct 21 04:29:16 2011 (r13654) @@ -121,7 +121,7 @@ (t (unless *prevent-fasl-circle-detection* (assert (or (eq index t) - (fixnump object)))))))) + (integerp object)))))))) ;; strictly this should be 'long' (declaim (ftype (function (cons stream) t) dump-cons)) (defun dump-cons (object stream) From mevenson at common-lisp.net Fri Oct 21 20:55:27 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 13:55:27 -0700 Subject: [armedbear-cvs] r13655 - in trunk/abcl: doc/asdf src/org/armedbear/lisp Message-ID: Author: mevenson Date: Fri Oct 21 13:55:25 2011 New Revision: 13655 Log: Upgrade to ASDF 2.0.17.022 Modified: trunk/abcl/doc/asdf/asdf.texinfo trunk/abcl/src/org/armedbear/lisp/asdf.lisp Modified: trunk/abcl/doc/asdf/asdf.texinfo ============================================================================== --- trunk/abcl/doc/asdf/asdf.texinfo Fri Oct 21 04:29:16 2011 (r13654) +++ trunk/abcl/doc/asdf/asdf.texinfo Fri Oct 21 13:55:25 2011 (r13655) @@ -517,7 +517,7 @@ @section Configuring where ASDF stores object files - at findex clear-output-locations + at findex clear-output-translations ASDF lets you configure where object files will be stored. Sensible defaults are provided and @@ -596,6 +596,33 @@ @node Using ASDF, Defining systems with defsystem, Configuring ASDF, Top @comment node-name, next, previous, up + + at section Resetting Configuration + +When you dump and restore an image, or when you tweak your configuration, +you may want to reset the ASDF configuration. +For that you may use the following function: + + at defun clear-configuration + undoes any ASDF configuration, + regarding source-registry or output-translations. + at end defun + +If you use SBCL, CMUCL or SCL, you may use this snippet +so that the ASDF configuration be cleared automatically as you dump an image: + + at example +#+(or cmu sbcl scl) +(pushnew 'clear-configuration + #+(or cmu scl) ext:*before-save-initializations* + #+sbcl sb-ext:*save-hooks*) + at end example + +For compatibility with all Lisp implementations, however, +you might want instead your build script to explicitly call + at code{(asdf:clear-configuration)} at an appropriate moment before dumping. + + @chapter Using ASDF @section Loading a system @@ -1210,6 +1237,7 @@ @menu * Operations:: * Components:: +* Functions:: @end menu @node Operations, Components, The object model of ASDF, The object model of ASDF @@ -1410,7 +1438,7 @@ Operations that print output should send that output to the standard CL stream @code{*standard-output*}, as the Lisp compiler and loader do. - at node Components, , Operations, The object model of ASDF + at node Components, Functions, Operations, The object model of ASDF @comment node-name, next, previous, up @section Components @cindex component @@ -1573,11 +1601,14 @@ @verbatim (this-op {(other-op required-components)}+) -required-components := component-name +simple-component-name := string + | symbol + +required-components := simple-component-name | (required-components required-components) -component-name := string - | (:version string minimum-version-object) +component-name := simple-component-name + | (:version simple-component-name minimum-version-object) @end verbatim Side note: @@ -1788,6 +1819,25 @@ ) @end lisp + at node Functions, , Components, The object model of ASDF + at comment node-name, next, previous, up + at section Functions + at findex version-satisfies + + at deffn version-satisfies @var{version} @var{version-spec} +Does @var{version} satisfy the @var{version-spec}. A generic function. +ASDF provides built-in methods for @var{version} being a + at code{component} or @code{string}. @var{version-spec} should be a +string. + +In the wild, we typically see version numbering only on components of +type @code{system}. + +For more information about how @code{version-satisfies} interprets +version strings and specifications, @pxref{The defsystem grammar} and + at ref{Common attributes of components}. + at end deffn + @node Controlling where ASDF searches for systems, Controlling where ASDF saves compiled files, The object model of ASDF, Top @comment node-name, next, previous, up @chapter Controlling where ASDF searches for systems @@ -2774,10 +2824,37 @@ @comment node-name, next, previous, up @chapter Miscellaneous additional functionality - at emph{FIXME: Add discussion of @code{run-shell-command}? Others?} - ASDF includes several additional features that are generally -useful for system definition and development. These include: +useful for system definition and development. + + at section Controlling file compilation + +When declaring a component (system, module, file), +you can specify a keyword argument @code{:around-compile some-symbol}. +If left unspecified, the value will be inherited from the parent component if any, +or with a default of @code{nil} if no value is specified in any transitive parent. + +The argument must be a either fbound symbol or @code{nil}. + at code{nil} means the normal compile-file function will be called. +A symbol means the function fbound to it will be called with a single argument, +a thunk that calls the compile-file function; +the function you specify must then funcall that thunk +inside whatever wrapping you want. + +Using this hook, you may achieve such effects as: +locally renaming packages, +binding @var{*readtables*} and other syntax-controlling variables, +handling warnings and other conditions, +proclaiming consistent optimization settings, +saving code coverage information, +maintaining meta-data about compilation timings, +setting gensym counters and PRNG seeds and other sources of non-determinism, +overriding the source-location and/or timestamping systems, +checking that some compile-time side-effects were properly balanced, +etc. + + + at section Miscellaneous Exported Functions @defun coerce-pathname name @&key type defaults @@ -2872,6 +2949,33 @@ look at the beginning of @file{asdf.lisp} to see what it does. @end defun + at defun run-shell-command + +This function is obsolete and present only for the sake of backwards-compatibility: +``If it's not backwards, it's not compatible''. We strongly discourage its use. +Its current behavior is only well-defined on Unix platforms +(which includes MacOS X and cygwin). On Windows, anything goes. + +Instead we recommend the use of such a function as + at code{xcvb-driver:run-program/process-output-stream} +from the @code{xcvb-driver} system that is distributed with XCVB: + at url{http://common-lisp.net/project/xcvb}. +It's only alternative that supports +as many implementations and operating systems as ASDF does, +and provides well-defined behavior outside Unix (i.e. on Windows). +(The only unsupported exception is Genera, since on it + at code{run-shell-command} doesn't make sense anyway on that platform). + +This function takes as arguments a @code{format} control-string +and arguments to be passed to @code{format} after this control-string +to produce a string. +This string is a command that will be evaluated with a POSIX shell if possible; +yet, on Windows, some implementations will use CMD.EXE, +while others (like SBCL) will make an attempt at invoking a POSIX shell +(and fail if it is not present). + at end defun + + @node Getting the latest version, FAQ, Miscellaneous additional functionality, Top @comment node-name, next, previous, up @chapter Getting the latest version Modified: trunk/abcl/src/org/armedbear/lisp/asdf.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/asdf.lisp Fri Oct 21 04:29:16 2011 (r13654) +++ trunk/abcl/src/org/armedbear/lisp/asdf.lisp Fri Oct 21 13:55:25 2011 (r13655) @@ -1,5 +1,5 @@ -;;; -*- mode: common-lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- -;;; This is ASDF 2.017: Another System Definition Facility. +;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- +;;; This is ASDF 2.017.22: Another System Definition Facility. ;;; ;;; Feedback, bug reports, and patches are all welcome: ;;; please mail to . @@ -61,14 +61,12 @@ (setf excl::*autoload-package-name-alist* (remove "asdf" excl::*autoload-package-name-alist* :test 'equalp :key 'car)) ; need that BEFORE any mention of package ASDF as below - #+(and ecl (not ecl-bytecmp)) (require :cmp) + #+ecl (unless (member :ecl-bytecmp *features*) (require :cmp)) #+gcl ;; Debian's GCL 2.7 has bugs with compiling multiple-value stuff, but can run ASDF 2.011 (when (or (< system::*gcl-major-version* 2) ;; GCL 2.6 fails to fully compile ASDF at all (and (= system::*gcl-major-version* 2) (< system::*gcl-minor-version* 7))) (pushnew :gcl-pre2.7 *features*)) - #+(and (or win32 windows mswindows mingw32) (not cygwin)) (pushnew :asdf-windows *features*) - #+(or unix cygwin) (pushnew :asdf-unix *features*) ;;; make package if it doesn't exist yet. ;;; DEFPACKAGE may cause errors on discrepancies, so we avoid it. (unless (find-package :asdf) @@ -112,7 +110,7 @@ ;; "2.345.6" would be a development version in the official upstream ;; "2.345.0.7" would be your seventh local modification of official release 2.345 ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6 - (asdf-version "2.017") + (asdf-version "2.017.22") (existing-asdf (find-class 'component nil)) (existing-version *asdf-version*) (already-there (equal asdf-version existing-version))) @@ -200,23 +198,22 @@ :do (unintern old user))) (loop :for x :in newly-exported-symbols :do (export (intern* x package))))) - (ensure-package (name &key nicknames use unintern fmakunbound - shadow export redefined-functions) + (ensure-package (name &key nicknames use unintern + shadow export redefined-functions) (let* ((p (ensure-exists name nicknames use))) (ensure-unintern p unintern) (ensure-shadow p shadow) (ensure-export p export) - (ensure-fmakunbound p (append fmakunbound redefined-functions)) + (ensure-fmakunbound p redefined-functions) p))) (macrolet ((pkgdcl (name &key nicknames use export - redefined-functions unintern fmakunbound shadow) + redefined-functions unintern shadow) `(ensure-package ',name :nicknames ',nicknames :use ',use :export ',export :shadow ',shadow :unintern ',unintern - :redefined-functions ',redefined-functions - :fmakunbound ',fmakunbound))) + :redefined-functions ',redefined-functions))) (pkgdcl :asdf :nicknames (:asdf-utilities) ;; DEPRECATED! Do not use, for backward compatibility only. @@ -226,16 +223,14 @@ #:perform-with-restarts #:component-relative-pathname #:system-source-file #:operate #:find-component #:find-system #:apply-output-translations #:translate-pathname* #:resolve-location + #:system-relative-pathname + #:inherit-source-registry #:process-source-registry + #:process-source-registry-directive #:compile-file* #:source-file-type) :unintern (#:*asdf-revision* #:around #:asdf-method-combination #:split #:make-collector #:output-files-for-system-and-operation) ; obsolete ASDF-BINARY-LOCATION function - :fmakunbound - (#:system-source-file - #:component-relative-pathname #:system-relative-pathname - #:process-source-registry - #:inherit-source-registry #:process-source-registry-directive) :export (#:defsystem #:oos #:operate #:find-system #:run-shell-command #:system-definition-pathname #:with-system-definitions @@ -298,7 +293,9 @@ #:*compile-file-warnings-behaviour* #:*compile-file-failure-behaviour* #:*resolve-symlinks* + #:*require-asdf-operator* #:*asdf-verbose* + #:*verbose-out* #:asdf-version @@ -675,7 +672,7 @@ (defun* getenv (x) (declare (ignorable x)) - #+(or abcl clisp xcl) (ext:getenv x) + #+(or abcl clisp ecl xcl) (ext:getenv x) #+allegro (sys:getenv x) #+clozure (ccl:getenv x) #+(or cmu scl) (cdr (assoc x ext:*environment-list* :test #'string=)) @@ -689,7 +686,6 @@ (ct:c-string-to-lisp-string buffer1)) (ct:free buffer) (ct:free buffer1))) - #+ecl (si:getenv x) #+gcl (system:getenv x) #+genera nil #+lispworks (lispworks:environment-variable x) @@ -922,6 +918,7 @@ (defgeneric* perform-with-restarts (operation component)) (defgeneric* perform (operation component)) (defgeneric* operation-done-p (operation component)) +(defgeneric* mark-operation-done (operation component)) (defgeneric* explain (operation component)) (defgeneric* output-files (operation component)) (defgeneric* input-files (operation component)) @@ -1166,14 +1163,55 @@ ;; no direct accessor for pathname, we do this as a method to allow ;; it to default in funky ways if not supplied (relative-pathname :initarg :pathname) + ;; the absolute-pathname is computed based on relative-pathname... (absolute-pathname) (operation-times :initform (make-hash-table) :accessor component-operation-times) + (around-compile :initarg :around-compile) ;; XXX we should provide some atomic interface for updating the ;; component properties (properties :accessor component-properties :initarg :properties :initform nil))) +;;; I believe that the following could probably be more efficiently done +;;; by a primary method that invokes SHARED-INITIALIZE in a way that would +;;; appropriately pass the slots to have their initforms re-applied, but I +;;; do not know how to write such a method. [2011/09/02:rpg] +(defmethod reinitialize-instance :after ((obj component) &rest initargs + &key (version nil version-suppliedp) + (description nil description-suppliedp) + (long-description nil + long-description-suppliedp) + (load-dependencies nil + ld-suppliedp) + in-order-to + do-first + inline-methods + parent + properties) + "We reuse component objects from previously-existing systems, so we need to +make sure we clear them thoroughly." + (declare (ignore initargs load-dependencies + long-description description version)) + ;; this is a cache and should be cleared + (slot-makunbound obj 'absolute-pathname) + ;; component operation times are no longer valid when the component changes + (clrhash (component-operation-times obj)) + (unless version-suppliedp (slot-makunbound obj 'version)) + (unless description-suppliedp + (slot-makunbound obj 'description)) + (unless long-description-suppliedp + (slot-makunbound obj 'long-description)) + ;; replicate the logic of the initforms... + (unless ld-suppliedp + (setf (component-load-dependencies obj) nil)) + (setf (component-in-order-to obj) in-order-to + (component-do-first obj) do-first + (component-inline-methods obj) inline-methods + (slot-value obj 'parent) parent + (slot-value obj 'properties) properties)) + + (defun* component-find-path (component) (reverse (loop :for c = component :then (component-parent c) @@ -1246,6 +1284,21 @@ :initarg :default-component-class :accessor module-default-component-class))) +;;; see comment with REINITIALIZE-INSTANCE method on COMPONENT +;;; [2011/09/02:rpg] +(defmethod reinitialize-instance :after ((obj module) &rest initargs &key) + "Clear MODULE's slots so it can be reused." + (slot-makunbound obj 'components-by-name) + ;; this may be a more elegant approach than in the + ;; COMPONENT method [2011/09/02:rpg] + (loop :for (initarg slot-name default) :in + `((:components components nil) + (:if-component-dep-fails if-component-dep-fails :fail) + (:default-component-class default-component-class + ,*default-component-class*)) + :unless (member initarg initargs) + :do (setf (slot-value obj slot-name) default))) + (defun* component-parent-pathname (component) ;; No default anymore (in particular, no *default-pathname-defaults*). ;; If you force component to have a NULL pathname, you better arrange @@ -1288,10 +1341,28 @@ (maintainer :accessor system-maintainer :initarg :maintainer) (licence :accessor system-licence :initarg :licence :accessor system-license :initarg :license) - (source-file :reader system-source-file :initarg :source-file + (source-file :reader %system-source-file :initarg :source-file ; for CLISP upgrade :writer %set-system-source-file) (defsystem-depends-on :reader system-defsystem-depends-on :initarg :defsystem-depends-on))) +;;; see comment with REINITIALIZE-INSTANCE method on COMPONENT +;;; [2011/09/02:rpg] +(defmethod reinitialize-instance :after ((obj system) &rest initargs &key) + "Clear SYSTEM's slots so it can be reused." + ;; note that SYSTEM-SOURCE-FILE is very specially handled, + ;; by DO-DEFSYSTEM, so we need to *PRESERVE* its value and + ;; not squash it. SYSTEM COMPONENTS are handled very specially, + ;; because they are always, effectively, reused, since the system component + ;; is made early in DO-DEFSYSTEM, instead of being made later, in + ;; PARSE-COMPONENT-FORM [2011/09/02:rpg] + (loop :for (initarg slot-name) :in + `((:author author) + (:maintainer maintainer) + (:licence licence) + (:defsystem-depends-on defsystem-depends-on)) + :unless (member initarg initargs) + :do (slot-makunbound obj slot-name))) + ;;;; ------------------------------------------------------------------------- ;;;; version-satisfies @@ -1340,6 +1411,81 @@ (and x y (= (car x) (car y)) (or (not (cdr y)) (bigger (cdr x) (cdr y))))))) +;;;; ----------------------------------------------------------------- +;;;; Windows shortcut support. Based on: +;;;; +;;;; Jesse Hager: The Windows Shortcut File Format. +;;;; http://www.wotsit.org/list.asp?fc=13 + +#-clisp +(progn +(defparameter *link-initial-dword* 76) +(defparameter *link-guid* #(1 20 2 0 0 0 0 0 192 0 0 0 0 0 0 70)) + +(defun* read-null-terminated-string (s) + (with-output-to-string (out) + (loop :for code = (read-byte s) + :until (zerop code) + :do (write-char (code-char code) out)))) + +(defun* read-little-endian (s &optional (bytes 4)) + (loop :for i :from 0 :below bytes + :sum (ash (read-byte s) (* 8 i)))) + +(defun* parse-file-location-info (s) + (let ((start (file-position s)) + (total-length (read-little-endian s)) + (end-of-header (read-little-endian s)) + (fli-flags (read-little-endian s)) + (local-volume-offset (read-little-endian s)) + (local-offset (read-little-endian s)) + (network-volume-offset (read-little-endian s)) + (remaining-offset (read-little-endian s))) + (declare (ignore total-length end-of-header local-volume-offset)) + (unless (zerop fli-flags) + (cond + ((logbitp 0 fli-flags) + (file-position s (+ start local-offset))) + ((logbitp 1 fli-flags) + (file-position s (+ start + network-volume-offset + #x14)))) + (concatenate 'string + (read-null-terminated-string s) + (progn + (file-position s (+ start remaining-offset)) + (read-null-terminated-string s)))))) + +(defun* parse-windows-shortcut (pathname) + (with-open-file (s pathname :element-type '(unsigned-byte 8)) + (handler-case + (when (and (= (read-little-endian s) *link-initial-dword*) + (let ((header (make-array (length *link-guid*)))) + (read-sequence header s) + (equalp header *link-guid*))) + (let ((flags (read-little-endian s))) + (file-position s 76) ;skip rest of header + (when (logbitp 0 flags) + ;; skip shell item id list + (let ((length (read-little-endian s 2))) + (file-position s (+ length (file-position s))))) + (cond + ((logbitp 1 flags) + (parse-file-location-info s)) + (t + (when (logbitp 2 flags) + ;; skip description string + (let ((length (read-little-endian s 2))) + (file-position s (+ length (file-position s))))) + (when (logbitp 3 flags) + ;; finally, our pathname + (let* ((length (read-little-endian s 2)) + (buffer (make-array length))) + (read-sequence buffer s) + (map 'string #'code-char buffer))))))) + (end-of-file () + nil))))) + ;;;; ------------------------------------------------------------------------- ;;;; Finding systems @@ -1420,6 +1566,26 @@ Going forward, we recommend new users should be using the source-registry. ") +(defun* featurep (x &optional (features *features*)) + (cond + ((atom x) + (and (member x features) t)) + ((eq 'not (car x)) + (assert (null (cddr x))) + (not (featurep (cadr x) features))) + ((eq 'or (car x)) + (some #'(lambda (x) (featurep x features)) (cdr x))) + ((eq 'and (car x)) + (every #'(lambda (x) (featurep x features)) (cdr x))) + (t + (error "Malformed feature specification ~S" x)))) + +(defun* os-unix-p () + (featurep '(or :unix :cygwin :darwin))) + +(defun* os-windows-p () + (and (not (os-unix-p)) (featurep '(or :win32 :windows :mswindows :mingw32)))) + (defun* probe-asd (name defaults) (block nil (when (directory-pathname-p defaults) @@ -1428,16 +1594,17 @@ :version :newest :case :local :type "asd"))) (when (probe-file* file) (return file))) - #+(and asdf-windows (not clisp)) - (let ((shortcut - (make-pathname - :defaults defaults :version :newest :case :local - :name (concatenate 'string name ".asd") - :type "lnk"))) - (when (probe-file* shortcut) - (let ((target (parse-windows-shortcut shortcut))) - (when target - (return (pathname target))))))))) + #-clisp + (when (os-windows-p) + (let ((shortcut + (make-pathname + :defaults defaults :version :newest :case :local + :name (concatenate 'string name ".asd") + :type "lnk"))) + (when (probe-file* shortcut) + (let ((target (parse-windows-shortcut shortcut))) + (when target + (return (pathname target)))))))))) (defun* sysdef-central-registry-search (system) (let ((name (coerce-name system)) @@ -1538,7 +1705,9 @@ (error 'load-system-definition-error :name name :pathname pathname :condition condition)))) - (let ((*package* package)) + (let ((*package* package) + (*default-pathname-defaults* + (pathname-directory-pathname pathname))) (asdf-message (compatfmt "~&~@<; ~@;Loading system definition from ~A into ~A~@:>~%") pathname package) (load pathname))) @@ -1851,7 +2020,7 @@ ;; e.g. LOAD-OP or LOAD-SOURCE-OP of some CL-SOURCE-FILE. (and op-time (>= op-time (latest-in)))) ((not in-files) - ;; an operation without output-files and no input-files + ;; an operation with output-files and no input-files ;; is probably meant for its side-effects on the file-system, ;; assumed to have to be done everytime. ;; (I don't think there is any such case in ASDF unless extended) @@ -1893,76 +2062,89 @@ (defgeneric* do-traverse (operation component collect)) -(defun* %do-one-dep (operation c collect required-op required-c required-v) - ;; collects a partial plan that results from performing required-op - ;; on required-c, possibly with a required-vERSION - (let* ((dep-c (or (let ((d (find-component (component-parent c) required-c))) - (and d (version-satisfies d required-v) d)) - (if required-v - (error 'missing-dependency-of-version - :required-by c - :version required-v - :requires required-c) - (error 'missing-dependency - :required-by c - :requires required-c)))) - (op (make-sub-operation c operation dep-c required-op))) - (do-traverse op dep-c collect))) - -(defun* do-one-dep (operation c collect required-op required-c required-v) - ;; this function is a thin, error-handling wrapper around %do-one-dep. - ;; Collects a partial plan per that function. +(defun* resolve-dependency-name (component name &optional version) (loop (restart-case - (return (%do-one-dep operation c collect - required-op required-c required-v)) + (return + (let ((comp (find-component (component-parent component) name))) + (unless comp + (error 'missing-dependency + :required-by component + :requires name)) + (when version + (unless (version-satisfies comp version) + (error 'missing-dependency-of-version + :required-by component + :version version + :requires name))) + comp)) (retry () :report (lambda (s) - (format s "~@" required-c)) + (format s "~@" name)) :test (lambda (c) (or (null c) (and (typep c 'missing-dependency) - (equalp (missing-requires c) - required-c)))))))) + (eq (missing-required-by c) component) + (equal (missing-requires c) name)))))))) + +(defun* resolve-dependency-spec (component dep-spec) + (cond + ((atom dep-spec) + (resolve-dependency-name component dep-spec)) + ;; Structured dependencies --- this parses keywords. + ;; The keywords could conceivably be broken out and cleanly (extensibly) + ;; processed by EQL methods. But for now, here's what we've got. + ((eq :version (first dep-spec)) + ;; https://bugs.launchpad.net/asdf/+bug/527788 + (resolve-dependency-name component (second dep-spec) (third dep-spec))) + ((eq :feature (first dep-spec)) + ;; This particular subform is not documented and + ;; has always been broken in the past. + ;; Therefore no one uses it, and I'm cerroring it out, + ;; after fixing it + ;; See https://bugs.launchpad.net/asdf/+bug/518467 + (cerror "Continue nonetheless." + "Congratulations, you're the first ever user of FEATURE dependencies! Please contact the asdf-devel mailing-list.") + (when (find (second dep-spec) *features* :test 'string-equal) + (resolve-dependency-name component (third dep-spec)))) + (t + (error (compatfmt "~@ ), (:feature ), or .~@:>") dep-spec)))) -(defun* do-dep (operation c collect op dep) - ;; type of arguments uncertain: - ;; op seems to at least potentially be a symbol, rather than an operation - ;; dep is a list of component names - (cond ((eq op 'feature) - (if (member (car dep) *features*) +(defun* do-one-dep (op c collect dep-op dep-c) + ;; Collects a partial plan for performing dep-op on dep-c + ;; as dependencies of a larger plan involving op and c. + ;; Returns t if this should force recompilation of those who depend on us. + ;; dep-op is an operation class name (not an operation object), + ;; whereas dep-c is a component object.n + (do-traverse (make-sub-operation c op dep-c dep-op) dep-c collect)) + +(defun* do-dep (op c collect dep-op-spec dep-c-specs) + ;; Collects a partial plan for performing dep-op-spec on each of dep-c-specs + ;; as dependencies of a larger plan involving op and c. + ;; Returns t if this should force recompilation of those who depend on us. + ;; dep-op-spec is either an operation class name (not an operation object), + ;; or the magic symbol asdf:feature. + ;; If dep-op-spec is asdf:feature, then the first dep-c-specs is a keyword, + ;; and the plan will succeed if that keyword is present in *feature*, + ;; or fail if it isn't + ;; (at which point c's :if-component-dep-fails will kick in). + ;; If dep-op-spec is an operation class name, + ;; then dep-c-specs specifies a list of sibling component of c, + ;; as per resolve-dependency-spec, such that operating op on c + ;; depends on operating dep-op-spec on each of them. + (cond ((eq dep-op-spec 'feature) + (if (member (car dep-c-specs) *features*) nil (error 'missing-dependency :required-by c - :requires (car dep)))) + :requires (list :feature (car dep-c-specs))))) (t (let ((flag nil)) - (flet ((dep (op comp ver) - (when (do-one-dep operation c collect - op comp ver) - (setf flag t)))) - (dolist (d dep) - (if (atom d) - (dep op d nil) - ;; structured dependencies --- this parses keywords - ;; the keywords could be broken out and cleanly (extensibly) - ;; processed by EQL methods - (cond ((eq :version (first d)) - ;; https://bugs.launchpad.net/asdf/+bug/527788 - (dep op (second d) (third d))) - ;; This particular subform is not documented and - ;; has always been broken in the past. - ;; Therefore no one uses it, and I'm cerroring it out, - ;; after fixing it - ;; See https://bugs.launchpad.net/asdf/+bug/518467 - ((eq :feature (first d)) - (cerror "Continue nonetheless." - "Congratulations, you're the first ever user of FEATURE dependencies! Please contact the asdf-devel mailing-list.") - (when (find (second d) *features* :test 'string-equal) - (dep op (third d) nil))) - (t - (error (compatfmt "~@), (:feature [version]), or a name.~@:>") d)))))) + (dolist (d dep-c-specs) + (when (do-one-dep op c collect dep-op-spec + (resolve-dependency-spec c d)) + (setf flag t))) flag)))) (defvar *visit-count* 0) ; counter that allows to sort nodes from operation-visited-nodes @@ -2087,6 +2269,35 @@ (declare (ignorable operation c)) nil) +(defmethod mark-operation-done ((operation operation) (c component)) + (setf (gethash (type-of operation) (component-operation-times c)) + (reduce #'max + (cons (get-universal-time) + (mapcar #'safe-file-write-date (input-files operation c)))))) + +(defmethod perform-with-restarts (operation component) + ;; TOO verbose, especially as the default. Add your own :before method + ;; to perform-with-restart or perform if you want that: + #|(when *asdf-verbose* (explain operation component))|# + (perform operation component)) + +(defmethod perform-with-restarts :around (operation component) + (loop + (restart-case + (return (call-next-method)) + (retry () + :report + (lambda (s) + (format s (compatfmt "~@") + (operation-description operation component)))) + (accept () + :report + (lambda (s) + (format s (compatfmt "~@") + (operation-description operation component))) + (mark-operation-done operation component) + (return))))) + (defmethod explain ((operation operation) (component component)) (asdf-message (compatfmt "~&~@<; ~@;~A~:>~%") (operation-description operation component))) @@ -2113,16 +2324,34 @@ (assert (length=n-p files 1)) (first files))) -(defmethod perform :before ((operation compile-op) (c source-file)) - (loop :for file :in (asdf:output-files operation c) - :for pathname = (if (typep file 'logical-pathname) - (translate-logical-pathname file) - file) +(defun* ensure-all-directories-exist (pathnames) + (loop :for pn :in pathnames + :for pathname = (if (typep pn 'logical-pathname) + (translate-logical-pathname pn) + pn) :do (ensure-directories-exist pathname))) +(defmethod perform :before ((operation compile-op) (c source-file)) + (ensure-all-directories-exist (asdf:output-files operation c))) + (defmethod perform :after ((operation operation) (c component)) - (setf (gethash (type-of operation) (component-operation-times c)) - (get-universal-time))) + (mark-operation-done operation c)) + +(defgeneric* around-compile-hook (component)) +(defgeneric* call-with-around-compile-hook (component thunk)) + +(defmethod around-compile-hook ((c component)) + (cond + ((slot-boundp c 'around-compile) + (slot-value c 'around-compile)) + ((component-parent c) + (around-compile-hook (component-parent c))))) + +(defmethod call-with-around-compile-hook ((c component) thunk) + (let ((hook (around-compile-hook c))) + (if hook + (funcall hook thunk) + (funcall thunk)))) (defvar *compile-op-compile-file-function* 'compile-file* "Function used to compile lisp files.") @@ -2138,8 +2367,10 @@ (*compile-file-warnings-behaviour* (operation-on-warnings operation)) (*compile-file-failure-behaviour* (operation-on-failure operation))) (multiple-value-bind (output warnings-p failure-p) - (apply *compile-op-compile-file-function* source-file - :output-file output-file (compile-op-flags operation)) + (call-with-around-compile-hook + c (lambda () + (apply *compile-op-compile-file-function* source-file + :output-file output-file (compile-op-flags operation)))) (unless output (error 'compile-error :component c :operation operation)) (when failure-p @@ -2191,54 +2422,19 @@ (defclass load-op (basic-load-op) ()) +(defmethod perform-with-restarts ((o load-op) (c cl-source-file)) + (loop + (restart-case + (return (call-next-method)) + (try-recompiling () + :report (lambda (s) + (format s "Recompile ~a and try loading it again" + (component-name c))) + (perform (make-sub-operation c o c 'compile-op) c))))) + (defmethod perform ((o load-op) (c cl-source-file)) (map () #'load (input-files o c))) -(defmethod perform-with-restarts (operation component) - ;;(when *asdf-verbose* (explain operation component)) ; TOO verbose, especially as the default. - (perform operation component)) - -(defmethod perform-with-restarts ((o load-op) (c cl-source-file)) - (declare (ignorable o)) - (loop :with state = :initial - :until (or (eq state :success) - (eq state :failure)) :do - (case state - (:recompiled - (setf state :failure) - (call-next-method) - (setf state :success)) - (:failed-load - (setf state :recompiled) - (perform (make-sub-operation c o c 'compile-op) c)) - (t - (with-simple-restart - (try-recompiling "Recompile ~a and try loading it again" - (component-name c)) - (setf state :failed-load) - (call-next-method) - (setf state :success)))))) - -(defmethod perform-with-restarts ((o compile-op) (c cl-source-file)) - (loop :with state = :initial - :until (or (eq state :success) - (eq state :failure)) :do - (case state - (:recompiled - (setf state :failure) - (call-next-method) - (setf state :success)) - (:failed-compile - (setf state :recompiled) - (perform-with-restarts o c)) - (t - (with-simple-restart - (try-recompiling "Try recompiling ~a" - (component-name c)) - (setf state :failed-compile) - (call-next-method) - (setf state :success)))))) - (defmethod perform ((operation load-op) (c static-file)) (declare (ignorable operation c)) nil) @@ -2280,7 +2476,7 @@ (declare (ignorable o)) (let ((source (component-pathname c))) (setf (component-property c 'last-loaded-as-source) - (and (load source) + (and (call-with-around-compile-hook c (lambda () (load source))) (get-universal-time))))) (defmethod perform ((operation load-source-op) (c static-file)) @@ -2371,25 +2567,7 @@ (*readtable* *readtable*)) (with-compilation-unit () (loop :for (op . component) :in steps :do - (loop - (restart-case - (progn - (perform-with-restarts op component) - (return)) - (retry () - :report - (lambda (s) - (format s (compatfmt "~@") - (operation-description op component)))) - (accept () - :report - (lambda (s) - (format s (compatfmt "~@") - (operation-description op component))) - (setf (gethash (type-of op) - (component-operation-times component)) - (get-universal-time)) - (return)))))))) + (perform-with-restarts op component))))) (defmethod operate (operation-class system &rest args &key ((:verbose *asdf-verbose*) *asdf-verbose*) version force @@ -2622,18 +2800,23 @@ weakly-depends-on depends-on serial in-order-to) rest)) - (ret - (or (find-component parent name) - (make-instance (class-for-type parent type))))) + (ret (find-component parent name))) (when weakly-depends-on (appendf depends-on (remove-if (complement #'find-system) weakly-depends-on))) (when *serial-depends-on* (push *serial-depends-on* depends-on)) - (apply 'reinitialize-instance ret - :name (coerce-name name) - :pathname pathname - :parent parent - other-args) + (if ret + (apply 'reinitialize-instance ret + :name (coerce-name name) + :pathname pathname + :parent parent + other-args) + (setf ret + (apply 'make-instance (class-for-type parent type) + :name (coerce-name name) + :pathname pathname + :parent parent + other-args))) (component-pathname ret) ; eagerly compute the absolute pathname (when (typep ret 'module) (setf (module-default-component-class ret) @@ -2660,7 +2843,7 @@ (setf (component-do-first ret) (union-of-dependencies do-first - `((compile-op (load-op , at depends-on))))) + `((compile-op (load-op , at depends-on))))) (%refresh-component-inline-methods ret rest) ret))) @@ -2706,11 +2889,25 @@ ;;;; gratefully accepted, if they do the same thing. ;;;; If the docstring is ambiguous, send a bug report. ;;;; +;;;; WARNING! The function below is mostly dysfunctional. +;;;; For instance, it will probably run fine on most implementations on Unix, +;;;; which will hopefully use the shell /bin/sh (which we force in some cases) +;;;; which is hopefully reasonably compatible with a POSIX *or* Bourne shell. +;;;; But behavior on Windows may vary wildly between implementations, +;;;; either relying on your having installed a POSIX sh, or going through +;;;; the CMD.EXE interpreter, for a totally different meaning, depending on +;;;; what is easily expressible in said implementation. +;;;; ;;;; We probably should move this functionality to its own system and deprecate ;;;; use of it from the asdf package. However, this would break unspecified ;;;; existing software, so until a clear alternative exists, we can't deprecate ;;;; it, and even after it's been deprecated, we will support it for a few ;;;; years so everyone has time to migrate away from it. -- fare 2009-12-01 +;;;; +;;;; As a suggested replacement which is portable to all ASDF-supported +;;;; implementations and operating systems except Genera, I recommend +;;;; xcvb-driver's xcvb-driver:run-program/process-output-stream and its +;;;; derivatives such as xcvb-driver:run-program/for-side-effects. (defun* run-shell-command (control-string &rest args) "Interpolate ARGS into CONTROL-STRING as if by FORMAT, and @@ -2726,44 +2923,57 @@ ;; will this fail if command has embedded quotes - it seems to work (multiple-value-bind (stdout stderr exit-code) (excl.osi:command-output - (format nil "~a -c \"~a\"" - #+mswindows "sh" #-mswindows "/bin/sh" command) + #-mswindows (vector "/bin/sh" "/bin/sh" "-c" command) + #+mswindows command ; BEWARE! :input nil :whole nil #+mswindows :show-window #+mswindows :hide) - (asdf-message "~{~&; ~a~%~}~%" stderr) - (asdf-message "~{~&; ~a~%~}~%" stdout) + (asdf-message "~{~&~a~%~}~%" stderr) + (asdf-message "~{~&~a~%~}~%" stdout) exit-code) - #+clisp ;XXX not exactly *verbose-out*, I know - (or (ext:run-shell-command command :output (and *verbose-out* :terminal) :wait t) 0) + #+clisp + ;; CLISP returns NIL for exit status zero. + (if *verbose-out* + (let* ((new-command (format nil "( ~A ) ; r=$? ; echo ; echo ASDF-EXIT-STATUS $r" + command)) + (outstream (ext:run-shell-command new-command :output :stream :wait t))) + (multiple-value-bind (retval out-lines) + (unwind-protect + (parse-clisp-shell-output outstream) + (ignore-errors (close outstream))) + (asdf-message "~{~&~a~%~}~%" out-lines) + retval)) + ;; there will be no output, just grab up the exit status + (or (ext:run-shell-command command :output nil :wait t) 0)) #+clozure (nth-value 1 (ccl:external-process-status - (ccl:run-program "/bin/sh" (list "-c" command) - :input nil :output *verbose-out* - :wait t))) + (ccl:run-program + (cond + ((os-unix-p) "/bin/sh") + ((os-windows-p) (format nil "CMD /C ~A" command)) ; BEWARE! + (t (error "Unsupported OS"))) + (if (os-unix-p) (list "-c" command) '()) + :input nil :output *verbose-out* :wait t))) #+(or cmu scl) (ext:process-exit-code (ext:run-program "/bin/sh" - (list "-c" command) + (list "-c" command) :input nil :output *verbose-out*)) #+ecl ;; courtesy of Juan Jose Garcia Ripoll - (si:system command) + (ext:system command) #+gcl (lisp:system command) #+lispworks - (system:call-system-showing-output - command - :shell-type "/bin/sh" - :show-cmd nil - :prefix "" - :output-stream *verbose-out*) + (apply 'system:call-system-showing-output command + :show-cmd nil :prefix "" :output-stream *verbose-out* + (when (os-unix-p) '(:shell-type "/bin/sh"))) #+mcl (ccl::with-cstrs ((%command command)) (_system %command)) @@ -2782,6 +2992,25 @@ #-(or abcl allegro clisp clozure cmu ecl gcl lispworks mcl sbcl scl xcl) (error "RUN-SHELL-COMMAND not implemented for this Lisp"))) +#+clisp +(defun* parse-clisp-shell-output (stream) + "Helper function for running shell commands under clisp. Parses a specially- +crafted output string to recover the exit status of the shell command and a +list of lines of output." + (loop :with status-prefix = "ASDF-EXIT-STATUS " + :with prefix-length = (length status-prefix) + :with exit-status = -1 :with lines = () + :for line = (read-line stream nil nil) + :while line :do (push line lines) :finally + (let* ((last (car lines)) + (status (and last (>= (length last) prefix-length) + (string-equal last status-prefix :end1 prefix-length) + (parse-integer last :start prefix-length :junk-allowed t)))) + (when status + (setf exit-status status) + (pop lines) (when (equal "" (car lines)) (pop lines))) + (return (values exit-status (reverse lines)))))) + ;;;; --------------------------------------------------------------------------- ;;;; system-relative-pathname @@ -2798,10 +3027,12 @@ if that's whay you mean." ;;) (system-source-file x)) +(defmethod system-source-file ((system system)) + (%system-source-file system)) (defmethod system-source-file ((system-name string)) - (system-source-file (find-system system-name))) + (%system-source-file (find-system system-name))) (defmethod system-source-file ((system-name symbol)) - (system-source-file (find-system system-name))) + (%system-source-file (find-system system-name))) (defun* system-source-directory (system-designator) "Return a pathname object corresponding to the @@ -2866,33 +3097,34 @@ (defparameter *lisp-version-string* (let ((s (lisp-implementation-version))) - (or - #+allegro - (format nil "~A~A~@[~A~]" - excl::*common-lisp-version-number* - ;; ANSI vs MoDeRn - thanks to Robert Goldman and Charley Cox - (if (eq excl:*current-case-mode* :case-sensitive-lower) "M" "A") - ;; Note if not using International ACL - ;; see http://www.franz.com/support/documentation/8.1/doc/operators/excl/ics-target-case.htm - (excl:ics-target-case (:-ics "8"))) - #+armedbear (format nil "~a-fasl~a" s system::*fasl-version*) - #+clisp - (subseq s 0 (position #\space s)) ; strip build information (date, etc.) - #+clozure - (format nil "~d.~d-f~d" ; shorten for windows - ccl::*openmcl-major-version* - ccl::*openmcl-minor-version* - (logand ccl::fasl-version #xFF)) - #+cmu (substitute #\- #\/ s) - #+ecl (format nil "~A~@[-~A~]" s - (let ((vcs-id (ext:lisp-implementation-vcs-id))) - (subseq vcs-id 0 (min (length vcs-id) 8)))) - #+gcl (subseq s (1+ (position #\space s))) - #+genera - (multiple-value-bind (major minor) (sct:get-system-version "System") - (format nil "~D.~D" major minor)) - #+mcl (subseq s 8) ; strip the leading "Version " - s))) + (car + (list + #+allegro + (format nil "~A~A~@[~A~]" + excl::*common-lisp-version-number* + ;; ANSI vs MoDeRn - thanks to Robert Goldman and Charley Cox + (if (eq excl:*current-case-mode* :case-sensitive-lower) "M" "A") + ;; Note if not using International ACL + ;; see http://www.franz.com/support/documentation/8.1/doc/operators/excl/ics-target-case.htm + (excl:ics-target-case (:-ics "8"))) + #+armedbear (format nil "~a-fasl~a" s system::*fasl-version*) + #+clisp + (subseq s 0 (position #\space s)) ; strip build information (date, etc.) + #+clozure + (format nil "~d.~d-f~d" ; shorten for windows + ccl::*openmcl-major-version* + ccl::*openmcl-minor-version* + (logand ccl::fasl-version #xFF)) + #+cmu (substitute #\- #\/ s) + #+ecl (format nil "~A~@[-~A~]" s + (let ((vcs-id (ext:lisp-implementation-vcs-id))) + (subseq vcs-id 0 (min (length vcs-id) 8)))) + #+gcl (subseq s (1+ (position #\space s))) + #+genera + (multiple-value-bind (major minor) (sct:get-system-version "System") + (format nil "~D.~D" major minor)) + #+mcl (subseq s 8) ; strip the leading "Version " + s)))) (defun* implementation-type () *implementation-type*) @@ -2901,7 +3133,7 @@ (substitute-if #\_ #'(lambda (x) (find x " /:;&^\\|?<>(){}[]$#`'\"")) (format nil "~(~a~@{~@[-~a~]~}~)" - (or *implementation-type* (lisp-implementation-type)) + (or *implementation-type* (lisp-implementation-type)) (or *lisp-version-string* (lisp-implementation-version)) (or *operating-system* (software-type)) (or *architecture* (machine-type))))) @@ -2910,9 +3142,8 @@ ;;; --------------------------------------------------------------------------- ;;; Generic support for configuration files -(defparameter *inter-directory-separator* - #+asdf-unix #\: - #-asdf-unix #\;) +(defun inter-directory-separator () + (if (os-unix-p) #\: #\;)) (defun* user-homedir () (truenamize @@ -2933,27 +3164,28 @@ ,@(loop :with dirs = (getenv "XDG_CONFIG_DIRS") :for dir :in (split-string dirs :separator ":") :collect (try dir "common-lisp/")) - #+asdf-windows - ,@`(,(try (or #+lispworks (sys:get-folder-path :local-appdata) - (getenv "LOCALAPPDATA")) - "common-lisp/config/") - ;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData - ,(try (or #+lispworks (sys:get-folder-path :appdata) - (getenv "APPDATA")) - "common-lisp/config/")) + ,@(when (os-windows-p) + `(,(try (or #+lispworks (sys:get-folder-path :local-appdata) + (getenv "LOCALAPPDATA")) + "common-lisp/config/") + ;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData + ,(try (or #+lispworks (sys:get-folder-path :appdata) + (getenv "APPDATA")) + "common-lisp/config/"))) ,(try (user-homedir) ".config/common-lisp/"))))) (remove-duplicates (remove-if #'null dirs) :from-end t :test 'equal))) (defun* system-configuration-directories () - (remove-if - #'null - `(#+asdf-windows - ,(flet ((try (x sub) (try-directory-subpath x sub))) + (cond + ((os-unix-p) '(#p"/etc/common-lisp/")) + ((os-windows-p) + (aif + (flet ((try (x sub) (try-directory-subpath x sub))) ;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Common AppData (try (or #+lispworks (sys:get-folder-path :common-appdata) (getenv "ALLUSERSAPPDATA") (try (getenv "ALLUSERSPROFILE") "Application Data/")) "common-lisp/config/")) - #+asdf-unix #p"/etc/common-lisp/"))) + (list it))))) (defun* in-first-directory (dirs x) (loop :for dir :in dirs @@ -3072,12 +3304,12 @@ (flet ((try (x &rest sub) (and x `(,x , at sub)))) (or (try (getenv "XDG_CACHE_HOME") "common-lisp" :implementation) - #+asdf-windows - (try (or #+lispworks (sys:get-folder-path :local-appdata) - (getenv "LOCALAPPDATA") - #+lispworks (sys:get-folder-path :appdata) - (getenv "APPDATA")) - "common-lisp" "cache" :implementation) + (when (os-windows-p) + (try (or #+lispworks (sys:get-folder-path :local-appdata) + (getenv "LOCALAPPDATA") + #+lispworks (sys:get-folder-path :appdata) + (getenv "APPDATA")) + "common-lisp" "cache" :implementation)) '(:home ".cache" "common-lisp" :implementation)))) (defun* output-translations () @@ -3204,8 +3436,7 @@ (relative-component-p (c) (typep c '(or string pathname (member :default-directory :*/ :**/ :*.*.* - :implementation :implementation-type - #+asdf-unix :uid))))) + :implementation :implementation-type))))) (or (typep x 'boolean) (absolute-component-p x) (and (consp x) (absolute-component-p (first x)) (every #'relative-component-p (rest x)))))) @@ -3265,7 +3496,8 @@ :with start = 0 :with end = (length string) :with source = nil - :for i = (or (position *inter-directory-separator* string :start start) end) :do + :with separator = (inter-directory-separator) + :for i = (or (position separator string :start start) end) :do (let ((s (subseq string start i))) (cond (source @@ -3579,81 +3811,6 @@ :ignore-inherited-configuration)))) ;;;; ----------------------------------------------------------------- -;;;; Windows shortcut support. Based on: -;;;; -;;;; Jesse Hager: The Windows Shortcut File Format. -;;;; http://www.wotsit.org/list.asp?fc=13 - -#+(and asdf-windows (not clisp)) -(progn -(defparameter *link-initial-dword* 76) -(defparameter *link-guid* #(1 20 2 0 0 0 0 0 192 0 0 0 0 0 0 70)) - -(defun* read-null-terminated-string (s) - (with-output-to-string (out) - (loop :for code = (read-byte s) - :until (zerop code) - :do (write-char (code-char code) out)))) - -(defun* read-little-endian (s &optional (bytes 4)) - (loop :for i :from 0 :below bytes - :sum (ash (read-byte s) (* 8 i)))) - -(defun* parse-file-location-info (s) - (let ((start (file-position s)) - (total-length (read-little-endian s)) - (end-of-header (read-little-endian s)) - (fli-flags (read-little-endian s)) - (local-volume-offset (read-little-endian s)) - (local-offset (read-little-endian s)) - (network-volume-offset (read-little-endian s)) - (remaining-offset (read-little-endian s))) - (declare (ignore total-length end-of-header local-volume-offset)) - (unless (zerop fli-flags) - (cond - ((logbitp 0 fli-flags) - (file-position s (+ start local-offset))) - ((logbitp 1 fli-flags) - (file-position s (+ start - network-volume-offset - #x14)))) - (concatenate 'string - (read-null-terminated-string s) - (progn - (file-position s (+ start remaining-offset)) - (read-null-terminated-string s)))))) - -(defun* parse-windows-shortcut (pathname) - (with-open-file (s pathname :element-type '(unsigned-byte 8)) - (handler-case - (when (and (= (read-little-endian s) *link-initial-dword*) - (let ((header (make-array (length *link-guid*)))) - (read-sequence header s) - (equalp header *link-guid*))) - (let ((flags (read-little-endian s))) - (file-position s 76) ;skip rest of header - (when (logbitp 0 flags) - ;; skip shell item id list - (let ((length (read-little-endian s 2))) - (file-position s (+ length (file-position s))))) - (cond - ((logbitp 1 flags) - (parse-file-location-info s)) - (t - (when (logbitp 2 flags) - ;; skip description string - (let ((length (read-little-endian s 2))) - (file-position s (+ length (file-position s))))) - (when (logbitp 3 flags) - ;; finally, our pathname - (let* ((length (read-little-endian s 2)) - (buffer (make-array length))) - (read-sequence buffer s) - (map 'string #'code-char buffer))))))) - (end-of-file () - nil))))) - -;;;; ----------------------------------------------------------------- ;;;; Source Registry Configuration, by Francois-Rene Rideau ;;;; See the Manual and https://bugs.launchpad.net/asdf/+bug/485918 @@ -3813,7 +3970,8 @@ :with directives = () :with start = 0 :with end = (length string) - :for pos = (position *inter-directory-separator* string :start start) :do + :with separator = (inter-directory-separator) + :for pos = (position separator string :start start) :do (let ((s (subseq string start (or pos end)))) (flet ((check (dir) (unless (absolute-pathname-p dir) @@ -3866,20 +4024,20 @@ #+sbcl (:directory ,(try (user-homedir) ".sbcl/systems/")) (:directory ,(default-directory)) ,@(loop :for dir :in - `(#+asdf-unix - ,@`(,(or (getenv "XDG_DATA_HOME") - (try (user-homedir) ".local/share/")) - ,@(split-string (or (getenv "XDG_DATA_DIRS") - "/usr/local/share:/usr/share") - :separator ":")) - #+asdf-windows - ,@`(,(or #+lispworks (sys:get-folder-path :local-appdata) - (getenv "LOCALAPPDATA")) - ,(or #+lispworks (sys:get-folder-path :appdata) - (getenv "APPDATA")) - ,(or #+lispworks (sys:get-folder-path :common-appdata) - (getenv "ALLUSERSAPPDATA") - (try (getenv "ALLUSERSPROFILE") "Application Data/")))) + `(,@(when (os-unix-p) + `(,(or (getenv "XDG_DATA_HOME") + (try (user-homedir) ".local/share/")) + ,@(split-string (or (getenv "XDG_DATA_DIRS") + "/usr/local/share:/usr/share") + :separator ":"))) + ,@(when (os-windows-p) + `(,(or #+lispworks (sys:get-folder-path :local-appdata) + (getenv "LOCALAPPDATA")) + ,(or #+lispworks (sys:get-folder-path :appdata) + (getenv "APPDATA")) + ,(or #+lispworks (sys:get-folder-path :common-appdata) + (getenv "ALLUSERSAPPDATA") + (try (getenv "ALLUSERSPROFILE") "Application Data/"))))) :collect `(:directory ,(try dir "common-lisp/systems/")) :collect `(:tree ,(try dir "common-lisp/source/"))) :inherit-configuration))) @@ -4041,29 +4199,36 @@ ;;; #+ecl (progn - (setf *compile-op-compile-file-function* - (lambda (input-file &rest keys &key output-file &allow-other-keys) - (declare (ignore output-file)) - (multiple-value-bind (object-file flags1 flags2) - (apply 'compile-file* input-file :system-p t keys) - (values (and object-file - (c::build-fasl (compile-file-pathname object-file :type :fasl) - :lisp-files (list object-file)) - object-file) - flags1 - flags2)))) + (setf *compile-op-compile-file-function* 'ecl-compile-file) + + (defun use-ecl-byte-compiler-p () + (member :ecl-bytecmp *features*)) + + (defun ecl-compile-file (input-file &rest keys &key &allow-other-keys) + (if (use-ecl-byte-compiler-p) + (apply 'compile-file* input-file keys) + (multiple-value-bind (object-file flags1 flags2) + (apply 'compile-file* input-file :system-p t keys) + (values (and object-file + (c::build-fasl (compile-file-pathname object-file :type :fasl) + :lisp-files (list object-file)) + object-file) + flags1 + flags2)))) (defmethod output-files ((operation compile-op) (c cl-source-file)) (declare (ignorable operation)) - (let ((p (lispize-pathname (component-pathname c)))) - (list (compile-file-pathname p :type :object) - (compile-file-pathname p :type :fasl)))) + (let* ((p (lispize-pathname (component-pathname c))) + (f (compile-file-pathname p :type :fasl))) + (if (use-ecl-byte-compiler-p) + (list f) + (list (compile-file-pathname p :type :object) f)))) (defmethod perform ((o load-op) (c cl-source-file)) (map () #'load (loop :for i :in (input-files o c) :unless (string= (pathname-type i) "fas") - :collect (compile-file-pathname (lispize-pathname i)))))) + :collect (compile-file-pathname (lispize-pathname i)))))) ;;;; ----------------------------------------------------------------- ;;;; Hook into REQUIRE for ABCL, CLISP, ClozureCL, CMUCL, ECL and SBCL @@ -4090,8 +4255,7 @@ #+abcl sys::*module-provider-functions* #+clisp ,x #+clozure ccl:*module-provider-functions* - #+cmu ext:*module-provider-functions* - #+ecl si:*module-provider-functions* + #+(or cmu ecl) ext:*module-provider-functions* #+sbcl sb-ext:*module-provider-functions*)))) From mevenson at common-lisp.net Fri Oct 21 20:59:03 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 13:59:03 -0700 Subject: [armedbear-cvs] r13656 - in branches/1.0.x/abcl: doc/asdf src/org/armedbear/lisp Message-ID: Author: mevenson Date: Fri Oct 21 13:59:01 2011 New Revision: 13656 Log: Upgrade to ASDF 2.0.17.022 Modified: branches/1.0.x/abcl/doc/asdf/asdf.texinfo branches/1.0.x/abcl/src/org/armedbear/lisp/asdf.lisp Modified: branches/1.0.x/abcl/doc/asdf/asdf.texinfo ============================================================================== --- branches/1.0.x/abcl/doc/asdf/asdf.texinfo Fri Oct 21 13:55:25 2011 (r13655) +++ branches/1.0.x/abcl/doc/asdf/asdf.texinfo Fri Oct 21 13:59:01 2011 (r13656) @@ -517,7 +517,7 @@ @section Configuring where ASDF stores object files - at findex clear-output-locations + at findex clear-output-translations ASDF lets you configure where object files will be stored. Sensible defaults are provided and @@ -596,6 +596,33 @@ @node Using ASDF, Defining systems with defsystem, Configuring ASDF, Top @comment node-name, next, previous, up + + at section Resetting Configuration + +When you dump and restore an image, or when you tweak your configuration, +you may want to reset the ASDF configuration. +For that you may use the following function: + + at defun clear-configuration + undoes any ASDF configuration, + regarding source-registry or output-translations. + at end defun + +If you use SBCL, CMUCL or SCL, you may use this snippet +so that the ASDF configuration be cleared automatically as you dump an image: + + at example +#+(or cmu sbcl scl) +(pushnew 'clear-configuration + #+(or cmu scl) ext:*before-save-initializations* + #+sbcl sb-ext:*save-hooks*) + at end example + +For compatibility with all Lisp implementations, however, +you might want instead your build script to explicitly call + at code{(asdf:clear-configuration)} at an appropriate moment before dumping. + + @chapter Using ASDF @section Loading a system @@ -1210,6 +1237,7 @@ @menu * Operations:: * Components:: +* Functions:: @end menu @node Operations, Components, The object model of ASDF, The object model of ASDF @@ -1410,7 +1438,7 @@ Operations that print output should send that output to the standard CL stream @code{*standard-output*}, as the Lisp compiler and loader do. - at node Components, , Operations, The object model of ASDF + at node Components, Functions, Operations, The object model of ASDF @comment node-name, next, previous, up @section Components @cindex component @@ -1573,11 +1601,14 @@ @verbatim (this-op {(other-op required-components)}+) -required-components := component-name +simple-component-name := string + | symbol + +required-components := simple-component-name | (required-components required-components) -component-name := string - | (:version string minimum-version-object) +component-name := simple-component-name + | (:version simple-component-name minimum-version-object) @end verbatim Side note: @@ -1788,6 +1819,25 @@ ) @end lisp + at node Functions, , Components, The object model of ASDF + at comment node-name, next, previous, up + at section Functions + at findex version-satisfies + + at deffn version-satisfies @var{version} @var{version-spec} +Does @var{version} satisfy the @var{version-spec}. A generic function. +ASDF provides built-in methods for @var{version} being a + at code{component} or @code{string}. @var{version-spec} should be a +string. + +In the wild, we typically see version numbering only on components of +type @code{system}. + +For more information about how @code{version-satisfies} interprets +version strings and specifications, @pxref{The defsystem grammar} and + at ref{Common attributes of components}. + at end deffn + @node Controlling where ASDF searches for systems, Controlling where ASDF saves compiled files, The object model of ASDF, Top @comment node-name, next, previous, up @chapter Controlling where ASDF searches for systems @@ -2774,10 +2824,37 @@ @comment node-name, next, previous, up @chapter Miscellaneous additional functionality - at emph{FIXME: Add discussion of @code{run-shell-command}? Others?} - ASDF includes several additional features that are generally -useful for system definition and development. These include: +useful for system definition and development. + + at section Controlling file compilation + +When declaring a component (system, module, file), +you can specify a keyword argument @code{:around-compile some-symbol}. +If left unspecified, the value will be inherited from the parent component if any, +or with a default of @code{nil} if no value is specified in any transitive parent. + +The argument must be a either fbound symbol or @code{nil}. + at code{nil} means the normal compile-file function will be called. +A symbol means the function fbound to it will be called with a single argument, +a thunk that calls the compile-file function; +the function you specify must then funcall that thunk +inside whatever wrapping you want. + +Using this hook, you may achieve such effects as: +locally renaming packages, +binding @var{*readtables*} and other syntax-controlling variables, +handling warnings and other conditions, +proclaiming consistent optimization settings, +saving code coverage information, +maintaining meta-data about compilation timings, +setting gensym counters and PRNG seeds and other sources of non-determinism, +overriding the source-location and/or timestamping systems, +checking that some compile-time side-effects were properly balanced, +etc. + + + at section Miscellaneous Exported Functions @defun coerce-pathname name @&key type defaults @@ -2872,6 +2949,33 @@ look at the beginning of @file{asdf.lisp} to see what it does. @end defun + at defun run-shell-command + +This function is obsolete and present only for the sake of backwards-compatibility: +``If it's not backwards, it's not compatible''. We strongly discourage its use. +Its current behavior is only well-defined on Unix platforms +(which includes MacOS X and cygwin). On Windows, anything goes. + +Instead we recommend the use of such a function as + at code{xcvb-driver:run-program/process-output-stream} +from the @code{xcvb-driver} system that is distributed with XCVB: + at url{http://common-lisp.net/project/xcvb}. +It's only alternative that supports +as many implementations and operating systems as ASDF does, +and provides well-defined behavior outside Unix (i.e. on Windows). +(The only unsupported exception is Genera, since on it + at code{run-shell-command} doesn't make sense anyway on that platform). + +This function takes as arguments a @code{format} control-string +and arguments to be passed to @code{format} after this control-string +to produce a string. +This string is a command that will be evaluated with a POSIX shell if possible; +yet, on Windows, some implementations will use CMD.EXE, +while others (like SBCL) will make an attempt at invoking a POSIX shell +(and fail if it is not present). + at end defun + + @node Getting the latest version, FAQ, Miscellaneous additional functionality, Top @comment node-name, next, previous, up @chapter Getting the latest version Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/asdf.lisp ============================================================================== --- branches/1.0.x/abcl/src/org/armedbear/lisp/asdf.lisp Fri Oct 21 13:55:25 2011 (r13655) +++ branches/1.0.x/abcl/src/org/armedbear/lisp/asdf.lisp Fri Oct 21 13:59:01 2011 (r13656) @@ -1,5 +1,5 @@ -;;; -*- mode: common-lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- -;;; This is ASDF 2.017: Another System Definition Facility. +;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- +;;; This is ASDF 2.017.22: Another System Definition Facility. ;;; ;;; Feedback, bug reports, and patches are all welcome: ;;; please mail to . @@ -61,14 +61,12 @@ (setf excl::*autoload-package-name-alist* (remove "asdf" excl::*autoload-package-name-alist* :test 'equalp :key 'car)) ; need that BEFORE any mention of package ASDF as below - #+(and ecl (not ecl-bytecmp)) (require :cmp) + #+ecl (unless (member :ecl-bytecmp *features*) (require :cmp)) #+gcl ;; Debian's GCL 2.7 has bugs with compiling multiple-value stuff, but can run ASDF 2.011 (when (or (< system::*gcl-major-version* 2) ;; GCL 2.6 fails to fully compile ASDF at all (and (= system::*gcl-major-version* 2) (< system::*gcl-minor-version* 7))) (pushnew :gcl-pre2.7 *features*)) - #+(and (or win32 windows mswindows mingw32) (not cygwin)) (pushnew :asdf-windows *features*) - #+(or unix cygwin) (pushnew :asdf-unix *features*) ;;; make package if it doesn't exist yet. ;;; DEFPACKAGE may cause errors on discrepancies, so we avoid it. (unless (find-package :asdf) @@ -112,7 +110,7 @@ ;; "2.345.6" would be a development version in the official upstream ;; "2.345.0.7" would be your seventh local modification of official release 2.345 ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6 - (asdf-version "2.017") + (asdf-version "2.017.22") (existing-asdf (find-class 'component nil)) (existing-version *asdf-version*) (already-there (equal asdf-version existing-version))) @@ -200,23 +198,22 @@ :do (unintern old user))) (loop :for x :in newly-exported-symbols :do (export (intern* x package))))) - (ensure-package (name &key nicknames use unintern fmakunbound - shadow export redefined-functions) + (ensure-package (name &key nicknames use unintern + shadow export redefined-functions) (let* ((p (ensure-exists name nicknames use))) (ensure-unintern p unintern) (ensure-shadow p shadow) (ensure-export p export) - (ensure-fmakunbound p (append fmakunbound redefined-functions)) + (ensure-fmakunbound p redefined-functions) p))) (macrolet ((pkgdcl (name &key nicknames use export - redefined-functions unintern fmakunbound shadow) + redefined-functions unintern shadow) `(ensure-package ',name :nicknames ',nicknames :use ',use :export ',export :shadow ',shadow :unintern ',unintern - :redefined-functions ',redefined-functions - :fmakunbound ',fmakunbound))) + :redefined-functions ',redefined-functions))) (pkgdcl :asdf :nicknames (:asdf-utilities) ;; DEPRECATED! Do not use, for backward compatibility only. @@ -226,16 +223,14 @@ #:perform-with-restarts #:component-relative-pathname #:system-source-file #:operate #:find-component #:find-system #:apply-output-translations #:translate-pathname* #:resolve-location + #:system-relative-pathname + #:inherit-source-registry #:process-source-registry + #:process-source-registry-directive #:compile-file* #:source-file-type) :unintern (#:*asdf-revision* #:around #:asdf-method-combination #:split #:make-collector #:output-files-for-system-and-operation) ; obsolete ASDF-BINARY-LOCATION function - :fmakunbound - (#:system-source-file - #:component-relative-pathname #:system-relative-pathname - #:process-source-registry - #:inherit-source-registry #:process-source-registry-directive) :export (#:defsystem #:oos #:operate #:find-system #:run-shell-command #:system-definition-pathname #:with-system-definitions @@ -298,7 +293,9 @@ #:*compile-file-warnings-behaviour* #:*compile-file-failure-behaviour* #:*resolve-symlinks* + #:*require-asdf-operator* #:*asdf-verbose* + #:*verbose-out* #:asdf-version @@ -675,7 +672,7 @@ (defun* getenv (x) (declare (ignorable x)) - #+(or abcl clisp xcl) (ext:getenv x) + #+(or abcl clisp ecl xcl) (ext:getenv x) #+allegro (sys:getenv x) #+clozure (ccl:getenv x) #+(or cmu scl) (cdr (assoc x ext:*environment-list* :test #'string=)) @@ -689,7 +686,6 @@ (ct:c-string-to-lisp-string buffer1)) (ct:free buffer) (ct:free buffer1))) - #+ecl (si:getenv x) #+gcl (system:getenv x) #+genera nil #+lispworks (lispworks:environment-variable x) @@ -922,6 +918,7 @@ (defgeneric* perform-with-restarts (operation component)) (defgeneric* perform (operation component)) (defgeneric* operation-done-p (operation component)) +(defgeneric* mark-operation-done (operation component)) (defgeneric* explain (operation component)) (defgeneric* output-files (operation component)) (defgeneric* input-files (operation component)) @@ -1166,14 +1163,55 @@ ;; no direct accessor for pathname, we do this as a method to allow ;; it to default in funky ways if not supplied (relative-pathname :initarg :pathname) + ;; the absolute-pathname is computed based on relative-pathname... (absolute-pathname) (operation-times :initform (make-hash-table) :accessor component-operation-times) + (around-compile :initarg :around-compile) ;; XXX we should provide some atomic interface for updating the ;; component properties (properties :accessor component-properties :initarg :properties :initform nil))) +;;; I believe that the following could probably be more efficiently done +;;; by a primary method that invokes SHARED-INITIALIZE in a way that would +;;; appropriately pass the slots to have their initforms re-applied, but I +;;; do not know how to write such a method. [2011/09/02:rpg] +(defmethod reinitialize-instance :after ((obj component) &rest initargs + &key (version nil version-suppliedp) + (description nil description-suppliedp) + (long-description nil + long-description-suppliedp) + (load-dependencies nil + ld-suppliedp) + in-order-to + do-first + inline-methods + parent + properties) + "We reuse component objects from previously-existing systems, so we need to +make sure we clear them thoroughly." + (declare (ignore initargs load-dependencies + long-description description version)) + ;; this is a cache and should be cleared + (slot-makunbound obj 'absolute-pathname) + ;; component operation times are no longer valid when the component changes + (clrhash (component-operation-times obj)) + (unless version-suppliedp (slot-makunbound obj 'version)) + (unless description-suppliedp + (slot-makunbound obj 'description)) + (unless long-description-suppliedp + (slot-makunbound obj 'long-description)) + ;; replicate the logic of the initforms... + (unless ld-suppliedp + (setf (component-load-dependencies obj) nil)) + (setf (component-in-order-to obj) in-order-to + (component-do-first obj) do-first + (component-inline-methods obj) inline-methods + (slot-value obj 'parent) parent + (slot-value obj 'properties) properties)) + + (defun* component-find-path (component) (reverse (loop :for c = component :then (component-parent c) @@ -1246,6 +1284,21 @@ :initarg :default-component-class :accessor module-default-component-class))) +;;; see comment with REINITIALIZE-INSTANCE method on COMPONENT +;;; [2011/09/02:rpg] +(defmethod reinitialize-instance :after ((obj module) &rest initargs &key) + "Clear MODULE's slots so it can be reused." + (slot-makunbound obj 'components-by-name) + ;; this may be a more elegant approach than in the + ;; COMPONENT method [2011/09/02:rpg] + (loop :for (initarg slot-name default) :in + `((:components components nil) + (:if-component-dep-fails if-component-dep-fails :fail) + (:default-component-class default-component-class + ,*default-component-class*)) + :unless (member initarg initargs) + :do (setf (slot-value obj slot-name) default))) + (defun* component-parent-pathname (component) ;; No default anymore (in particular, no *default-pathname-defaults*). ;; If you force component to have a NULL pathname, you better arrange @@ -1288,10 +1341,28 @@ (maintainer :accessor system-maintainer :initarg :maintainer) (licence :accessor system-licence :initarg :licence :accessor system-license :initarg :license) - (source-file :reader system-source-file :initarg :source-file + (source-file :reader %system-source-file :initarg :source-file ; for CLISP upgrade :writer %set-system-source-file) (defsystem-depends-on :reader system-defsystem-depends-on :initarg :defsystem-depends-on))) +;;; see comment with REINITIALIZE-INSTANCE method on COMPONENT +;;; [2011/09/02:rpg] +(defmethod reinitialize-instance :after ((obj system) &rest initargs &key) + "Clear SYSTEM's slots so it can be reused." + ;; note that SYSTEM-SOURCE-FILE is very specially handled, + ;; by DO-DEFSYSTEM, so we need to *PRESERVE* its value and + ;; not squash it. SYSTEM COMPONENTS are handled very specially, + ;; because they are always, effectively, reused, since the system component + ;; is made early in DO-DEFSYSTEM, instead of being made later, in + ;; PARSE-COMPONENT-FORM [2011/09/02:rpg] + (loop :for (initarg slot-name) :in + `((:author author) + (:maintainer maintainer) + (:licence licence) + (:defsystem-depends-on defsystem-depends-on)) + :unless (member initarg initargs) + :do (slot-makunbound obj slot-name))) + ;;;; ------------------------------------------------------------------------- ;;;; version-satisfies @@ -1340,6 +1411,81 @@ (and x y (= (car x) (car y)) (or (not (cdr y)) (bigger (cdr x) (cdr y))))))) +;;;; ----------------------------------------------------------------- +;;;; Windows shortcut support. Based on: +;;;; +;;;; Jesse Hager: The Windows Shortcut File Format. +;;;; http://www.wotsit.org/list.asp?fc=13 + +#-clisp +(progn +(defparameter *link-initial-dword* 76) +(defparameter *link-guid* #(1 20 2 0 0 0 0 0 192 0 0 0 0 0 0 70)) + +(defun* read-null-terminated-string (s) + (with-output-to-string (out) + (loop :for code = (read-byte s) + :until (zerop code) + :do (write-char (code-char code) out)))) + +(defun* read-little-endian (s &optional (bytes 4)) + (loop :for i :from 0 :below bytes + :sum (ash (read-byte s) (* 8 i)))) + +(defun* parse-file-location-info (s) + (let ((start (file-position s)) + (total-length (read-little-endian s)) + (end-of-header (read-little-endian s)) + (fli-flags (read-little-endian s)) + (local-volume-offset (read-little-endian s)) + (local-offset (read-little-endian s)) + (network-volume-offset (read-little-endian s)) + (remaining-offset (read-little-endian s))) + (declare (ignore total-length end-of-header local-volume-offset)) + (unless (zerop fli-flags) + (cond + ((logbitp 0 fli-flags) + (file-position s (+ start local-offset))) + ((logbitp 1 fli-flags) + (file-position s (+ start + network-volume-offset + #x14)))) + (concatenate 'string + (read-null-terminated-string s) + (progn + (file-position s (+ start remaining-offset)) + (read-null-terminated-string s)))))) + +(defun* parse-windows-shortcut (pathname) + (with-open-file (s pathname :element-type '(unsigned-byte 8)) + (handler-case + (when (and (= (read-little-endian s) *link-initial-dword*) + (let ((header (make-array (length *link-guid*)))) + (read-sequence header s) + (equalp header *link-guid*))) + (let ((flags (read-little-endian s))) + (file-position s 76) ;skip rest of header + (when (logbitp 0 flags) + ;; skip shell item id list + (let ((length (read-little-endian s 2))) + (file-position s (+ length (file-position s))))) + (cond + ((logbitp 1 flags) + (parse-file-location-info s)) + (t + (when (logbitp 2 flags) + ;; skip description string + (let ((length (read-little-endian s 2))) + (file-position s (+ length (file-position s))))) + (when (logbitp 3 flags) + ;; finally, our pathname + (let* ((length (read-little-endian s 2)) + (buffer (make-array length))) + (read-sequence buffer s) + (map 'string #'code-char buffer))))))) + (end-of-file () + nil))))) + ;;;; ------------------------------------------------------------------------- ;;;; Finding systems @@ -1420,6 +1566,26 @@ Going forward, we recommend new users should be using the source-registry. ") +(defun* featurep (x &optional (features *features*)) + (cond + ((atom x) + (and (member x features) t)) + ((eq 'not (car x)) + (assert (null (cddr x))) + (not (featurep (cadr x) features))) + ((eq 'or (car x)) + (some #'(lambda (x) (featurep x features)) (cdr x))) + ((eq 'and (car x)) + (every #'(lambda (x) (featurep x features)) (cdr x))) + (t + (error "Malformed feature specification ~S" x)))) + +(defun* os-unix-p () + (featurep '(or :unix :cygwin :darwin))) + +(defun* os-windows-p () + (and (not (os-unix-p)) (featurep '(or :win32 :windows :mswindows :mingw32)))) + (defun* probe-asd (name defaults) (block nil (when (directory-pathname-p defaults) @@ -1428,16 +1594,17 @@ :version :newest :case :local :type "asd"))) (when (probe-file* file) (return file))) - #+(and asdf-windows (not clisp)) - (let ((shortcut - (make-pathname - :defaults defaults :version :newest :case :local - :name (concatenate 'string name ".asd") - :type "lnk"))) - (when (probe-file* shortcut) - (let ((target (parse-windows-shortcut shortcut))) - (when target - (return (pathname target))))))))) + #-clisp + (when (os-windows-p) + (let ((shortcut + (make-pathname + :defaults defaults :version :newest :case :local + :name (concatenate 'string name ".asd") + :type "lnk"))) + (when (probe-file* shortcut) + (let ((target (parse-windows-shortcut shortcut))) + (when target + (return (pathname target)))))))))) (defun* sysdef-central-registry-search (system) (let ((name (coerce-name system)) @@ -1538,7 +1705,9 @@ (error 'load-system-definition-error :name name :pathname pathname :condition condition)))) - (let ((*package* package)) + (let ((*package* package) + (*default-pathname-defaults* + (pathname-directory-pathname pathname))) (asdf-message (compatfmt "~&~@<; ~@;Loading system definition from ~A into ~A~@:>~%") pathname package) (load pathname))) @@ -1851,7 +2020,7 @@ ;; e.g. LOAD-OP or LOAD-SOURCE-OP of some CL-SOURCE-FILE. (and op-time (>= op-time (latest-in)))) ((not in-files) - ;; an operation without output-files and no input-files + ;; an operation with output-files and no input-files ;; is probably meant for its side-effects on the file-system, ;; assumed to have to be done everytime. ;; (I don't think there is any such case in ASDF unless extended) @@ -1893,76 +2062,89 @@ (defgeneric* do-traverse (operation component collect)) -(defun* %do-one-dep (operation c collect required-op required-c required-v) - ;; collects a partial plan that results from performing required-op - ;; on required-c, possibly with a required-vERSION - (let* ((dep-c (or (let ((d (find-component (component-parent c) required-c))) - (and d (version-satisfies d required-v) d)) - (if required-v - (error 'missing-dependency-of-version - :required-by c - :version required-v - :requires required-c) - (error 'missing-dependency - :required-by c - :requires required-c)))) - (op (make-sub-operation c operation dep-c required-op))) - (do-traverse op dep-c collect))) - -(defun* do-one-dep (operation c collect required-op required-c required-v) - ;; this function is a thin, error-handling wrapper around %do-one-dep. - ;; Collects a partial plan per that function. +(defun* resolve-dependency-name (component name &optional version) (loop (restart-case - (return (%do-one-dep operation c collect - required-op required-c required-v)) + (return + (let ((comp (find-component (component-parent component) name))) + (unless comp + (error 'missing-dependency + :required-by component + :requires name)) + (when version + (unless (version-satisfies comp version) + (error 'missing-dependency-of-version + :required-by component + :version version + :requires name))) + comp)) (retry () :report (lambda (s) - (format s "~@" required-c)) + (format s "~@" name)) :test (lambda (c) (or (null c) (and (typep c 'missing-dependency) - (equalp (missing-requires c) - required-c)))))))) + (eq (missing-required-by c) component) + (equal (missing-requires c) name)))))))) + +(defun* resolve-dependency-spec (component dep-spec) + (cond + ((atom dep-spec) + (resolve-dependency-name component dep-spec)) + ;; Structured dependencies --- this parses keywords. + ;; The keywords could conceivably be broken out and cleanly (extensibly) + ;; processed by EQL methods. But for now, here's what we've got. + ((eq :version (first dep-spec)) + ;; https://bugs.launchpad.net/asdf/+bug/527788 + (resolve-dependency-name component (second dep-spec) (third dep-spec))) + ((eq :feature (first dep-spec)) + ;; This particular subform is not documented and + ;; has always been broken in the past. + ;; Therefore no one uses it, and I'm cerroring it out, + ;; after fixing it + ;; See https://bugs.launchpad.net/asdf/+bug/518467 + (cerror "Continue nonetheless." + "Congratulations, you're the first ever user of FEATURE dependencies! Please contact the asdf-devel mailing-list.") + (when (find (second dep-spec) *features* :test 'string-equal) + (resolve-dependency-name component (third dep-spec)))) + (t + (error (compatfmt "~@ ), (:feature ), or .~@:>") dep-spec)))) -(defun* do-dep (operation c collect op dep) - ;; type of arguments uncertain: - ;; op seems to at least potentially be a symbol, rather than an operation - ;; dep is a list of component names - (cond ((eq op 'feature) - (if (member (car dep) *features*) +(defun* do-one-dep (op c collect dep-op dep-c) + ;; Collects a partial plan for performing dep-op on dep-c + ;; as dependencies of a larger plan involving op and c. + ;; Returns t if this should force recompilation of those who depend on us. + ;; dep-op is an operation class name (not an operation object), + ;; whereas dep-c is a component object.n + (do-traverse (make-sub-operation c op dep-c dep-op) dep-c collect)) + +(defun* do-dep (op c collect dep-op-spec dep-c-specs) + ;; Collects a partial plan for performing dep-op-spec on each of dep-c-specs + ;; as dependencies of a larger plan involving op and c. + ;; Returns t if this should force recompilation of those who depend on us. + ;; dep-op-spec is either an operation class name (not an operation object), + ;; or the magic symbol asdf:feature. + ;; If dep-op-spec is asdf:feature, then the first dep-c-specs is a keyword, + ;; and the plan will succeed if that keyword is present in *feature*, + ;; or fail if it isn't + ;; (at which point c's :if-component-dep-fails will kick in). + ;; If dep-op-spec is an operation class name, + ;; then dep-c-specs specifies a list of sibling component of c, + ;; as per resolve-dependency-spec, such that operating op on c + ;; depends on operating dep-op-spec on each of them. + (cond ((eq dep-op-spec 'feature) + (if (member (car dep-c-specs) *features*) nil (error 'missing-dependency :required-by c - :requires (car dep)))) + :requires (list :feature (car dep-c-specs))))) (t (let ((flag nil)) - (flet ((dep (op comp ver) - (when (do-one-dep operation c collect - op comp ver) - (setf flag t)))) - (dolist (d dep) - (if (atom d) - (dep op d nil) - ;; structured dependencies --- this parses keywords - ;; the keywords could be broken out and cleanly (extensibly) - ;; processed by EQL methods - (cond ((eq :version (first d)) - ;; https://bugs.launchpad.net/asdf/+bug/527788 - (dep op (second d) (third d))) - ;; This particular subform is not documented and - ;; has always been broken in the past. - ;; Therefore no one uses it, and I'm cerroring it out, - ;; after fixing it - ;; See https://bugs.launchpad.net/asdf/+bug/518467 - ((eq :feature (first d)) - (cerror "Continue nonetheless." - "Congratulations, you're the first ever user of FEATURE dependencies! Please contact the asdf-devel mailing-list.") - (when (find (second d) *features* :test 'string-equal) - (dep op (third d) nil))) - (t - (error (compatfmt "~@), (:feature [version]), or a name.~@:>") d)))))) + (dolist (d dep-c-specs) + (when (do-one-dep op c collect dep-op-spec + (resolve-dependency-spec c d)) + (setf flag t))) flag)))) (defvar *visit-count* 0) ; counter that allows to sort nodes from operation-visited-nodes @@ -2087,6 +2269,35 @@ (declare (ignorable operation c)) nil) +(defmethod mark-operation-done ((operation operation) (c component)) + (setf (gethash (type-of operation) (component-operation-times c)) + (reduce #'max + (cons (get-universal-time) + (mapcar #'safe-file-write-date (input-files operation c)))))) + +(defmethod perform-with-restarts (operation component) + ;; TOO verbose, especially as the default. Add your own :before method + ;; to perform-with-restart or perform if you want that: + #|(when *asdf-verbose* (explain operation component))|# + (perform operation component)) + +(defmethod perform-with-restarts :around (operation component) + (loop + (restart-case + (return (call-next-method)) + (retry () + :report + (lambda (s) + (format s (compatfmt "~@") + (operation-description operation component)))) + (accept () + :report + (lambda (s) + (format s (compatfmt "~@") + (operation-description operation component))) + (mark-operation-done operation component) + (return))))) + (defmethod explain ((operation operation) (component component)) (asdf-message (compatfmt "~&~@<; ~@;~A~:>~%") (operation-description operation component))) @@ -2113,16 +2324,34 @@ (assert (length=n-p files 1)) (first files))) -(defmethod perform :before ((operation compile-op) (c source-file)) - (loop :for file :in (asdf:output-files operation c) - :for pathname = (if (typep file 'logical-pathname) - (translate-logical-pathname file) - file) +(defun* ensure-all-directories-exist (pathnames) + (loop :for pn :in pathnames + :for pathname = (if (typep pn 'logical-pathname) + (translate-logical-pathname pn) + pn) :do (ensure-directories-exist pathname))) +(defmethod perform :before ((operation compile-op) (c source-file)) + (ensure-all-directories-exist (asdf:output-files operation c))) + (defmethod perform :after ((operation operation) (c component)) - (setf (gethash (type-of operation) (component-operation-times c)) - (get-universal-time))) + (mark-operation-done operation c)) + +(defgeneric* around-compile-hook (component)) +(defgeneric* call-with-around-compile-hook (component thunk)) + +(defmethod around-compile-hook ((c component)) + (cond + ((slot-boundp c 'around-compile) + (slot-value c 'around-compile)) + ((component-parent c) + (around-compile-hook (component-parent c))))) + +(defmethod call-with-around-compile-hook ((c component) thunk) + (let ((hook (around-compile-hook c))) + (if hook + (funcall hook thunk) + (funcall thunk)))) (defvar *compile-op-compile-file-function* 'compile-file* "Function used to compile lisp files.") @@ -2138,8 +2367,10 @@ (*compile-file-warnings-behaviour* (operation-on-warnings operation)) (*compile-file-failure-behaviour* (operation-on-failure operation))) (multiple-value-bind (output warnings-p failure-p) - (apply *compile-op-compile-file-function* source-file - :output-file output-file (compile-op-flags operation)) + (call-with-around-compile-hook + c (lambda () + (apply *compile-op-compile-file-function* source-file + :output-file output-file (compile-op-flags operation)))) (unless output (error 'compile-error :component c :operation operation)) (when failure-p @@ -2191,54 +2422,19 @@ (defclass load-op (basic-load-op) ()) +(defmethod perform-with-restarts ((o load-op) (c cl-source-file)) + (loop + (restart-case + (return (call-next-method)) + (try-recompiling () + :report (lambda (s) + (format s "Recompile ~a and try loading it again" + (component-name c))) + (perform (make-sub-operation c o c 'compile-op) c))))) + (defmethod perform ((o load-op) (c cl-source-file)) (map () #'load (input-files o c))) -(defmethod perform-with-restarts (operation component) - ;;(when *asdf-verbose* (explain operation component)) ; TOO verbose, especially as the default. - (perform operation component)) - -(defmethod perform-with-restarts ((o load-op) (c cl-source-file)) - (declare (ignorable o)) - (loop :with state = :initial - :until (or (eq state :success) - (eq state :failure)) :do - (case state - (:recompiled - (setf state :failure) - (call-next-method) - (setf state :success)) - (:failed-load - (setf state :recompiled) - (perform (make-sub-operation c o c 'compile-op) c)) - (t - (with-simple-restart - (try-recompiling "Recompile ~a and try loading it again" - (component-name c)) - (setf state :failed-load) - (call-next-method) - (setf state :success)))))) - -(defmethod perform-with-restarts ((o compile-op) (c cl-source-file)) - (loop :with state = :initial - :until (or (eq state :success) - (eq state :failure)) :do - (case state - (:recompiled - (setf state :failure) - (call-next-method) - (setf state :success)) - (:failed-compile - (setf state :recompiled) - (perform-with-restarts o c)) - (t - (with-simple-restart - (try-recompiling "Try recompiling ~a" - (component-name c)) - (setf state :failed-compile) - (call-next-method) - (setf state :success)))))) - (defmethod perform ((operation load-op) (c static-file)) (declare (ignorable operation c)) nil) @@ -2280,7 +2476,7 @@ (declare (ignorable o)) (let ((source (component-pathname c))) (setf (component-property c 'last-loaded-as-source) - (and (load source) + (and (call-with-around-compile-hook c (lambda () (load source))) (get-universal-time))))) (defmethod perform ((operation load-source-op) (c static-file)) @@ -2371,25 +2567,7 @@ (*readtable* *readtable*)) (with-compilation-unit () (loop :for (op . component) :in steps :do - (loop - (restart-case - (progn - (perform-with-restarts op component) - (return)) - (retry () - :report - (lambda (s) - (format s (compatfmt "~@") - (operation-description op component)))) - (accept () - :report - (lambda (s) - (format s (compatfmt "~@") - (operation-description op component))) - (setf (gethash (type-of op) - (component-operation-times component)) - (get-universal-time)) - (return)))))))) + (perform-with-restarts op component))))) (defmethod operate (operation-class system &rest args &key ((:verbose *asdf-verbose*) *asdf-verbose*) version force @@ -2622,18 +2800,23 @@ weakly-depends-on depends-on serial in-order-to) rest)) - (ret - (or (find-component parent name) - (make-instance (class-for-type parent type))))) + (ret (find-component parent name))) (when weakly-depends-on (appendf depends-on (remove-if (complement #'find-system) weakly-depends-on))) (when *serial-depends-on* (push *serial-depends-on* depends-on)) - (apply 'reinitialize-instance ret - :name (coerce-name name) - :pathname pathname - :parent parent - other-args) + (if ret + (apply 'reinitialize-instance ret + :name (coerce-name name) + :pathname pathname + :parent parent + other-args) + (setf ret + (apply 'make-instance (class-for-type parent type) + :name (coerce-name name) + :pathname pathname + :parent parent + other-args))) (component-pathname ret) ; eagerly compute the absolute pathname (when (typep ret 'module) (setf (module-default-component-class ret) @@ -2660,7 +2843,7 @@ (setf (component-do-first ret) (union-of-dependencies do-first - `((compile-op (load-op , at depends-on))))) + `((compile-op (load-op , at depends-on))))) (%refresh-component-inline-methods ret rest) ret))) @@ -2706,11 +2889,25 @@ ;;;; gratefully accepted, if they do the same thing. ;;;; If the docstring is ambiguous, send a bug report. ;;;; +;;;; WARNING! The function below is mostly dysfunctional. +;;;; For instance, it will probably run fine on most implementations on Unix, +;;;; which will hopefully use the shell /bin/sh (which we force in some cases) +;;;; which is hopefully reasonably compatible with a POSIX *or* Bourne shell. +;;;; But behavior on Windows may vary wildly between implementations, +;;;; either relying on your having installed a POSIX sh, or going through +;;;; the CMD.EXE interpreter, for a totally different meaning, depending on +;;;; what is easily expressible in said implementation. +;;;; ;;;; We probably should move this functionality to its own system and deprecate ;;;; use of it from the asdf package. However, this would break unspecified ;;;; existing software, so until a clear alternative exists, we can't deprecate ;;;; it, and even after it's been deprecated, we will support it for a few ;;;; years so everyone has time to migrate away from it. -- fare 2009-12-01 +;;;; +;;;; As a suggested replacement which is portable to all ASDF-supported +;;;; implementations and operating systems except Genera, I recommend +;;;; xcvb-driver's xcvb-driver:run-program/process-output-stream and its +;;;; derivatives such as xcvb-driver:run-program/for-side-effects. (defun* run-shell-command (control-string &rest args) "Interpolate ARGS into CONTROL-STRING as if by FORMAT, and @@ -2726,44 +2923,57 @@ ;; will this fail if command has embedded quotes - it seems to work (multiple-value-bind (stdout stderr exit-code) (excl.osi:command-output - (format nil "~a -c \"~a\"" - #+mswindows "sh" #-mswindows "/bin/sh" command) + #-mswindows (vector "/bin/sh" "/bin/sh" "-c" command) + #+mswindows command ; BEWARE! :input nil :whole nil #+mswindows :show-window #+mswindows :hide) - (asdf-message "~{~&; ~a~%~}~%" stderr) - (asdf-message "~{~&; ~a~%~}~%" stdout) + (asdf-message "~{~&~a~%~}~%" stderr) + (asdf-message "~{~&~a~%~}~%" stdout) exit-code) - #+clisp ;XXX not exactly *verbose-out*, I know - (or (ext:run-shell-command command :output (and *verbose-out* :terminal) :wait t) 0) + #+clisp + ;; CLISP returns NIL for exit status zero. + (if *verbose-out* + (let* ((new-command (format nil "( ~A ) ; r=$? ; echo ; echo ASDF-EXIT-STATUS $r" + command)) + (outstream (ext:run-shell-command new-command :output :stream :wait t))) + (multiple-value-bind (retval out-lines) + (unwind-protect + (parse-clisp-shell-output outstream) + (ignore-errors (close outstream))) + (asdf-message "~{~&~a~%~}~%" out-lines) + retval)) + ;; there will be no output, just grab up the exit status + (or (ext:run-shell-command command :output nil :wait t) 0)) #+clozure (nth-value 1 (ccl:external-process-status - (ccl:run-program "/bin/sh" (list "-c" command) - :input nil :output *verbose-out* - :wait t))) + (ccl:run-program + (cond + ((os-unix-p) "/bin/sh") + ((os-windows-p) (format nil "CMD /C ~A" command)) ; BEWARE! + (t (error "Unsupported OS"))) + (if (os-unix-p) (list "-c" command) '()) + :input nil :output *verbose-out* :wait t))) #+(or cmu scl) (ext:process-exit-code (ext:run-program "/bin/sh" - (list "-c" command) + (list "-c" command) :input nil :output *verbose-out*)) #+ecl ;; courtesy of Juan Jose Garcia Ripoll - (si:system command) + (ext:system command) #+gcl (lisp:system command) #+lispworks - (system:call-system-showing-output - command - :shell-type "/bin/sh" - :show-cmd nil - :prefix "" - :output-stream *verbose-out*) + (apply 'system:call-system-showing-output command + :show-cmd nil :prefix "" :output-stream *verbose-out* + (when (os-unix-p) '(:shell-type "/bin/sh"))) #+mcl (ccl::with-cstrs ((%command command)) (_system %command)) @@ -2782,6 +2992,25 @@ #-(or abcl allegro clisp clozure cmu ecl gcl lispworks mcl sbcl scl xcl) (error "RUN-SHELL-COMMAND not implemented for this Lisp"))) +#+clisp +(defun* parse-clisp-shell-output (stream) + "Helper function for running shell commands under clisp. Parses a specially- +crafted output string to recover the exit status of the shell command and a +list of lines of output." + (loop :with status-prefix = "ASDF-EXIT-STATUS " + :with prefix-length = (length status-prefix) + :with exit-status = -1 :with lines = () + :for line = (read-line stream nil nil) + :while line :do (push line lines) :finally + (let* ((last (car lines)) + (status (and last (>= (length last) prefix-length) + (string-equal last status-prefix :end1 prefix-length) + (parse-integer last :start prefix-length :junk-allowed t)))) + (when status + (setf exit-status status) + (pop lines) (when (equal "" (car lines)) (pop lines))) + (return (values exit-status (reverse lines)))))) + ;;;; --------------------------------------------------------------------------- ;;;; system-relative-pathname @@ -2798,10 +3027,12 @@ if that's whay you mean." ;;) (system-source-file x)) +(defmethod system-source-file ((system system)) + (%system-source-file system)) (defmethod system-source-file ((system-name string)) - (system-source-file (find-system system-name))) + (%system-source-file (find-system system-name))) (defmethod system-source-file ((system-name symbol)) - (system-source-file (find-system system-name))) + (%system-source-file (find-system system-name))) (defun* system-source-directory (system-designator) "Return a pathname object corresponding to the @@ -2866,33 +3097,34 @@ (defparameter *lisp-version-string* (let ((s (lisp-implementation-version))) - (or - #+allegro - (format nil "~A~A~@[~A~]" - excl::*common-lisp-version-number* - ;; ANSI vs MoDeRn - thanks to Robert Goldman and Charley Cox - (if (eq excl:*current-case-mode* :case-sensitive-lower) "M" "A") - ;; Note if not using International ACL - ;; see http://www.franz.com/support/documentation/8.1/doc/operators/excl/ics-target-case.htm - (excl:ics-target-case (:-ics "8"))) - #+armedbear (format nil "~a-fasl~a" s system::*fasl-version*) - #+clisp - (subseq s 0 (position #\space s)) ; strip build information (date, etc.) - #+clozure - (format nil "~d.~d-f~d" ; shorten for windows - ccl::*openmcl-major-version* - ccl::*openmcl-minor-version* - (logand ccl::fasl-version #xFF)) - #+cmu (substitute #\- #\/ s) - #+ecl (format nil "~A~@[-~A~]" s - (let ((vcs-id (ext:lisp-implementation-vcs-id))) - (subseq vcs-id 0 (min (length vcs-id) 8)))) - #+gcl (subseq s (1+ (position #\space s))) - #+genera - (multiple-value-bind (major minor) (sct:get-system-version "System") - (format nil "~D.~D" major minor)) - #+mcl (subseq s 8) ; strip the leading "Version " - s))) + (car + (list + #+allegro + (format nil "~A~A~@[~A~]" + excl::*common-lisp-version-number* + ;; ANSI vs MoDeRn - thanks to Robert Goldman and Charley Cox + (if (eq excl:*current-case-mode* :case-sensitive-lower) "M" "A") + ;; Note if not using International ACL + ;; see http://www.franz.com/support/documentation/8.1/doc/operators/excl/ics-target-case.htm + (excl:ics-target-case (:-ics "8"))) + #+armedbear (format nil "~a-fasl~a" s system::*fasl-version*) + #+clisp + (subseq s 0 (position #\space s)) ; strip build information (date, etc.) + #+clozure + (format nil "~d.~d-f~d" ; shorten for windows + ccl::*openmcl-major-version* + ccl::*openmcl-minor-version* + (logand ccl::fasl-version #xFF)) + #+cmu (substitute #\- #\/ s) + #+ecl (format nil "~A~@[-~A~]" s + (let ((vcs-id (ext:lisp-implementation-vcs-id))) + (subseq vcs-id 0 (min (length vcs-id) 8)))) + #+gcl (subseq s (1+ (position #\space s))) + #+genera + (multiple-value-bind (major minor) (sct:get-system-version "System") + (format nil "~D.~D" major minor)) + #+mcl (subseq s 8) ; strip the leading "Version " + s)))) (defun* implementation-type () *implementation-type*) @@ -2901,7 +3133,7 @@ (substitute-if #\_ #'(lambda (x) (find x " /:;&^\\|?<>(){}[]$#`'\"")) (format nil "~(~a~@{~@[-~a~]~}~)" - (or *implementation-type* (lisp-implementation-type)) + (or *implementation-type* (lisp-implementation-type)) (or *lisp-version-string* (lisp-implementation-version)) (or *operating-system* (software-type)) (or *architecture* (machine-type))))) @@ -2910,9 +3142,8 @@ ;;; --------------------------------------------------------------------------- ;;; Generic support for configuration files -(defparameter *inter-directory-separator* - #+asdf-unix #\: - #-asdf-unix #\;) +(defun inter-directory-separator () + (if (os-unix-p) #\: #\;)) (defun* user-homedir () (truenamize @@ -2933,27 +3164,28 @@ ,@(loop :with dirs = (getenv "XDG_CONFIG_DIRS") :for dir :in (split-string dirs :separator ":") :collect (try dir "common-lisp/")) - #+asdf-windows - ,@`(,(try (or #+lispworks (sys:get-folder-path :local-appdata) - (getenv "LOCALAPPDATA")) - "common-lisp/config/") - ;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData - ,(try (or #+lispworks (sys:get-folder-path :appdata) - (getenv "APPDATA")) - "common-lisp/config/")) + ,@(when (os-windows-p) + `(,(try (or #+lispworks (sys:get-folder-path :local-appdata) + (getenv "LOCALAPPDATA")) + "common-lisp/config/") + ;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData + ,(try (or #+lispworks (sys:get-folder-path :appdata) + (getenv "APPDATA")) + "common-lisp/config/"))) ,(try (user-homedir) ".config/common-lisp/"))))) (remove-duplicates (remove-if #'null dirs) :from-end t :test 'equal))) (defun* system-configuration-directories () - (remove-if - #'null - `(#+asdf-windows - ,(flet ((try (x sub) (try-directory-subpath x sub))) + (cond + ((os-unix-p) '(#p"/etc/common-lisp/")) + ((os-windows-p) + (aif + (flet ((try (x sub) (try-directory-subpath x sub))) ;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Common AppData (try (or #+lispworks (sys:get-folder-path :common-appdata) (getenv "ALLUSERSAPPDATA") (try (getenv "ALLUSERSPROFILE") "Application Data/")) "common-lisp/config/")) - #+asdf-unix #p"/etc/common-lisp/"))) + (list it))))) (defun* in-first-directory (dirs x) (loop :for dir :in dirs @@ -3072,12 +3304,12 @@ (flet ((try (x &rest sub) (and x `(,x , at sub)))) (or (try (getenv "XDG_CACHE_HOME") "common-lisp" :implementation) - #+asdf-windows - (try (or #+lispworks (sys:get-folder-path :local-appdata) - (getenv "LOCALAPPDATA") - #+lispworks (sys:get-folder-path :appdata) - (getenv "APPDATA")) - "common-lisp" "cache" :implementation) + (when (os-windows-p) + (try (or #+lispworks (sys:get-folder-path :local-appdata) + (getenv "LOCALAPPDATA") + #+lispworks (sys:get-folder-path :appdata) + (getenv "APPDATA")) + "common-lisp" "cache" :implementation)) '(:home ".cache" "common-lisp" :implementation)))) (defun* output-translations () @@ -3204,8 +3436,7 @@ (relative-component-p (c) (typep c '(or string pathname (member :default-directory :*/ :**/ :*.*.* - :implementation :implementation-type - #+asdf-unix :uid))))) + :implementation :implementation-type))))) (or (typep x 'boolean) (absolute-component-p x) (and (consp x) (absolute-component-p (first x)) (every #'relative-component-p (rest x)))))) @@ -3265,7 +3496,8 @@ :with start = 0 :with end = (length string) :with source = nil - :for i = (or (position *inter-directory-separator* string :start start) end) :do + :with separator = (inter-directory-separator) + :for i = (or (position separator string :start start) end) :do (let ((s (subseq string start i))) (cond (source @@ -3579,81 +3811,6 @@ :ignore-inherited-configuration)))) ;;;; ----------------------------------------------------------------- -;;;; Windows shortcut support. Based on: -;;;; -;;;; Jesse Hager: The Windows Shortcut File Format. -;;;; http://www.wotsit.org/list.asp?fc=13 - -#+(and asdf-windows (not clisp)) -(progn -(defparameter *link-initial-dword* 76) -(defparameter *link-guid* #(1 20 2 0 0 0 0 0 192 0 0 0 0 0 0 70)) - -(defun* read-null-terminated-string (s) - (with-output-to-string (out) - (loop :for code = (read-byte s) - :until (zerop code) - :do (write-char (code-char code) out)))) - -(defun* read-little-endian (s &optional (bytes 4)) - (loop :for i :from 0 :below bytes - :sum (ash (read-byte s) (* 8 i)))) - -(defun* parse-file-location-info (s) - (let ((start (file-position s)) - (total-length (read-little-endian s)) - (end-of-header (read-little-endian s)) - (fli-flags (read-little-endian s)) - (local-volume-offset (read-little-endian s)) - (local-offset (read-little-endian s)) - (network-volume-offset (read-little-endian s)) - (remaining-offset (read-little-endian s))) - (declare (ignore total-length end-of-header local-volume-offset)) - (unless (zerop fli-flags) - (cond - ((logbitp 0 fli-flags) - (file-position s (+ start local-offset))) - ((logbitp 1 fli-flags) - (file-position s (+ start - network-volume-offset - #x14)))) - (concatenate 'string - (read-null-terminated-string s) - (progn - (file-position s (+ start remaining-offset)) - (read-null-terminated-string s)))))) - -(defun* parse-windows-shortcut (pathname) - (with-open-file (s pathname :element-type '(unsigned-byte 8)) - (handler-case - (when (and (= (read-little-endian s) *link-initial-dword*) - (let ((header (make-array (length *link-guid*)))) - (read-sequence header s) - (equalp header *link-guid*))) - (let ((flags (read-little-endian s))) - (file-position s 76) ;skip rest of header - (when (logbitp 0 flags) - ;; skip shell item id list - (let ((length (read-little-endian s 2))) - (file-position s (+ length (file-position s))))) - (cond - ((logbitp 1 flags) - (parse-file-location-info s)) - (t - (when (logbitp 2 flags) - ;; skip description string - (let ((length (read-little-endian s 2))) - (file-position s (+ length (file-position s))))) - (when (logbitp 3 flags) - ;; finally, our pathname - (let* ((length (read-little-endian s 2)) - (buffer (make-array length))) - (read-sequence buffer s) - (map 'string #'code-char buffer))))))) - (end-of-file () - nil))))) - -;;;; ----------------------------------------------------------------- ;;;; Source Registry Configuration, by Francois-Rene Rideau ;;;; See the Manual and https://bugs.launchpad.net/asdf/+bug/485918 @@ -3813,7 +3970,8 @@ :with directives = () :with start = 0 :with end = (length string) - :for pos = (position *inter-directory-separator* string :start start) :do + :with separator = (inter-directory-separator) + :for pos = (position separator string :start start) :do (let ((s (subseq string start (or pos end)))) (flet ((check (dir) (unless (absolute-pathname-p dir) @@ -3866,20 +4024,20 @@ #+sbcl (:directory ,(try (user-homedir) ".sbcl/systems/")) (:directory ,(default-directory)) ,@(loop :for dir :in - `(#+asdf-unix - ,@`(,(or (getenv "XDG_DATA_HOME") - (try (user-homedir) ".local/share/")) - ,@(split-string (or (getenv "XDG_DATA_DIRS") - "/usr/local/share:/usr/share") - :separator ":")) - #+asdf-windows - ,@`(,(or #+lispworks (sys:get-folder-path :local-appdata) - (getenv "LOCALAPPDATA")) - ,(or #+lispworks (sys:get-folder-path :appdata) - (getenv "APPDATA")) - ,(or #+lispworks (sys:get-folder-path :common-appdata) - (getenv "ALLUSERSAPPDATA") - (try (getenv "ALLUSERSPROFILE") "Application Data/")))) + `(,@(when (os-unix-p) + `(,(or (getenv "XDG_DATA_HOME") + (try (user-homedir) ".local/share/")) + ,@(split-string (or (getenv "XDG_DATA_DIRS") + "/usr/local/share:/usr/share") + :separator ":"))) + ,@(when (os-windows-p) + `(,(or #+lispworks (sys:get-folder-path :local-appdata) + (getenv "LOCALAPPDATA")) + ,(or #+lispworks (sys:get-folder-path :appdata) + (getenv "APPDATA")) + ,(or #+lispworks (sys:get-folder-path :common-appdata) + (getenv "ALLUSERSAPPDATA") + (try (getenv "ALLUSERSPROFILE") "Application Data/"))))) :collect `(:directory ,(try dir "common-lisp/systems/")) :collect `(:tree ,(try dir "common-lisp/source/"))) :inherit-configuration))) @@ -4041,29 +4199,36 @@ ;;; #+ecl (progn - (setf *compile-op-compile-file-function* - (lambda (input-file &rest keys &key output-file &allow-other-keys) - (declare (ignore output-file)) - (multiple-value-bind (object-file flags1 flags2) - (apply 'compile-file* input-file :system-p t keys) - (values (and object-file - (c::build-fasl (compile-file-pathname object-file :type :fasl) - :lisp-files (list object-file)) - object-file) - flags1 - flags2)))) + (setf *compile-op-compile-file-function* 'ecl-compile-file) + + (defun use-ecl-byte-compiler-p () + (member :ecl-bytecmp *features*)) + + (defun ecl-compile-file (input-file &rest keys &key &allow-other-keys) + (if (use-ecl-byte-compiler-p) + (apply 'compile-file* input-file keys) + (multiple-value-bind (object-file flags1 flags2) + (apply 'compile-file* input-file :system-p t keys) + (values (and object-file + (c::build-fasl (compile-file-pathname object-file :type :fasl) + :lisp-files (list object-file)) + object-file) + flags1 + flags2)))) (defmethod output-files ((operation compile-op) (c cl-source-file)) (declare (ignorable operation)) - (let ((p (lispize-pathname (component-pathname c)))) - (list (compile-file-pathname p :type :object) - (compile-file-pathname p :type :fasl)))) + (let* ((p (lispize-pathname (component-pathname c))) + (f (compile-file-pathname p :type :fasl))) + (if (use-ecl-byte-compiler-p) + (list f) + (list (compile-file-pathname p :type :object) f)))) (defmethod perform ((o load-op) (c cl-source-file)) (map () #'load (loop :for i :in (input-files o c) :unless (string= (pathname-type i) "fas") - :collect (compile-file-pathname (lispize-pathname i)))))) + :collect (compile-file-pathname (lispize-pathname i)))))) ;;;; ----------------------------------------------------------------- ;;;; Hook into REQUIRE for ABCL, CLISP, ClozureCL, CMUCL, ECL and SBCL @@ -4090,8 +4255,7 @@ #+abcl sys::*module-provider-functions* #+clisp ,x #+clozure ccl:*module-provider-functions* - #+cmu ext:*module-provider-functions* - #+ecl si:*module-provider-functions* + #+(or cmu ecl) ext:*module-provider-functions* #+sbcl sb-ext:*module-provider-functions*)))) From ehuelsmann at common-lisp.net Fri Oct 21 21:07:31 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 21 Oct 2011 14:07:31 -0700 Subject: [armedbear-cvs] r13657 - trunk/abcl/doc/manual Message-ID: Author: ehuelsmann Date: Fri Oct 21 14:07:31 2011 New Revision: 13657 Log: Change date of transfer of maintainership. Add description of more JAVA package primitives. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Fri Oct 21 13:59:01 2011 (r13656) +++ trunk/abcl/doc/manual/abcl.tex Fri Oct 21 14:07:31 2011 (r13657) @@ -297,6 +297,28 @@ The constructor can't be passed to \code{JAVA:JCALL}, but instead should be passed as an argument to \code{JAVA:JNEW}. +\subsubsection{Accessing Java object fields} + +Fields in Java objects can be accessed using the getter and setter functions +\code{JAVA:GETFIELD} and \code{JAVA:PUTFIELD}. This applies to values stored in object +instances. If you want to access static fields: see the next section. + +Like \code{JAVA:JCALL} and friends, values returned from these accessors carry +an intended class around and values which can be converted to Lisp values will +be converted. + +\subsubsection{Accessing Java static fields} + +Static fields in Java objects (class fields) can be accessed using the getter +and setter functions \code{JAVA:GETSTATIC} and \code{JAVA:PUTSTATIC}. Values +stored in object instance fields can be accessed as described in the previous +section. + +Like \code{JAVA:JCALL} and friends, values returned from these accessors carry +an intended class around and values which can be converted to Lisp values will +be converted. + + \section{Lisp from Java} In order to access the Lisp world from Java, one needs to be aware @@ -941,7 +963,7 @@ suddenly committed that enabled ABCL to be plausibly termed an ANSI Common Lisp implementation. -In 2006, the implementation was transferred to the current +In 2008, the implementation was transferred to the current maintainers, who have strived to improve its usability as a contemporary Common Lisp implementation. From mevenson at common-lisp.net Fri Oct 21 21:11:03 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 14:11:03 -0700 Subject: [armedbear-cvs] r13658 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 14:11:02 2011 New Revision: 13658 Log: Note use of ASDF-2.0.17.22 in manual. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 14:07:31 2011 (r13657) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 14:11:02 2011 (r13658) @@ -776,7 +776,7 @@ \section{Pathname} -We implment an extension to the Pathname that allows for the +We implement an extension to the Pathname that allows for the description and retrieval of resources named in a URI scheme that the JVM ``understands''. Support is built-in to the ``http'' and ``https'' implementations but additional protocol handlers may be @@ -818,6 +818,11 @@ will load and execute the Quicklisp setup code. \ref{XACH2011} + +\subsubsection{Implementation} + +\textsc{DEVICE} either a string denoting a drive letter under DOS or a cons +specifying a \textsc{URL-PATHNAME}. \section{Extensible Sequences} @@ -907,9 +912,9 @@ \section{ASDF} -asdf-2.017 is packaged as core component of ABCL, but not intialized -by default, as it relies on the CLOS subsystem which can take a bit of -time to initialize. It may be initialized by the ANSI +asdf-2.017.22 is packaged as core component of ABCL, but not +intialized by default, as it relies on the CLOS subsystem which can +take a bit of time to initialize. It may be initialized by the ANSI \textsc{REQUIRE} mechanism as follows: \begin{listing-lisp} From mevenson at common-lisp.net Fri Oct 21 21:13:47 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 14:13:47 -0700 Subject: [armedbear-cvs] r13659 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 14:13:46 2011 New Revision: 13659 Log: Correct history to note 2008 as the transfer from Peter Graves to Erik Huelsmann. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 14:11:02 2011 (r13658) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 14:13:46 2011 (r13659) @@ -1024,7 +1024,11 @@ committed that enabled ABCL to be plausibly termed an emergent ANSI Common Lisp implementation canidate. -In 2006, the implementation was transferred to the current +From 2006 to 2008, Peter manned the development lists, incorporating +patches as made sense. After a suitable search, Peter nominated Erik +Huelsmann to take over the project. + +In 2008, the implementation was transferred to the current maintainers, who have strived to improve its usability as a contemporary Common Lisp implementation. From mevenson at common-lisp.net Fri Oct 21 21:28:49 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 14:28:49 -0700 Subject: [armedbear-cvs] r13660 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 14:28:49 2011 New Revision: 13660 Log: Merge from abcl-20111021b Draft from 1.0.x branch. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Fri Oct 21 14:13:46 2011 (r13659) +++ trunk/abcl/doc/manual/abcl.tex Fri Oct 21 14:28:49 2011 (r13660) @@ -5,28 +5,54 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{October 20, 2011} +\date{October 21, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle \chapter{Introduction} -Armed Bear is a mostly conforming implementation of the ANSI Common +Armed Bear is a (mostly) conforming implementation of the ANSI Common Lisp standard. This manual documents the Armed Bear Common Lisp implementation for users of the system. \subsection{Version} -This manual corresponds to abcl-0.28.0, as yet unreleased. +This manual corresponds to abcl-1.0.0, released on October 22, 2011. + +\subsection{License} + +The implementation is licensed under the terms of the GPL v2 of June +1991 with the ``classpath-exception'' that makes its deployment in +commercial settings quite reasonable. The license is viral in the +sense that if you change the implementation, and redistribute those +changes, you are required to provide the source to those changes back +to be merged with the public trunk. + +\subsection{Contributors} + +% TODO format this better, optionally link to URI + +% Thanks for the markup +Philipp Marek + +% Thanks for the whacky IKVM stuff and keeping the flame alive +Douglas Miles + +% Thanks for JSS +Alan Ruttenberg + +and of course + +Peter Graves \chapter{Running} \textsc{ABCL} is packaged as a single jar file usually named either -``abcl.jar'' or possibly``abcl-0.28.0.jar'' if you are using a -versioned package from your system vendor. This byte archive can be -executed under the control of a suitable JVM by using the ``-jar'' -option to parse the manifest, and select the named class -(\code{org.armedbear.lisp.Main}) for execution: +``abcl.jar'' or possibly``abcl-1.0.0.jar'' if one is using a versioned +package from your system vendor. This byte archive can be executed +under the control of a suitable JVM by using the ``-jar'' option to +parse the manifest, and select the named class +(\code{org.armedbear.lisp.Main}) for execution, viz: \begin{listing-shell} cmd$ java -jar abcl.jar @@ -35,10 +61,11 @@ N.b. for the proceeding command to work, the ``java'' executable needs to be in your path. -To make it easier to facilitate the use of ABCL in tool chains (such as -SLIME) the invocation is wrapped in a Bourne shell script under UNIX -or a DOS command script under Windows so that ABCL may be executed -simply as: +To make it easier to facilitate the use of ABCL in tool chains (such +as SLIME \footnote{SLIME is the Superior Lisp Mode for Interaction + under Emacs}) the invocation is wrapped in a Bourne shell script +under UNIX or a DOS command script under Windows so that ABCL may be +executed simply as: \begin{listing-shell} cmd$ abcl @@ -71,7 +98,7 @@ the variable EXTENSIONS:*COMMAND-LINE-ARGUMENT-LIST*. \end{verbatim} -All of the command line arguments which follow the occurrence of ``--'' +All of the command line arguments which follow the occurrence of ``----'' are passed into a list bound to the EXT:*COMMAND-LINE-ARGUMENT-LIST* variable. @@ -82,45 +109,73 @@ directory and then interpret its contents. The user's home directory is determined by the value of the JVM system -property ``user.home''. +property ``user.home''. This value may--or may not--correspond to the +value of the HOME system environment variable at the discretion of the +JVM implementation that \textsc{ABCL} finds itself hosted upon. \chapter{Conformance} \section{ANSI Common Lisp} -\textsc{ABCL} is currently a non-conforming ANSI Common Lisp implementation due -to the following issues: +\textsc{ABCL} is currently a (non)-conforming ANSI Common Lisp +implementation due to the following known issues: \begin{itemize} \item The generic function signatures of the DOCUMENTATION symbol do not match the CLHS. - \item The TIME form does not return a proper VALUES to its caller. + \item The TIME form does not return a proper VALUES environment to + its caller. \end{itemize} -ABCL aims to be be a fully conforming ANSI Common Lisp -implementation. Any other behavior should be reported as a bug. +Somewhat confusingly, this statement of non-conformance in the +accompanying user documentation fullfills the requirements that +\textsc{ABCL} is a conforming ANSI Common Lisp implementation +according to the CLHS \footnote{Common Lisp Hyperspec language + reference document.}. Clarifications to this point are solicited. + +ABCL aims to be be a fully conforming ANSI Common Lisp implementation. +Any other behavior should be reported as a bug. \section{Contemporary Common Lisp} In addition to ANSI conformance, \textsc{ABCL} strives to implement features -expected of a contemporary Common Lisp. +expected of a contemporary Common Lisp \footnote{i.e. a Lisp of the + post 2005 Renaissance} + +\subsection{Deficiencies} +The following known problems detract from \textsc{ABCL} being a proper +contemporary Comon Lisp. \begin{itemize} - \item Incomplete (A)MOP - % N.B. + \item An incomplete implementation of a properly named metaobject + protocol (viz. (A)MOP \footnote{Another Metaobject Protocol} ) + + % N.b. % TODO go through AMOP with symbols, starting by looking for % matching function signature. % XXX is this really blocking ANSI conformance? Answer: we have % to start with such a ``census'' to determine what we have. - \item Incomplete Streams: need suitable abstraction between ANSI - and Gray streams. + + \item Incomplete streams abstraction, in that \textsc{ABCL} needs suitable + abstraction between ANSI and Gray streams. The streams could be + optimized to the JVM NIO abstractions at great profit for binary + byte-level manipulations. + \item Incomplete documentation (missing docstrings from exported + symbols. + \end{itemize} -\chapter{Interaction with host JVM} +\chapter{Interaction with Hosting JVM} +% Plan of Attack +% % describe calling Java from Lisp, and calling Lisp from Java, % probably in two separate sections. Presumably, we can partition our % audience into those who are more comfortable with Java, and those % that are more comforable with Lisp +The Armed Bear Common Lisp implementation is hosted on a Java Virtual +Machine. This chapter describes the mechanisms by which the +implementation interacts with that hosting mechanism. + \section{Lisp to Java} \textsc{ABCL} offers a number of mechanisms to interact with Java from its @@ -143,15 +198,15 @@ \subsection{Low-level Java API} -There's a higher level Java API defined in the -\ref{topic:Higher level Java API: JSS}(JSS package) which is available -in the \code{contrib/} directory. This package is described later in this -document. This section covers the lower level API directly available -after evaluating \code{(require 'JAVA)}. +We define a higher level Java API in the \ref{topic:Higher level Java + API: JSS}(JSS package) which is available in the \code{contrib/} \ref{topic:contrib} +directory. This package is described later in this document. This +section covers the lower level API directly available after evaluating +\code{(require 'JAVA)}. -\subsubsection{Calling Java object methods} +\subsubsection{Calling Java Object Methods} -There are two ways to call a Java object method in the basic API: +There are two ways to call a Java object method in the low-level (basic) API: \begin{itemize} \item Call a specific method reference (which was previously acquired) @@ -176,10 +231,11 @@ integer, the first method by that name and matching number of parameters is returned. -Once you have a reference to the method, you can call it using \code{JAVA:JCALL}, -which takes the method as the first argument. The second argument is the -object instance to call the method on, or \code{NIL} in case of a static method. -Any remaining parameters are used as the remaining arguments for the call. +Once one has a reference to the method, one may invoke it using +\code{JAVA:JCALL}, which takes the method as the first argument. The +second argument is the object instance to call the method on, or +\code{NIL} in case of a static method. Any remaining parameters are +used as the remaining arguments for the call. \subsubsection{Calling Java object methods: dynamic dispatch} @@ -190,7 +246,7 @@ on which the method should be called and any further arguments are used to select the best matching method and dispatch the call. -\subsubsection{Dynamic dispatch: caveats} +\subsubsection{Dynamic dispatch: Caveats} Dynamic dispatch is performed by using the Java reflection API \footnote{The Java reflection API is found in the @@ -211,7 +267,7 @@ \begin{listing-java} java.lang.IllegalAccessException: Class ... can -not access a member of class java.util.zip.ZipFile$2 with modifiers +not access a member of class java.util.zip.ZipFile\$2 with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) at java.lang.reflect.Method.invoke(Method.java:583) @@ -318,7 +374,6 @@ an intended class around and values which can be converted to Lisp values will be converted. - \section{Lisp from Java} In order to access the Lisp world from Java, one needs to be aware @@ -595,7 +650,7 @@ \subsubsection{Compilation} -AbclScriptEngine implements the javax.script.Compilable +AbclScriptEngine implements the \code{javax.script.Compilable} interface. Currently it only supports compilation using temporary files. Compiled code, returned as an instance of javax.script.CompiledScript, is read, compiled and executed by default @@ -690,7 +745,7 @@ CL-USER> (add-to-classpath "/path/to/some.jar") \end{listing-lisp} -NB \code{add-to-classpath} only affects the classloader used by ABCL +N.b \code{add-to-classpath} only affects the classloader used by ABCL (the value of the special variable \code{JAVA:*CLASSLOADER*}. It has no effect on Java code outside ABCL. @@ -701,7 +756,10 @@ \section{THREADS} -Multithreading +The extensions for handling multithreaded execution are collected in +the \code{THREADS} package. Most of the abstractions in Doug Lea's +excellent \code{java.util.concurrent} packages may be manipulated +directly via the JSS contrib to great effect. \subsection{API} @@ -739,7 +797,7 @@ \section{Pathname} -We implment an extension to the Pathname that allows for the +We implement an extension to the Pathname that allows for the description and retrieval of resources named in a URI scheme that the JVM ``understands''. Support is built-in to the ``http'' and ``https'' implementations but additional protocol handlers may be @@ -751,20 +809,26 @@ JVM. A URL-PATHNAME has a corresponding URL whose cannoical representation is defined to be the NAMESTRING of the Pathname. -PATHNAME : URL-PATHNAME : JAR-PATHNAME +\begin{verbatim} + JAR-PATHNAME isa URL-PATHNAME isa PATHNAME +\end{verbatim} -Both URL-PATHNAME and JAR-PATHNAME may be used anu where will a -PATHNAME is accepted witht the following caveats +Both URL-PATHNAME and JAR-PATHNAME may be used anywhere a PATHNAME is +accepted with the following caveats: -A stream obtained via OPEN on a URL-PATHNAME cannot be the target of -write operations. +\begin{itemize} -No canonicalization is performed on the underlying URI (i.e. the +\item A stream obtained via OPEN on a URL-PATHNAME cannot be the + target of write operations. + +\item No canonicalization is performed on the underlying URI (i.e. the implementation does not attempt to compute the current name of the representing resource unless it is requested to be resolved.) Upon resolution, any cannoicalization procedures followed in resolving the resource (e.g. following redirects) are discarded. +\end{itemize} + The implementation of URL-PATHNAME allows the ABCL user to laod dynamically code from the network. For example, for Quicklisp. @@ -775,6 +839,11 @@ will load and execute the Quicklisp setup code. \ref{XACH2011} + +\subsubsection{Implementation} + +\textsc{DEVICE} either a string denoting a drive letter under DOS or a cons +specifying a \textsc{URL-PATHNAME}. \section{Extensible Sequences} @@ -844,10 +913,14 @@ We implement a special hexadecimal escape sequence for specifying characters to the Lisp reader, namely we allow a sequences of the form -\# \textbackslash Uxxxx to be processed by the reader as character whose code is -specified by the hexadecimal digits ``xxxx''. The hexadecimal sequence -must be exactly four digits long, padded by leading zeros for values -less than 0x1000. +\# \textbackslash Uxxxx to be processed by the reader as character +whose code is specified by the hexadecimal digits ``xxxx''. The +hexadecimal sequence must be exactly four digits long \footnote{This + represents a compromise with contemporary in 2011 32bit hosting + architecures for which we wish to make text processing efficient. + Should the User require more control over UNICODE processing we + recommend Edi Weisz' excellent work with FLEXI-STREAMS which we + fully support}, padded by leading zeros for values less than 0x1000. Note that this sequence is never output by the implementation. Instead, the corresponding Unicode character is output for characters whose @@ -856,13 +929,13 @@ \subsection{JSS optionally extends the Reader} The JSS contrib consitutes an additional, optional extension to the -reader in the definition of the #\" reader macro. +reader in the definition of the \#\" reader macro. \section{ASDF} -asdf-2.017 is packaged as core component of ABCL, but not intialized -by default, as it relies on the CLOS subsystem which can take a bit of -time to initialize. It may be initialized by the ANSI +asdf-2.017.22 is packaged as core component of ABCL, but not +intialized by default, as it relies on the CLOS subsystem which can +take a bit of time to initialize. It may be initialized by the ANSI \textsc{REQUIRE} mechanism as follows: \begin{listing-lisp} @@ -875,22 +948,17 @@ This contrib to ABCL enables an additional syntax for ASDF system definition which dynamically loads JVM artifacts such as jar archives -via a Maven encapsulation. +via a Maven encapsulation. The Maven Aether can also be directly +manipulated by the function associated with the RESOLVE-DEPENDENCIES symbol. -The following ASDF components are added: JAR-FILE, JAR-DIRECTORY, CLASS-FILE-DIRECTORY -and MVN. +%ABCL specific contributions to ASDF system definition mainly concerned +%with finding JVM artifacts such as jar archives to be dynamically loaded. -\section{asdf-jar} -ASDF-JAR provides a system for packaging ASDF systems into jar -archives for ABCL. Given a running ABCL image with loadable ASDF -systems the code in this package will recursively package all the -required source and fasls in a jar archive. +The following ASDF components are added: \textsc{JAR-FILE}, \textsc{JAR-DIRECTORY}, +\textsc{CLASS-FILE-DIRECTORY} and \textsc{MVN}. -\section{abcl-asdf} -ABCL specific contributions to ASDF system definition mainly concerned -with finding JVM artifacts such as jar archives to be dynamically loaded. \subsection{ABCL-ASDF Examples} @@ -907,7 +975,7 @@ We define an API as consisting of the following ASDF classes: -\textsc[JAR-DIRECTORY}, \textsc{JAR-FILE}, and +\textsc{JAR-DIRECTORY}, \textsc{JAR-FILE}, and \textsc{CLASS-FILE-DIRECTORY} for JVM artifacts that have a currently valid pathname representation @@ -930,9 +998,23 @@ "/Users/evenson/.m2/repository/com/google/gwt/gwt-user/2.4.0-rc1/gwt-user-2.4.0-rc1.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar" \end{listing-lisp} +To actually load the dependency, use the JAVA:ADD-TO-CLASSPATH generic +function: + +\begin{listing-lisp} + CL-USER> (java:add-to-classpath (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user")) +\end{listing-lisp} + Notice that all recursive dependencies have been located and installed -as well. +locally from the network as well. + + +\section{asdf-jar} +ASDF-JAR provides a system for packaging ASDF systems into jar +archives for ABCL. Given a running ABCL image with loadable ASDF +systems the code in this package will recursively package all the +required source and fasls in a jar archive. \section{jss} @@ -958,17 +1040,22 @@ \chapter{History} ABCL was originally the extension language for the J editor, which was -started in 1998 by Peter Graves. Sometime in 2003, it seems that a -lot of code that had previously not been released publically was -suddenly committed that enabled ABCL to be plausibly termed an ANSI -Common Lisp implementation. +started in 1998 by Peter Graves. Sometime in 2003, a whole lot of +code that had previously not been released publically was suddenly +committed that enabled ABCL to be plausibly termed an emergent ANSI +Common Lisp implementation canidate. + +From 2006 to 2008, Peter manned the development lists, incorporating +patches as made sense. After a suitable search, Peter nominated Erik +Huelsmann to take over the project. In 2008, the implementation was transferred to the current maintainers, who have strived to improve its usability as a contemporary Common Lisp implementation. -In 201x, with the publication of this Manual explicitly stating the -conformance of Armed Bear Common Lisp to ANSI, we release abcl-1.0. +On October 22, 2011, with the publication of this Manual explicitly +stating the conformance of Armed Bear Common Lisp to ANSI, we released +abcl-1.0.0. @@ -981,10 +1068,12 @@ [Xach2011]: Quicklisp: A system for quickly constructing Common Lisp libraries. \url{http://www.quicklisp.org/} +[RHODES2007]: Christopher Rhodes + \end{document} % TODO % 1. Create mechanism for swigging DocString and Lisp docs into -% sections. +% sections ('grovel.lisp') From mevenson at common-lisp.net Fri Oct 21 21:37:58 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 21 Oct 2011 14:37:58 -0700 Subject: [armedbear-cvs] r13661 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 21 14:37:58 2011 New Revision: 13661 Log: Backport Erik's contribution to accessing Java fields. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 14:28:49 2011 (r13660) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 14:37:58 2011 (r13661) @@ -353,6 +353,27 @@ The constructor can't be passed to \code{JAVA:JCALL}, but instead should be passed as an argument to \code{JAVA:JNEW}. +\subsubsection{Accessing Java object fields} + +Fields in Java objects can be accessed using the getter and setter functions +\code{JAVA:GETFIELD} and \code{JAVA:PUTFIELD}. This applies to values stored in object +instances. If you want to access static fields: see the next section. + +Like \code{JAVA:JCALL} and friends, values returned from these accessors carry +an intended class around and values which can be converted to Lisp values will +be converted. + +\subsubsection{Accessing Java static fields} + +Static fields in Java objects (class fields) can be accessed using the getter +and setter functions \code{JAVA:GETSTATIC} and \code{JAVA:PUTSTATIC}. Values +stored in object instance fields can be accessed as described in the previous +section. + +Like \code{JAVA:JCALL} and friends, values returned from these accessors carry +an intended class around and values which can be converted to Lisp values will +be converted. + \section{Lisp from Java} In order to access the Lisp world from Java, one needs to be aware From ehuelsmann at common-lisp.net Sat Oct 22 06:36:58 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 21 Oct 2011 23:36:58 -0700 Subject: [armedbear-cvs] r13662 - in tags/1.0.0: . abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Fri Oct 21 23:36:56 2011 New Revision: 13662 Log: Tag 1.0.0. Added: tags/1.0.0/ - copied from r13661, branches/1.0.x/ Modified: tags/1.0.0/abcl/src/org/armedbear/lisp/Version.java Modified: tags/1.0.0/abcl/src/org/armedbear/lisp/Version.java ============================================================================== --- branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java Fri Oct 21 14:37:58 2011 (r13661) +++ tags/1.0.0/abcl/src/org/armedbear/lisp/Version.java Fri Oct 21 23:36:56 2011 (r13662) @@ -41,7 +41,7 @@ { private Version() {} - static final String baseVersion = "1.0.0-dev"; + static final String baseVersion = "1.0.0"; static void init() { try { From ehuelsmann at common-lisp.net Sat Oct 22 06:38:07 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 21 Oct 2011 23:38:07 -0700 Subject: [armedbear-cvs] r13663 - branches/1.0.x/abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Fri Oct 21 23:38:07 2011 New Revision: 13663 Log: Increase branch version number with 1.0.0 tagged. Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java ============================================================================== --- branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java Fri Oct 21 23:36:56 2011 (r13662) +++ branches/1.0.x/abcl/src/org/armedbear/lisp/Version.java Fri Oct 21 23:38:07 2011 (r13663) @@ -41,7 +41,7 @@ { private Version() {} - static final String baseVersion = "1.0.0-dev"; + static final String baseVersion = "1.0.1-dev"; static void init() { try { From mevenson at common-lisp.net Sat Oct 22 07:43:16 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sat, 22 Oct 2011 00:43:16 -0700 Subject: [armedbear-cvs] r13664 - branches/1.0.x/abcl/doc/manual Message-ID: Author: mevenson Date: Sat Oct 22 00:43:15 2011 New Revision: 13664 Log: Ville: add table of contents to Manual. Modified: branches/1.0.x/abcl/doc/manual/abcl.tex Modified: branches/1.0.x/abcl/doc/manual/abcl.tex ============================================================================== --- branches/1.0.x/abcl/doc/manual/abcl.tex Fri Oct 21 23:38:07 2011 (r13663) +++ branches/1.0.x/abcl/doc/manual/abcl.tex Sat Oct 22 00:43:15 2011 (r13664) @@ -10,6 +10,8 @@ \maketitle +\tableofcontents + \chapter{Introduction} Armed Bear is a (mostly) conforming implementation of the ANSI Common From mevenson at common-lisp.net Sat Oct 22 07:45:13 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sat, 22 Oct 2011 00:45:13 -0700 Subject: [armedbear-cvs] r13665 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sat Oct 22 00:45:13 2011 New Revision: 13665 Log: User Manual rc1. Add table of contents. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sat Oct 22 00:43:15 2011 (r13664) +++ trunk/abcl/doc/manual/abcl.tex Sat Oct 22 00:45:13 2011 (r13665) @@ -5,11 +5,13 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{October 21, 2011} +\date{October 22, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle +\tableofcontents + \chapter{Introduction} Armed Bear is a (mostly) conforming implementation of the ANSI Common @@ -17,7 +19,7 @@ implementation for users of the system. \subsection{Version} -This manual corresponds to abcl-1.0.0, released on October 22, 2011. +This manual corresponds to abcl-1.0.0-dev, released on October 22, 2011. \subsection{License} From ehuelsmann at common-lisp.net Sat Oct 22 08:37:06 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 22 Oct 2011 01:37:06 -0700 Subject: [armedbear-cvs] r13666 - public_html/releases/1.0.0 Message-ID: Author: ehuelsmann Date: Sat Oct 22 01:37:03 2011 New Revision: 13666 Log: Publish 1.0.0; will update website later. Added: public_html/releases/1.0.0/ public_html/releases/1.0.0/abcl-bin-1.0.0.tar.gz (contents, props changed) public_html/releases/1.0.0/abcl-bin-1.0.0.zip (contents, props changed) public_html/releases/1.0.0/abcl-contrib-1.0.0.jar (contents, props changed) public_html/releases/1.0.0/abcl-src-1.0.0.tar.gz (contents, props changed) public_html/releases/1.0.0/abcl-src-1.0.0.zip (contents, props changed) Added: public_html/releases/1.0.0/abcl-bin-1.0.0.tar.gz ============================================================================== Binary file. No diff available. Added: public_html/releases/1.0.0/abcl-bin-1.0.0.zip ============================================================================== Binary file. No diff available. Added: public_html/releases/1.0.0/abcl-contrib-1.0.0.jar ============================================================================== Binary file. No diff available. Added: public_html/releases/1.0.0/abcl-src-1.0.0.tar.gz ============================================================================== Binary file. No diff available. Added: public_html/releases/1.0.0/abcl-src-1.0.0.zip ============================================================================== Binary file. No diff available. From ehuelsmann at common-lisp.net Sat Oct 22 09:59:42 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 22 Oct 2011 02:59:42 -0700 Subject: [armedbear-cvs] r13667 - public_html/releases/1.0.0 Message-ID: Author: ehuelsmann Date: Sat Oct 22 02:59:40 2011 New Revision: 13667 Log: Add signatures. Added: public_html/releases/1.0.0/abcl-bin-1.0.0.tar.gz.asc public_html/releases/1.0.0/abcl-bin-1.0.0.zip.asc public_html/releases/1.0.0/abcl-contrib-1.0.0.jar.asc public_html/releases/1.0.0/abcl-src-1.0.0.tar.gz.asc public_html/releases/1.0.0/abcl-src-1.0.0.zip.asc Added: public_html/releases/1.0.0/abcl-bin-1.0.0.tar.gz.asc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ public_html/releases/1.0.0/abcl-bin-1.0.0.tar.gz.asc Sat Oct 22 02:59:40 2011 (r13667) @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAk6iji0ACgkQi5O0Epaz9TkFWwCfVBj71HNLUjE9nrPXQAsNIYaG +z2YAn0p/e6XkEd85R9hTLen5QTSbuRuP +=iQpv +-----END PGP SIGNATURE----- Added: public_html/releases/1.0.0/abcl-bin-1.0.0.zip.asc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ public_html/releases/1.0.0/abcl-bin-1.0.0.zip.asc Sat Oct 22 02:59:40 2011 (r13667) @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAk6ijjEACgkQi5O0Epaz9TnO1ACfR4IaLw8jVv2CUw0qZs/nmal8 +PBcAn1Mq1A/UfsxfRYcjPu2G13/VB5MV +=yevE +-----END PGP SIGNATURE----- Added: public_html/releases/1.0.0/abcl-contrib-1.0.0.jar.asc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ public_html/releases/1.0.0/abcl-contrib-1.0.0.jar.asc Sat Oct 22 02:59:40 2011 (r13667) @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAk6ijjUACgkQi5O0Epaz9TmnvgCfXNKoQNB+pZVyIGwmuvf2z3qI +qJwAn0UCzA6k4u2N7KvdJZDWdCrQ/xo4 +=B7MH +-----END PGP SIGNATURE----- Added: public_html/releases/1.0.0/abcl-src-1.0.0.tar.gz.asc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ public_html/releases/1.0.0/abcl-src-1.0.0.tar.gz.asc Sat Oct 22 02:59:40 2011 (r13667) @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAk6ijjcACgkQi5O0Epaz9Tm/qgCeJ82sJ10E4fMdNSpU9tWhJEdo +/BsAmwXqvZr+fcYRrCvyTr9FpurYlePm +=Qwxp +-----END PGP SIGNATURE----- Added: public_html/releases/1.0.0/abcl-src-1.0.0.zip.asc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ public_html/releases/1.0.0/abcl-src-1.0.0.zip.asc Sat Oct 22 02:59:40 2011 (r13667) @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAk6ijjkACgkQi5O0Epaz9TmnVwCeLpmGS9Lx6ESz5r7uX/CO8e6P +zRoAn05NmU8L6UYn9hlPwm3N6ife/CVG +=JqYc +-----END PGP SIGNATURE----- From ehuelsmann at common-lisp.net Sun Oct 23 05:33:35 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 22 Oct 2011 22:33:35 -0700 Subject: [armedbear-cvs] r13668 - public_html Message-ID: Author: ehuelsmann Date: Sat Oct 22 22:33:34 2011 New Revision: 13668 Log: Update website for 1.0.0 release. Modified: public_html/index.shtml Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml Sat Oct 22 02:59:40 2011 (r13667) +++ public_html/index.shtml Sat Oct 22 22:33:34 2011 (r13668) @@ -54,34 +54,35 @@

-Downloads +Downloads - + +
Binary - abcl-bin-0.27.0.tar.gz - (pgp) + abcl-bin-1.0.0.tar.gz + (pgp) - abcl-bin-0.27.0.zip - (pgp) + abcl-bin-1.0.0.zip + (pgp)
Source - abcl-src-0.27.0.tar.gz - (pgp) + abcl-src-1.0.0.tar.gz + (pgp) - abcl-src-0.27.0.zip - (pgp) + abcl-src-1.0.0.zip + (pgp)
abcl-contrib-1.0.0.jar
From ehuelsmann at common-lisp.net Sun Oct 23 09:57:20 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Oct 2011 02:57:20 -0700 Subject: [armedbear-cvs] r13669 - trunk/abcl Message-ID: Author: ehuelsmann Date: Sun Oct 23 02:57:18 2011 New Revision: 13669 Log: Update CHANGES for 1.0.0. Modified: trunk/abcl/CHANGES Modified: trunk/abcl/CHANGES ============================================================================== --- trunk/abcl/CHANGES Sat Oct 22 22:33:34 2011 (r13668) +++ trunk/abcl/CHANGES Sun Oct 23 02:57:18 2011 (r13669) @@ -1,6 +1,26 @@ -Version 0.28.0 +Version 1.0.0 ============== -(untagged) +svn://common-lisp.net/project/armedbear/svn/tags/1.0.0/abcl +(22 October 2011) + + +Features +-------- + + * (Draft) manual + +Changes +------- + + * Updated ASDF to 2.017.22 + +Fixes +----- + + * CLOSURE-HTML compilation + + * DEFINE-METHOD-COMBINATION (long form) - short form didn't + need fixing Version 0.27.0 From ehuelsmann at common-lisp.net Sun Oct 23 15:56:03 2011 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 23 Oct 2011 08:56:03 -0700 Subject: [armedbear-cvs] r13670 - public_html Message-ID: Author: ehuelsmann Date: Sun Oct 23 08:56:02 2011 New Revision: 13670 Log: Fixup front page. Modified: public_html/index.shtml Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml Sun Oct 23 02:57:18 2011 (r13669) +++ public_html/index.shtml Sun Oct 23 08:56:02 2011 (r13670) @@ -68,6 +68,7 @@ abcl-bin-1.0.0.zip (pgp) + abcl-contrib-1.0.0.jar @@ -81,8 +82,6 @@ (pgp) - - abcl-contrib-1.0.0.jar From mevenson at common-lisp.net Mon Oct 24 07:37:47 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 24 Oct 2011 00:37:47 -0700 Subject: [armedbear-cvs] r13671 - branches/1.0.x/abcl Message-ID: Author: mevenson Date: Mon Oct 24 00:37:45 2011 New Revision: 13671 Log: Backport r13699: CHNAGES for 1.0.0. Modified: branches/1.0.x/abcl/CHANGES Modified: branches/1.0.x/abcl/CHANGES ============================================================================== --- branches/1.0.x/abcl/CHANGES Sun Oct 23 08:56:02 2011 (r13670) +++ branches/1.0.x/abcl/CHANGES Mon Oct 24 00:37:45 2011 (r13671) @@ -1,6 +1,26 @@ -Version 0.28.0 +Version 1.0.0 ============== -(untagged) +svn://common-lisp.net/project/armedbear/svn/tags/1.0.0/abcl +(22 October 2011) + + +Features +-------- + + * (Draft) manual + +Changes +------- + + * Updated ASDF to 2.017.22 + +Fixes +----- + + * CLOSURE-HTML compilation + + * DEFINE-METHOD-COMBINATION (long form) - short form didn't + need fixing Version 0.27.0 From mevenson at common-lisp.net Mon Oct 24 07:56:19 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 24 Oct 2011 00:56:19 -0700 Subject: [armedbear-cvs] r13672 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Mon Oct 24 00:56:18 2011 New Revision: 13672 Log: Be a little smarter about finding the abcl-contrib archive. A more optimal solution might rank possible canidates rather than picking the first one which satisfies any clause of the named conditional. Modified: trunk/abcl/src/org/armedbear/lisp/abcl-contrib.lisp Modified: trunk/abcl/src/org/armedbear/lisp/abcl-contrib.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/abcl-contrib.lisp Mon Oct 24 00:37:45 2011 (r13671) +++ trunk/abcl/src/org/armedbear/lisp/abcl-contrib.lisp Mon Oct 24 00:56:18 2011 (r13672) @@ -8,7 +8,11 @@ (defun find-system-jar () (dolist (loader (java:dump-classpath)) (let ((abcl-jar - (find-if (lambda (p) (and (equal (pathname-name p) "abcl") + (find-if (lambda (p) (and + (or (equal (pathname-name p) "abcl") + (equal (pathname-name p) + (format nil "abcl-~A" + (lisp-implementation-version)))) (equal (pathname-type p) "jar"))) (rest loader)))) (when abcl-jar From mevenson at common-lisp.net Mon Oct 24 20:03:13 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 24 Oct 2011 13:03:13 -0700 Subject: [armedbear-cvs] r13673 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Mon Oct 24 13:03:12 2011 New Revision: 13673 Log: Tag buils as abcl-1.1.0-dev for trunk. Modified: trunk/abcl/src/org/armedbear/lisp/Version.java Modified: trunk/abcl/src/org/armedbear/lisp/Version.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/Version.java Mon Oct 24 00:56:18 2011 (r13672) +++ trunk/abcl/src/org/armedbear/lisp/Version.java Mon Oct 24 13:03:12 2011 (r13673) @@ -41,7 +41,7 @@ { private Version() {} - static final String baseVersion = "0.28.0-dev"; + static final String baseVersion = "1.1.0-dev"; static void init() { try { From mevenson at common-lisp.net Mon Oct 24 20:09:21 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 24 Oct 2011 13:09:21 -0700 Subject: [armedbear-cvs] r13674 - trunk/abcl Message-ID: Author: mevenson Date: Mon Oct 24 13:09:20 2011 New Revision: 13674 Log: Finalize tags in CHANGES. Modified: trunk/abcl/CHANGES Modified: trunk/abcl/CHANGES ============================================================================== --- trunk/abcl/CHANGES Mon Oct 24 13:03:12 2011 (r13673) +++ trunk/abcl/CHANGES Mon Oct 24 13:09:20 2011 (r13674) @@ -1,6 +1,12 @@ +Version 1.1.0 +============= +svn.uri=:"http//common-lisp.net/project/armedbear/svn/trunk/abcl/" +(unreleased) + Version 1.0.0 ============== -svn://common-lisp.net/project/armedbear/svn/tags/1.0.0/abcl +svn.uri=:"http//common-lisp.net/project/armedbear/svn/tags/1.0.0/abcl/" +released at the European Common Lisp Meeting Amsterdam 2011 (22 October 2011) @@ -9,6 +15,9 @@ * (Draft) manual + * Much better Quicklisp system capabilities (trivial-garbage, + bordeaux-threads, parenscript, cxml, et. al.) + Changes ------- @@ -17,10 +26,9 @@ Fixes ----- - * CLOSURE-HTML compilation + * CLOSURE-HTML now compiles - * DEFINE-METHOD-COMBINATION (long form) - short form didn't - need fixing + * DEFINE-METHOD-COMBINATION long form implemented Version 0.27.0 From mevenson at common-lisp.net Mon Oct 24 20:18:06 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 24 Oct 2011 13:18:06 -0700 Subject: [armedbear-cvs] r13675 - trunk/abcl Message-ID: Author: mevenson Date: Mon Oct 24 13:18:06 2011 New Revision: 13675 Log: The java-1.7.0_01 from Oracle seems to work just fine. Modified: trunk/abcl/build.xml Modified: trunk/abcl/build.xml ============================================================================== --- trunk/abcl/build.xml Mon Oct 24 13:09:20 2011 (r13674) +++ trunk/abcl/build.xml Mon Oct 24 13:18:06 2011 (r13675) @@ -145,7 +145,10 @@ + + + From mevenson at common-lisp.net Tue Oct 25 06:22:04 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 24 Oct 2011 23:22:04 -0700 Subject: [armedbear-cvs] r13676 - trunk/abcl Message-ID: Author: mevenson Date: Mon Oct 24 23:22:03 2011 New Revision: 13676 Log: Start collecting optimal JVM command line options strings. Modified: trunk/abcl/abcl.properties.in Modified: trunk/abcl/abcl.properties.in ============================================================================== --- trunk/abcl/abcl.properties.in Mon Oct 24 13:18:06 2011 (r13675) +++ trunk/abcl/abcl.properties.in Mon Oct 24 23:22:03 2011 (r13676) @@ -19,6 +19,12 @@ # Set the JVM to use a maximum of 1GB of RAM (only works for 64bit JVMs) #java.options=-d64 -Xmx1g +# Use a default garbage collector on another +#java.options=-d64 -Xmx4g -XX:+PrintGCDetails -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=100 + +# Use a separate concurrent GC thread (java-1.6_14 or later) +#java.options=-d64 -Xmx8g -XX:+UseConcMarkSweepGC + # The unloading of class definitions is a per jvm policy. For those # implementations which run out of permgen space, the following should # help things out. From vvoutilainen at common-lisp.net Tue Oct 25 13:29:29 2011 From: vvoutilainen at common-lisp.net (vvoutilainen at common-lisp.net) Date: Tue, 25 Oct 2011 06:29:29 -0700 Subject: [armedbear-cvs] r13677 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: vvoutilainen Date: Tue Oct 25 06:29:23 2011 New Revision: 13677 Log: Fix #179: LIST-DIRECTORY ignores :RESOLVE-SYMLINKS flag? Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/Pathname.java Mon Oct 24 23:22:03 2011 (r13676) +++ trunk/abcl/src/org/armedbear/lisp/Pathname.java Tue Oct 25 06:29:23 2011 (r13677) @@ -1623,7 +1623,11 @@ File file = files[i]; Pathname p; if (file.isDirectory()) { - p = Utilities.getDirectoryPathname(file); + if (arg2 != NIL) { + p = Utilities.getDirectoryPathname(file); + } else { + p = new Pathname(file.getAbsolutePath()); + } } else { if (arg2 != NIL) { p = new Pathname(file.getCanonicalPath()); From mevenson at common-lisp.net Thu Oct 27 11:55:53 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 27 Oct 2011 04:55:53 -0700 Subject: [armedbear-cvs] r13678 - trunk/abcl Message-ID: Author: mevenson Date: Thu Oct 27 04:55:52 2011 New Revision: 13678 Log: Java5 JVM implementation use -XX:+CMSPermGenSweepingEnabled to GC Java classes. Modified: trunk/abcl/abcl.properties.in Modified: trunk/abcl/abcl.properties.in ============================================================================== --- trunk/abcl/abcl.properties.in Tue Oct 25 06:29:23 2011 (r13677) +++ trunk/abcl/abcl.properties.in Thu Oct 27 04:55:52 2011 (r13678) @@ -25,6 +25,9 @@ # Use a separate concurrent GC thread (java-1.6_14 or later) #java.options=-d64 -Xmx8g -XX:+UseConcMarkSweepGC +# Java 5 era (???) flag to GC class definitions +#java.options=-XX:+CMSPermGenSweepingEnabled + # The unloading of class definitions is a per jvm policy. For those # implementations which run out of permgen space, the following should # help things out. From mevenson at common-lisp.net Thu Oct 27 11:56:07 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 27 Oct 2011 04:56:07 -0700 Subject: [armedbear-cvs] r13679 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 27 04:56:07 2011 New Revision: 13679 Log: Minor manual revisions (in progress commit). Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Thu Oct 27 04:55:52 2011 (r13678) +++ trunk/abcl/doc/manual/abcl.tex Thu Oct 27 04:56:07 2011 (r13679) @@ -5,7 +5,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{October 22, 2011} +\date{October 27, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle @@ -19,7 +19,7 @@ implementation for users of the system. \subsection{Version} -This manual corresponds to abcl-1.0.0-dev, released on October 22, 2011. +This manual corresponds to abcl-1.0.0, released on October 22, 2011. \subsection{License} @@ -52,21 +52,22 @@ \textsc{ABCL} is packaged as a single jar file usually named either ``abcl.jar'' or possibly``abcl-1.0.0.jar'' if one is using a versioned package from your system vendor. This byte archive can be executed -under the control of a suitable JVM by using the ``-jar'' option to -parse the manifest, and select the named class -(\code{org.armedbear.lisp.Main}) for execution, viz: +under the control of a suitable JVM \footnote {Java Virtual Machine} +by using the ``-jar'' option to parse the manifest, and select the +class named therein ``\code{org.armedbear.lisp.Main}'' for execution, +viz: \begin{listing-shell} cmd$ java -jar abcl.jar \end{listing-shell} -N.b. for the proceeding command to work, the ``java'' executable needs +\emph{N.b.} for the proceeding command to work, the ``java'' executable needs to be in your path. To make it easier to facilitate the use of ABCL in tool chains (such as SLIME \footnote{SLIME is the Superior Lisp Mode for Interaction under Emacs}) the invocation is wrapped in a Bourne shell script -under UNIX or a DOS command script under Windows so that ABCL may be +under \textsc{UNIX} or a \textsc{DOS} command script under Windows so that ABCL may be executed simply as: \begin{listing-shell} @@ -106,7 +107,7 @@ \section{Initialization} -If the ABCL process is started without the ``--noinit'' flag, it +If the \textsc{ABCL} process is started without the ``--noinit'' flag, it attempts to load a file named ``.abclrc'' located in the user's home directory and then interpret its contents. From mevenson at common-lisp.net Thu Oct 27 13:28:54 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 27 Oct 2011 06:28:54 -0700 Subject: [armedbear-cvs] r13680 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Thu Oct 27 06:28:49 2011 New Revision: 13680 Log: Introspect docstrings from live ABCL image for the manual. Eventually, GROVEL-DOCSTRINGS-AS-TEX will produce nicely formatted and cross-reference labeled TeX source for inclusion in "java.tex", "extensions.tex", and "threads.tex". But today is not that day. Added: trunk/abcl/doc/manual/grovel.lisp Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Thu Oct 27 04:56:07 2011 (r13679) +++ trunk/abcl/doc/manual/abcl.tex Thu Oct 27 06:28:49 2011 (r13680) @@ -14,12 +14,14 @@ \chapter{Introduction} -Armed Bear is a (mostly) conforming implementation of the ANSI Common -Lisp standard. This manual documents the Armed Bear Common Lisp +Armed Bear is a conforming implementation of the ANSI Common Lisp +standard (see \ref{chapter:conformance} on page +\pageref{chapter:conformance} which states the details of the +conformance level. This manual documents the Armed Bear Common Lisp implementation for users of the system. \subsection{Version} -This manual corresponds to abcl-1.0.0, released on October 22, 2011. +This manual corresponds to abcl-1.0.0, released on October 22, 2011. \subsection{License} @@ -117,6 +119,7 @@ JVM implementation that \textsc{ABCL} finds itself hosted upon. \chapter{Conformance} +\label{chapter:conformance} \section{ANSI Common Lisp} \textsc{ABCL} is currently a (non)-conforming ANSI Common Lisp @@ -202,8 +205,9 @@ \subsection{Low-level Java API} We define a higher level Java API in the \ref{topic:Higher level Java - API: JSS}(JSS package) which is available in the \code{contrib/} \ref{topic:contrib} -directory. This package is described later in this document. This + API: JSS}(JSS package) which is available in the \code{contrib/} +\ref{topic:contrib} directory . This package is described later in +this document, see \ref{sec:jss} on page \pageref{sec:jss}. This section covers the lower level API directly available after evaluating \code{(require 'JAVA)}. @@ -1020,6 +1024,7 @@ required source and fasls in a jar archive. \section{jss} +\label{sec:jss} To one used to a syntax that can construct macros, the Java syntax sucks, so we introduce the \#" macro. Added: trunk/abcl/doc/manual/grovel.lisp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/doc/manual/grovel.lisp Thu Oct 27 06:28:49 2011 (r13680) @@ -0,0 +1,23 @@ +#-abcl We're only grovelling ABCL docstrings here. +(defun grovel-docstrings-as-tex (&optional (package (find-package :java))) + (with-open-file (stream "java.tex" :direction :output) + (loop :for symbol :being :each :external-symbol :of package + :collecting (symbol-tex symbol)))) + +(asdf:load-system 'swank) ;; XXX Does this load the SWANK-BACKEND package as well + +(defun symbol-as-tex (symbol) + "Return the TeX representation of a SYMBOL as a string." + (let (type documentation arglist + (doc (swank-backend:describe-symbol-for-emacs symbol))) + (cond ((find :function doc) + (setf type :function + documentation (second doc))) + ((find :variable doc) + (setf type :variable + documentation (second doc)))) + (warn "Unfinished implementation."))) + + + + \ No newline at end of file From mevenson at common-lisp.net Fri Oct 28 06:18:48 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 27 Oct 2011 23:18:48 -0700 Subject: [armedbear-cvs] r13681 - branches/1.0.x/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Thu Oct 27 23:18:44 2011 New Revision: 13681 Log: Backport r13677: Fix #179: LIST-DIRECTORY ignores :RESOLVE-SYMLINKS flag. Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/Pathname.java Modified: branches/1.0.x/abcl/src/org/armedbear/lisp/Pathname.java ============================================================================== --- branches/1.0.x/abcl/src/org/armedbear/lisp/Pathname.java Thu Oct 27 06:28:49 2011 (r13680) +++ branches/1.0.x/abcl/src/org/armedbear/lisp/Pathname.java Thu Oct 27 23:18:44 2011 (r13681) @@ -1623,7 +1623,11 @@ File file = files[i]; Pathname p; if (file.isDirectory()) { - p = Utilities.getDirectoryPathname(file); + if (arg2 != NIL) { + p = Utilities.getDirectoryPathname(file); + } else { + p = new Pathname(file.getAbsolutePath()); + } } else { if (arg2 != NIL) { p = new Pathname(file.getCanonicalPath()); From mevenson at common-lisp.net Fri Oct 28 08:19:47 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 28 Oct 2011 01:19:47 -0700 Subject: [armedbear-cvs] r13682 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 28 01:19:45 2011 New Revision: 13682 Log: First plausible implementation of docstring groveling (unfinished). Modified: trunk/abcl/doc/manual/grovel.lisp Modified: trunk/abcl/doc/manual/grovel.lisp ============================================================================== --- trunk/abcl/doc/manual/grovel.lisp Thu Oct 27 23:18:44 2011 (r13681) +++ trunk/abcl/doc/manual/grovel.lisp Fri Oct 28 01:19:45 2011 (r13682) @@ -2,21 +2,48 @@ (defun grovel-docstrings-as-tex (&optional (package (find-package :java))) (with-open-file (stream "java.tex" :direction :output) (loop :for symbol :being :each :external-symbol :of package - :collecting (symbol-tex symbol)))) + :collecting (symbol-as-tex symbol)))) (asdf:load-system 'swank) ;; XXX Does this load the SWANK-BACKEND package as well +(defun arglist-as-string (symbol) + (loop :for arg :in (arglist symbol) + :collecting (format nil "~A" (symbol-name arg)))) + +(defvar *type-alist* + '((:function . "Function") + (:macro . "Macro") + (:variable . "Variable") + (:generic-function . "Generic Function"))) + (defun symbol-as-tex (symbol) - "Return the TeX representation of a SYMBOL as a string." - (let (type documentation arglist - (doc (swank-backend:describe-symbol-for-emacs symbol))) - (cond ((find :function doc) + "Return the TeX representation of a SYMBOL as Tex." + (let (type documentation arglist doc) + (when (setf doc (swank-backend:describe-symbol-for-emacs symbol)) + (cond + ((find :function doc) (setf type :function - documentation (second doc))) + documentation (second doc) + arglist (arglist-as-string symbol))) ((find :variable doc) (setf type :variable + documentation (second doc))) + ((find :macro doc) + (setf type :macro + documentation (second doc))) + ((find :generic-function doc) + (setf type :generic-function documentation (second doc)))) - (warn "Unfinished implementation."))) + (format nil "\\ref{~A:~A}~&--- ~A [\\textbf{~A}]: ~A" + (symbol-name symbol) + (package-name (symbol-package symbol)) + (cdr (assoc type *type-alist*)) + (symbol-name symbol) + (package-name (symbol-package symbol)))))) + + + + From mevenson at common-lisp.net Fri Oct 28 08:19:59 2011 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 28 Oct 2011 01:19:59 -0700 Subject: [armedbear-cvs] r13683 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Fri Oct 28 01:19:59 2011 New Revision: 13683 Log: Grinding through filling in the manual. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Fri Oct 28 01:19:45 2011 (r13682) +++ trunk/abcl/doc/manual/abcl.tex Fri Oct 28 01:19:59 2011 (r13683) @@ -5,7 +5,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} -\date{October 27, 2011} +\date{October 28, 2011} \author{Mark~Evenson, Erik~Huelsmann, Alessio~Stalla, Ville~Voutilainen} \maketitle @@ -150,8 +150,16 @@ The following known problems detract from \textsc{ABCL} being a proper contemporary Comon Lisp. \begin{itemize} + + \item An incomplete implementation of interactive debugging + mechanisms namely a no-op version of + \code{STEP} \footnote{Somewhat surprisingly allowed by + \textsc{ANSI}}, the inability to inspect local variables in a + given call frame, and the inability to resume a halted computation + at an arbitrarily selected call frame. + \item An incomplete implementation of a properly named metaobject - protocol (viz. (A)MOP \footnote{Another Metaobject Protocol} ) + protocol (viz. (A)MOP \footnote{The Art of the Metaobject Protocol} ) % N.b. % TODO go through AMOP with symbols, starting by looking for @@ -165,7 +173,7 @@ byte-level manipulations. \item Incomplete documentation (missing docstrings from exported - symbols. + symbols and the draft status of the User Manual). \end{itemize} @@ -204,12 +212,12 @@ \subsection{Low-level Java API} -We define a higher level Java API in the \ref{topic:Higher level Java - API: JSS}(JSS package) which is available in the \code{contrib/} -\ref{topic:contrib} directory . This package is described later in -this document, see \ref{sec:jss} on page \pageref{sec:jss}. This -section covers the lower level API directly available after evaluating -\code{(require 'JAVA)}. +We define a higher level Java API in the topic:Higher level Java JSS +package developed by Alan Ruttenberg which is available in the +\code{contrib/} directory, see the . This package is +described later in this document, see \ref{section:jss} on page +\pageref{section:jss}. This section covers the lower level API +directly available after evaluating \code{(require 'JAVA)}. \subsubsection{Calling Java Object Methods} @@ -936,14 +944,18 @@ \subsection{JSS optionally extends the Reader} The JSS contrib consitutes an additional, optional extension to the -reader in the definition of the \#\" reader macro. +reader in the definition of the \#\" reader macro. See +\ref{section:jss} on page \pageref{section:jss} for more information. \section{ASDF} asdf-2.017.22 is packaged as core component of ABCL, but not -intialized by default, as it relies on the CLOS subsystem which can -take a bit of time to initialize. It may be initialized by the ANSI -\textsc{REQUIRE} mechanism as follows: +initialized by default, as it relies on the CLOS subsystem which can +take a bit of time to start \footnote{While this time is ``merely'' on + the order of seconds for contemporary 2011 machines, for + applications that need to initialize quickly, for example a web + server, this time might be unnecessarily long}. ASDF may be loaded +by the \textsc{ANSI} \code{REQUIRE} mechanism as follows: \begin{listing-lisp} CL-USER> (require 'asdf) @@ -951,23 +963,39 @@ \chapter{Contrib} +The ABCL contrib is packaged as a separate jar archive usually named +\code{abcl-contrib.jar} or possibly something like +\code{abcl-contrib-1.0.0.jar}. The contrib jar is not loaded by the +implementation by default, and must be first intialized by the +\code{REQUIRE} mechanism before using any specific contrib: + +\begin{listing-lisp} +CL-USER> (require 'abcl-contrib) +\end{listing-lisp} + \section{abcl-asdf} -This contrib to ABCL enables an additional syntax for ASDF system -definition which dynamically loads JVM artifacts such as jar archives -via a Maven encapsulation. The Maven Aether can also be directly -manipulated by the function associated with the RESOLVE-DEPENDENCIES symbol. +This contrib enables an additional syntax for \textsc{ASDF} system +definition which dynamically loads \textsc{JVM} artifacts such as jar +archives via encapsulation of the Maven build tool. The Maven Aether +component can also be directly manipulated by the function associated +with the \code{ABCL-ASDF:RESOLVE-DEPENDENCIES} symbol. -%ABCL specific contributions to ASDF system definition mainly concerned -%with finding JVM artifacts such as jar archives to be dynamically loaded. +%ABCL specific contributions to ASDF system definition mainly +%concerned with finding JVM artifacts such as jar archives to be +%dynamically loaded. -The following ASDF components are added: \textsc{JAR-FILE}, \textsc{JAR-DIRECTORY}, -\textsc{CLASS-FILE-DIRECTORY} and \textsc{MVN}. +The following \textsc{ASDF} components are added: \code{JAR-FILE}, +\code{JAR-DIRECTORY}, \code{CLASS-FILE-DIRECTORY} and \code{MVN}. +\subsection{Referencing Maven Artifacts via ASDF} -\subsection{ABCL-ASDF Examples} +Maven artifacts may be referenced within \textsc{ASDF} system +definitions, as the following example references the +\code{log4j-1.4.9.jar} JVM artifact which provides a widely-used +abstraction for handling logging systems: \begin{listing-lisp} ;;;; -*- Mode: LISP -*- @@ -978,76 +1006,78 @@ :version "1.4.9"))) \end{listing-lisp} -\subsection{abcl-asdf API} +\subsection{API} -We define an API as consisting of the following ASDF classes: +We define an API for \textsc{ABCL-ASDF} as consisting of the following +ASDF classes: \textsc{JAR-DIRECTORY}, \textsc{JAR-FILE}, and \textsc{CLASS-FILE-DIRECTORY} for JVM artifacts that have a currently -valid pathname representation +valid pathname representation. -And the MVN and IRI classes descend from ASDF-COMPONENT, but do not +Both the MVN and IRI classes descend from ASDF-COMPONENT, but do not directly have a filesystem location. -For use outside of ASDF, we currently define one method, -\textsc{RESOLVE-DEPENDENCIES} which locates, downloads, caches, and then loads -into the currently executing JVM process all recursive dependencies -annotated in the Maven pom.xml graph. +For use outside of ASDF system definitions, we currently define one +method, \textsc{ABCL-ASDF:RESOLVE-DEPENDENCIES} which locates, +downloads, caches, and then loads into the currently executing JVM +process all recursive dependencies annotated in the Maven pom.xml +graph. -\subsection{ABCL-ASDF Example 2} +\subsection{Directly Instructing Maven to Download JVM Artifacts} -Bypassing ASDF, one can directly issue requests for the Maven +Bypassing \textsc{ASDF}, one can directly issue requests for the Maven artifacts to be downloaded \begin{listing-lisp} - CL-USER> (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user") - WARNING: Using LATEST for unspecified version. - "/Users/evenson/.m2/repository/com/google/gwt/gwt-user/2.4.0-rc1/gwt-user-2.4.0-rc1.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar" +CL-USER> (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user") +WARNING: Using LATEST for unspecified version. +"/Users/evenson/.m2/repository/com/google/gwt/gwt-user/2.4.0-rc1/gwt-user-2.4.0-rc1.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/Users/evenson/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar" \end{listing-lisp} -To actually load the dependency, use the JAVA:ADD-TO-CLASSPATH generic +To actually load the dependency, use the \code{JAVA:ADD-TO-CLASSPATH} generic function: \begin{listing-lisp} - CL-USER> (java:add-to-classpath (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user")) +CL-USER> (java:add-to-classpath (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user")) \end{listing-lisp} Notice that all recursive dependencies have been located and installed locally from the network as well. - \section{asdf-jar} -ASDF-JAR provides a system for packaging ASDF systems into jar -archives for ABCL. Given a running ABCL image with loadable ASDF +The asdf-jar contrib provides a system for packaging ASDF systems into +jar archives for ABCL. Given a running ABCL image with loadable ASDF systems the code in this package will recursively package all the required source and fasls in a jar archive. \section{jss} -\label{sec:jss} +\label{section:jss} -To one used to a syntax that can construct macros, the Java syntax -sucks, so we introduce the \#" macro. +To one used to a syntax that can construct macros the Java syntax +may be said to suck, so we introduce the \#" macro. \subsection{JSS usage} Example: \begin{listing-lisp} - CL-USER> (require 'jss) +CL-USER> (require 'jss) - CL-USER) (#"getProperties" 'java.lang.System) +CL-USER) (#"getProperties" 'java.lang.System) - CL-USER) (#"propertyNames" (#"getProperties" 'java.lang.System)) +CL-USER) (#"propertyNames" (#"getProperties" 'java.lang.System)) \end{listing-lisp} \section{asdf-install} -An implementation of ASDF-INSTALL. Superseded by Quicklisp (qv.) +The asdf-install contrib provides an implementation of ASDF-INSTALL. +Superseded by Quicklisp (qv.) \chapter{History} -ABCL was originally the extension language for the J editor, which was +\textsc{ABCL} was originally the extension language for the J editor, which was started in 1998 by Peter Graves. Sometime in 2003, a whole lot of code that had previously not been released publically was suddenly committed that enabled ABCL to be plausibly termed an emergent ANSI @@ -1062,12 +1092,10 @@ contemporary Common Lisp implementation. On October 22, 2011, with the publication of this Manual explicitly -stating the conformance of Armed Bear Common Lisp to ANSI, we released +stating the conformance of Armed Bear Common Lisp to \textsc{ANSI}, we released abcl-1.0.0. - - \section{References} [Java2000]: A New Era for Java Protocol Handlers.