From mevenson at common-lisp.net Wed Feb 1 08:24:18 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 01 Feb 2012 00:24:18 -0800 Subject: [armedbear-cvs] r13838 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Wed Feb 1 00:24:17 2012 New Revision: 13838 Log: Partially ddresses #196: STABLE-SORT now works for non-list sequences. Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/sort.lisp Tue Jan 31 15:01:45 2012 (r13837) +++ trunk/abcl/src/org/armedbear/lisp/sort.lisp Wed Feb 1 00:24:17 2012 (r13838) @@ -42,7 +42,16 @@ (defun stable-sort (sequence predicate &rest args &key key) (sequence::seq-dispatch sequence (sort-list sequence predicate key) - (quick-sort sequence 0 (length sequence) predicate key) +;;; Jorge Tavares: +;;; As a quick fix, I send in attach a patch that uses in stable-sort merge +;;; sort for all sequences. This is done by coercing the sequence to list, +;;; calling merge sort and coercing it back to the original sequence type. +;;; However, as a long term improvement, the best solution would be to +;;; implement a merge sort for non-list sequences. + (coerce (sort-list (coerce sequence 'list) + predicate + key) + (type-of sequence)) (apply #'sequence:stable-sort sequence predicate args))) ;; Adapted from SBCL. From mevenson at common-lisp.net Wed Feb 1 10:10:32 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 01 Feb 2012 02:10:32 -0800 Subject: [armedbear-cvs] r13839 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Wed Feb 1 02:10:32 2012 New Revision: 13839 Log: Fix missing MOP:DIRECT-METHODS slot in STANDARD-CLASS introduced by r13837. @rudi: please check that this is the correct fix. Modified: trunk/abcl/src/org/armedbear/lisp/StandardClass.java Modified: trunk/abcl/src/org/armedbear/lisp/StandardClass.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/StandardClass.java Wed Feb 1 00:24:17 2012 (r13838) +++ trunk/abcl/src/org/armedbear/lisp/StandardClass.java Wed Feb 1 02:10:32 2012 (r13839) @@ -349,6 +349,7 @@ helperMakeSlotDefinition("DIRECT-SUPERCLASSES", constantlyNil), helperMakeSlotDefinition("DIRECT-SUBCLASSES", constantlyNil), helperMakeSlotDefinition("PRECEDENCE-LIST", constantlyNil), + helperMakeSlotDefinition("DIRECT-METHODS", constantlyNil), helperMakeSlotDefinition("DIRECT-SLOTS", constantlyNil), helperMakeSlotDefinition("SLOTS", constantlyNil), helperMakeSlotDefinition("DIRECT-DEFAULT-INITARGS", constantlyNil), From mevenson at common-lisp.net Wed Feb 1 10:10:34 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 01 Feb 2012 02:10:34 -0800 Subject: [armedbear-cvs] r13840 - trunk/abcl Message-ID: Author: mevenson Date: Wed Feb 1 02:10:33 2012 New Revision: 13840 Log: Fix syntactically incorrect DOAP description. Modified: trunk/abcl/abcl.rdf Modified: trunk/abcl/abcl.rdf ============================================================================== --- trunk/abcl/abcl.rdf Wed Feb 1 02:10:32 2012 (r13839) +++ trunk/abcl/abcl.rdf Wed Feb 1 02:10:33 2012 (r13840) @@ -1,8 +1,9 @@ # -*- Mode: n3 -*- - at prefix abcl: + at prefix abcl: . @prefix doap: . @prefix rdf: . + at prefix xsd: . @prefix rdfs: . <> a doap:Project. @@ -13,11 +14,9 @@ doap:label "Armed Bear Common Lisp" ; doap:download-page ; doap:license ; - - doap:programming-language """("Common Lisp" "Java" "Ant" "Shell Script") """" ; - doap:shortname "ABCL"^^xsd:string - doap:contributors """( ehu, easye, v-ille, astalla, rudi, peter)""" - + doap:programming-language """ ("Common Lisp" "Java" "Ant" "Shell Script") """ ; + doap:shortname "ABCL"^^xsd:string ; + doap:contributors """( ehu, easye, v-ille, astalla, rudi, peter)""" . doap:Project rdfs:seeAlso , From mevenson at common-lisp.net Wed Feb 1 13:25:06 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 01 Feb 2012 05:25:06 -0800 Subject: [armedbear-cvs] r13841 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Wed Feb 1 05:25:05 2012 New Revision: 13841 Log: abcl-asdf: Use *maven-http-proxy* for all Maven Aether resolutions. Increment abcl-asdf ASDF version to 0.6.0 to denote the ability to specify an http proxy for Maven. Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp trunk/abcl/contrib/abcl-asdf/packages.lisp Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd ============================================================================== --- trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd Wed Feb 1 02:10:33 2012 (r13840) +++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd Wed Feb 1 05:25:05 2012 (r13841) @@ -3,7 +3,7 @@ (defsystem :abcl-asdf :author "Mark Evenson" - :version "0.5.0" + :version "0.6.0" :depends-on (jss) :components ((:module packages :pathname "" Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Wed Feb 1 02:10:33 2012 (r13840) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Wed Feb 1 05:25:05 2012 (r13841) @@ -1,8 +1,11 @@ -;;; Use the Aether system in a default maven distribution to download +;;; Use the Aether system in a default Maven3 distribution to download ;;; and install dependencies. ;;; -;;; https://docs.sonatype.org/display/AETHER/Home -;;; +;;; References: +;;; -- javadoc +;;; http://sonatype.github.com/sonatype-aether/apidocs/overview-summary.html +;;; -- incomplete, seemingly often wrong +;;; https://docs.sonatype.org/display/AETHER/Home (in-package :abcl-asdf) @@ -16,7 +19,10 @@ (resolve-dependencies "org.apache.maven" "maven-aether-provider" "3.0.4") |# -(defvar *mavens* '("/opt/local/bin/mvn3" "mvn3" "mvn" "mvn.bat") +(defparameter *maven-verbose* t + "Stream to send output from the Maven Aether subsystem to, or NIL to muffle output") + +(defvar *mavens* '("/opt/local/bin/mvn3" "mvn3" "mvn" "mvn3.bat" "mvn.bat") "Locations to search for the Maven executable.") (defun find-mvn () @@ -25,7 +31,7 @@ (let ((mvn (handler-case (truename (read-line (sys::process-output - (sys::run-program "which" `(,mvn-path))))) + (sys::run-program "which" `(,mvn-path))))) ;; TODO equivalent for MSDOS (end-of-file () nil)))) (when mvn (return-from find-mvn mvn))))) @@ -44,6 +50,7 @@ "Location of 'maven-core-3..

.jar', 'maven-embedder-3..

.jar' etc.") (defun mvn-version () + "Return the Maven version used by the Aether connector." (let* ((line (read-line (sys::process-output (sys::run-program @@ -75,9 +82,9 @@ (defparameter *init* nil) -(defun init () +(defun init (&optional &key (force nil)) "Run the initialization strategy to bootstrap a Maven dependency node." - (unless *mvn-libs-directory* + (unless (or force *mvn-libs-directory*) (setf *mvn-libs-directory* (find-mvn-libs))) (unless (probe-file *mvn-libs-directory*) (error "You must download maven-3.0.3 or later from http://maven.apache.org/download.html, then set ABCL-ASDF:*MVN-DIRECTORY* appropiately.")) @@ -110,7 +117,7 @@ (lambda (wagon) (declare (ignore wagon))))) -(defun repository-system () +(defun make-repository-system () (unless *init* (init)) (let ((locator (java:jnew "org.apache.maven.repository.internal.DefaultServiceLocator")) @@ -134,7 +141,8 @@ (#"getService" locator repository-system-class))) -(defun new-session (repository-system) +(defun make-session (repository-system) + "Construct a new org.sonatype.aether.RepositorySystemSession from REPOSITORY-SYSTEM" (let ((session (java:jnew (jss:find-java-class "MavenRepositorySystemSession"))) (local-repository @@ -145,19 +153,9 @@ session (#"newLocalRepositoryManager" repository-system local-repository)))) -(defparameter *session* nil - "Reference to the Maven RepositorySystemSession") - (defparameter *maven-http-proxy* nil "A string containing the URI of an http proxy for Maven to use.") -(defparameter *repository-system* nil) - -(defun ensure-repository-system () - (unless *repository-system* - (setf *repository-system* (repository-system))) - *repository-system*) - (defun make-proxy () "Return an org.sonatype.aether.repository.Proxy instance initialized form *MAVEN-HTTP-PROXY*." (unless *maven-http-proxy* @@ -176,13 +174,22 @@ (jss:new 'org.sonatype.aether.repository.Proxy scheme host port authentication))) +(defparameter *repository-system* nil + "The org.sonatype.aether.RepositorySystem used by the Maeven Aether connector.") +(defun ensure-repository-system () + (unless *repository-system* + (setf *repository-system* (make-repository-system))) + *repository-system*) + +(defparameter *session* nil + "Reference to the Maven RepositorySystemSession") (defun ensure-session () "Ensure that the RepositorySystemSession has been created. If *MAVEN-HTTP-PROXY* is non-nil, parse its value as the http proxy." (unless *session* (ensure-repository-system) - (setf *session* (new-session *repository-system*)) + (setf *session* (make-session *repository-system*)) (#"setRepositoryListener" *session* (make-repository-listener)) (when *maven-http-proxy* (let ((proxy (make-proxy))) @@ -191,8 +198,8 @@ ;; A string specifying non proxy hosts, or null java:+null+)))) *session*) - +;;; TODO change this to work on artifact strings like log4j:log4j:jar:1.2.16 (defun resolve-artifact (group-id artifact-id &optional (version "LATEST" versionp)) "Directly resolve Maven dependencies for item with GROUP-ID and ARTIFACT-ID at VERSION, ignoring dependencies. @@ -200,29 +207,32 @@ If unspecified, the string \"LATEST\" will be used for the VERSION. -Returns a string containing the necessary jvm classpath entries packed -in Java CLASSPATH representation." - +Returns the Maven specific string for the artifact " (unless versionp (warn "Using LATEST for unspecified version.")) - (let* ((system - (repository-system)) - (session - (new-session system)) - (repository - (jss:new "org.sonatype.aether.repository.RemoteRepository" - "central" "default" "http://repo1.maven.org/maven2/")) - (artifact-string (format nil "~A:~A:~A" - group-id artifact-id version)) + (unless *init* (init)) + (let* ((artifact-string (format nil "~A:~A:~A" group-id artifact-id version)) (artifact (jss:new "org.sonatype.aether.util.artifact.DefaultArtifact" artifact-string)) (artifact-request (java:jnew "org.sonatype.aether.resolution.ArtifactRequest"))) (#"setArtifact" artifact-request artifact) - (#"addRepository" artifact-request repository) - (#"resolveArtifact" system session artifact-request))) + (#"addRepository" artifact-request (ensure-remote-repository)) + (#"toString" (#"resolveArtifact" (ensure-repository-system) (ensure-session) artifact-request)))) -(defparameter *aether-remote-repository* nil) ;;; TODO +(defun make-remote-repository (id type url) + (jss:new 'aether.repository.RemoteRepository id type url)) + +(defparameter *maven-remote-repository* nil + "The remote repository used by the Maven Aether embedder.") +(defun ensure-remote-repository () + (unless *init* (init)) + (unless *maven-remote-repository* + (let ((r (make-remote-repository "central" "default" "http://repo1.maven.org/maven2/"))) + (when *maven-http-proxy* + (#"setProxy" r (make-proxy))) + (setf *maven-remote-repository* r))) + *maven-remote-repository*) (defun resolve-dependencies (group-id artifact-id &optional (version "LATEST" versionp)) "Dynamically resolve Maven dependencies for item with GROUP-ID and ARTIFACT-ID at VERSION. @@ -236,25 +246,16 @@ (unless *init* (init)) (unless versionp (warn "Using LATEST for unspecified version.")) - (let* ;;((system - ;; (repository-system)) - ;; (session - ;; (new-session system)) - ((artifact + (let* ((artifact (java:jnew (jss:find-java-class "aether.util.artifact.DefaultArtifact") (format nil "~A:~A:~A" group-id artifact-id version))) (dependency (java:jnew (jss:find-java-class "aether.graph.Dependency") artifact "compile")) - (central - (java:jnew (jss:find-java-class "RemoteRepository") - "central" "default" "http://repo1.maven.org/maven2/")) (collect-request (java:jnew (jss:find-java-class "CollectRequest")))) (#"setRoot" collect-request dependency) - (when *maven-http-proxy* - (#"setProxy" central (make-proxy))) - (#"addRepository" collect-request central) + (#"addRepository" collect-request (ensure-remote-repository)) (let* ((node (#"getRoot" (#"collectDependencies" (ensure-repository-system) (ensure-session) collect-request))) (dependency-request @@ -266,32 +267,49 @@ (#"accept" node nlg) (#"getClassPath" nlg)))) -(defparameter *maven-verbose* t - "Stream to send output from the Maven Aether subsystem to, or NIL to muffle output") - (defun make-repository-listener () - ;;; XXX why does the (flet ((log (e) ...)) (java:jinterface-implementation ...) version not work? - (java:jinterface-implementation - "org.sonatype.aether.RepositoryListener" - "artifactDeployed" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactDeploying" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactDescriptorInvalid" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactDescriptorMissing" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactDownloaded" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactDownloading" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactInstalled" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactInstalling" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactResolved" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "artifactResolving" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataDeployed" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataDeploying" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataDownloaded" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataDownloading" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataInstalled" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataInstalling" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataInvalid" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataResolved" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))) - "metadataResolving" (lambda (e) (format *maven-verbose* "~&transfer-listener: ~A~%" (#"toString" e))))) + (flet ((log (e) + (format *maven-verbose* "~&~A~%" (#"toString" e)))) + (java:jinterface-implementation + "org.sonatype.aether.RepositoryListener" + "artifactDeployed" + #'log + "artifactDeploying" + #'log + "artifactDescriptorInvalid" + #'log + "artifactDescriptorMissing" + #'log + "artifactDownloaded" + #'log + "artifactDownloading" + #'log + "artifactInstalled" + #'log + "artifactInstalling" + #'log + "artifactResolved" + #'log + "artifactResolving" + #'log + "metadataDeployed" + #'log + "metadataDeploying" + #'log + "metadataDownloaded" + #'log + "metadataDownloading" + #'log + "metadataInstalled" + #'log + "metadataInstalling" + #'log + "metadataInvalid" + #'log + "metadataResolved" + #'log + "metadataResolving" + #'log))) Modified: trunk/abcl/contrib/abcl-asdf/packages.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/packages.lisp Wed Feb 1 02:10:33 2012 (r13840) +++ trunk/abcl/contrib/abcl-asdf/packages.lisp Wed Feb 1 05:25:05 2012 (r13841) @@ -15,13 +15,16 @@ ;;;; Maven #:*mvn-libs-directory* #:*maven-http-proxy* + #:make-remote-repository + #:*maven-remote-repository* #:*maven-verbose* + #:resolve-artifact + #:resolve-dependencies + #:satisfy #:as-classpath - #:resolve-artifact - #:add-directory-jars-to-class-path #:need-to-add-directory-jar? From mevenson at common-lisp.net Wed Feb 1 20:06:18 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 01 Feb 2012 12:06:18 -0800 Subject: [armedbear-cvs] r13842 - in trunk/abcl: . contrib doc/manual Message-ID: Author: mevenson Date: Wed Feb 1 12:06:17 2012 New Revision: 13842 Log: metadata+doc: Add Rudi Schlatte as a current committer. Modified: trunk/abcl/abcl.rdf trunk/abcl/contrib/pom.xml trunk/abcl/doc/manual/abcl.tex trunk/abcl/pom.xml Modified: trunk/abcl/abcl.rdf ============================================================================== --- trunk/abcl/abcl.rdf Wed Feb 1 05:25:05 2012 (r13841) +++ trunk/abcl/abcl.rdf Wed Feb 1 12:06:17 2012 (r13842) @@ -1,22 +1,28 @@ # -*- Mode: n3 -*- - at prefix abcl: . + at prefix abcl: @prefix doap: . @prefix rdf: . - at prefix xsd: . @prefix rdfs: . -<> a doap:Project. -<> rdfs:seeAlso . +<> a doap:Project . + +<> rdfs:seeAlso . +<> rdfs:seeAlso . + +<> dc:modified "01-FEB-2012" . a doap:Project ; doap:label "Armed Bear Common Lisp" ; doap:download-page ; - doap:license ; - doap:programming-language """ ("Common Lisp" "Java" "Ant" "Shell Script") """ ; - doap:shortname "ABCL"^^xsd:string ; - doap:contributors """( ehu, easye, v-ille, astalla, rudi, peter)""" . + doap:license [ + _:license , + ; + ] + doap:programming-language """("Common Lisp" "Java" "Ant" "Shell Script") """" ; + doap:shortname "ABCL"^^xsd:string + doap:contributors """( ehu easye v-ille astalla rudi peter)""" . doap:Project rdfs:seeAlso , Modified: trunk/abcl/contrib/pom.xml ============================================================================== --- trunk/abcl/contrib/pom.xml Wed Feb 1 05:25:05 2012 (r13841) +++ trunk/abcl/contrib/pom.xml Wed Feb 1 12:06:17 2012 (r13842) @@ -51,6 +51,11 @@ Alessio Stalla alessiostalla (at) gmail (dot) com + + rudi + Rudi Schlatte + rudi (at) constantly (dot) at + Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Wed Feb 1 05:25:05 2012 (r13841) +++ trunk/abcl/doc/manual/abcl.tex Wed Feb 1 12:06:17 2012 (r13842) @@ -6,7 +6,7 @@ \begin{document} \title{A Manual for Armed Bear Common Lisp} \date{January 25, 2012} -\author{Mark~Evenson, Erik~H\"{u}lsmann, Alessio~Stalla, Ville~Voutilainen} +\author{Mark~Evenson, Erik~H\"{u}lsmann, Rudi~Schlatte, Alessio~Stalla, Ville~Voutilainen} \maketitle Modified: trunk/abcl/pom.xml ============================================================================== --- trunk/abcl/pom.xml Wed Feb 1 05:25:05 2012 (r13841) +++ trunk/abcl/pom.xml Wed Feb 1 12:06:17 2012 (r13842) @@ -51,8 +51,11 @@ Alessio Stalla alessiostalla (at) gmail (dot) com + + rudi + Rudi Schlatte + rudi (at) constantly (dot) at + - - From ehuelsmann at common-lisp.net Thu Feb 2 09:38:05 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Thu, 02 Feb 2012 01:38:05 -0800 Subject: [armedbear-cvs] r13843 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Thu Feb 2 01:38:02 2012 New Revision: 13843 Log: Fix Maxima compilation failure. Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Wed Feb 1 12:06:17 2012 (r13842) +++ trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Thu Feb 2 01:38:02 2012 (r13843) @@ -467,7 +467,12 @@ */ public void bindVars(LispObject[] values, Environment env, LispThread thread) { for (int i = 0; i < variables.length; i++) { - bindArg(specials[i], variables[i], values[i], env, thread); + Symbol var = variables[i]; + // If a symbol is declared special after a function is defined, + // the interpreter binds a lexical variable instead of a dynamic + // one if we don't check isSpecialVariable() + bindArg(specials[i] || var.isSpecialVariable(), + var, values[i], env, thread); } } From mevenson at common-lisp.net Thu Feb 2 10:11:46 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 02 Feb 2012 02:11:46 -0800 Subject: [armedbear-cvs] r13844 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Thu Feb 2 02:11:46 2012 New Revision: 13844 Log: abcl-asdf: robustify strategy for finding Maven, especially under Windows. The [Maven installation instructions][maven-install] instruct the user of Maven to set the environment variables M2_HOME and M2 to reflect the local installation path, so before we start searching the environment's PATH, try to probe these locations for the 'mvn' executable. [maven-install]: http://maven.apache.org/download.html Use "where.exe" instead of "which" under Windows for the fallback strategy if the user has set neither the M2_HOME or M2 variables. "where.exe" was shipped as part of Windows Server 2003, so it may not be universally available. Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Thu Feb 2 01:38:02 2012 (r13843) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Thu Feb 2 02:11:46 2012 (r13844) @@ -1,11 +1,19 @@ -;;; Use the Aether system in a default Maven3 distribution to download -;;; and install dependencies. -;;; -;;; References: -;;; -- javadoc -;;; http://sonatype.github.com/sonatype-aether/apidocs/overview-summary.html -;;; -- incomplete, seemingly often wrong -;;; https://docs.sonatype.org/display/AETHER/Home +;;;; Use the Aether system in a localy installed Maven3 distribution to download +;;;; and install JVM artifact dependencies. + +#| + +# Implementation references + +## Installing Maven + +## Current Javadoc for Maven Aether connector +http://sonatype.github.com/sonatype-aether/apidocs/overview-summary.html + +## Incomplete, seemingly often wrong +https://docs.sonatype.org/display/AETHER/Home + +|# (in-package :abcl-asdf) @@ -26,15 +34,59 @@ "Locations to search for the Maven executable.") (defun find-mvn () - "Attempt to find a suitable Maven ('mvn') executable on the hosting operating system." - (dolist (mvn-path *mavens*) - (let ((mvn + "Attempt to find a suitable Maven ('mvn') executable on the hosting operating system. + +Returns the path of the Maven executable or nil if none are found." + + (when (and (asdf:getenv "M2_HOME") ;; TODO "anaphor" me! + (probe-file (asdf:getenv "M2_HOME"))) + (let* ((m2-home (truename (asdf:getenv "M2_HOME"))) + (mvn-executable (if (find :unix *features*) + "mvn" + "mvn.bat")) + (mvn-path (merge-pathnames + (format nil "bin/~A" mvn-executable) + m2-home)) + (mvn (truename mvn-path))) + (if mvn + (return-from find-mvn mvn) + (warn "M2_HOME was set to '~A' in the process environment but '~A' doesn't exist." + m2-home mvn-path)))) + (when (and (asdf:getenv "M2") ;; TODO "anaphor" me! + (probe-file (asdf:getenv "M2"))) + (let* ((m2 (truename (asdf:getenv "M2"))) + (mvn-executable (if (find :unix *features*) + "mvn" + "mvn.bat")) + (mvn-path (merge-pathnames mvn-executable m2)) + (mvn (truename mvn-path))) + (if mvn + (return-from find-mvn mvn) + (warn "M2 was set to '~A' in the process environment but '~A' doesn't exist." + m2 mvn-path)))) + (let* ((which-cmd + (if (find :unix *features*) + "which" + ;; Starting with Windows Server 2003 + "where.exe")) + (which-cmd-p (handler-case - (truename (read-line (sys::process-output - (sys::run-program "which" `(,mvn-path))))) ;; TODO equivalent for MSDOS - (end-of-file () nil)))) - (when mvn - (return-from find-mvn mvn))))) + (sys::run-program which-cmd nil) + (t () nil)))) + (when which-cmd-p + (dolist (mvn-path *mavens*) + (let ((mvn + (handler-case + (truename (read-line (sys::process-output + (sys::run-program + which-cmd `(,mvn-path))))) + (end-of-file () nil) + (t (e) + (format *maven-verbose* + "~&Failed to find Maven executable '~A' in PATH because~&~A" + mvn-path e))))) + (when mvn + (return-from find-mvn mvn))))))) (defun find-mvn-libs () (let ((mvn (find-mvn))) From mevenson at common-lisp.net Thu Feb 2 22:08:47 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 02 Feb 2012 14:08:47 -0800 Subject: [armedbear-cvs] r13845 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Thu Feb 2 14:08:46 2012 New Revision: 13845 Log: Refactor previous commit into something (slightly) less hideous. Maybe, I shouldn't write code sober. Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Thu Feb 2 02:11:46 2012 (r13844) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Thu Feb 2 14:08:46 2012 (r13845) @@ -38,55 +38,52 @@ Returns the path of the Maven executable or nil if none are found." - (when (and (asdf:getenv "M2_HOME") ;; TODO "anaphor" me! - (probe-file (asdf:getenv "M2_HOME"))) - (let* ((m2-home (truename (asdf:getenv "M2_HOME"))) - (mvn-executable (if (find :unix *features*) + (let ((m2-home (asdf:getenv "M2_HOME")) + (m2 (asdf:getenv "M@")) + (mvn-executable (if (find :unix *features*) "mvn" - "mvn.bat")) - (mvn-path (merge-pathnames - (format nil "bin/~A" mvn-executable) - m2-home)) - (mvn (truename mvn-path))) - (if mvn - (return-from find-mvn mvn) - (warn "M2_HOME was set to '~A' in the process environment but '~A' doesn't exist." - m2-home mvn-path)))) - (when (and (asdf:getenv "M2") ;; TODO "anaphor" me! - (probe-file (asdf:getenv "M2"))) - (let* ((m2 (truename (asdf:getenv "M2"))) - (mvn-executable (if (find :unix *features*) - "mvn" - "mvn.bat")) - (mvn-path (merge-pathnames mvn-executable m2)) - (mvn (truename mvn-path))) - (if mvn - (return-from find-mvn mvn) - (warn "M2 was set to '~A' in the process environment but '~A' doesn't exist." - m2 mvn-path)))) - (let* ((which-cmd - (if (find :unix *features*) - "which" - ;; Starting with Windows Server 2003 - "where.exe")) - (which-cmd-p - (handler-case - (sys::run-program which-cmd nil) - (t () nil)))) - (when which-cmd-p - (dolist (mvn-path *mavens*) - (let ((mvn - (handler-case - (truename (read-line (sys::process-output - (sys::run-program - which-cmd `(,mvn-path))))) - (end-of-file () nil) - (t (e) - (format *maven-verbose* - "~&Failed to find Maven executable '~A' in PATH because~&~A" - mvn-path e))))) - (when mvn - (return-from find-mvn mvn))))))) + "mvn.bat"))) + (when (and m2-home (probe-file m2-home)) + (let* ((m2-home (truename m2-home)) + (mvn-path (merge-pathnames + (format nil "bin/~A" mvn-executable) + m2-home)) + (mvn (truename mvn-path))) + (if mvn + (return-from find-mvn mvn) + (warn "M2_HOME was set to '~A' in the process environment but '~A' doesn't exist." + m2-home mvn-path)))) + (when (and m2 (probe-file m2)) + (let* ((m2 (truename m2)) + (mvn-path (merge-pathnames mvn-executable m2)) + (mvn (truename mvn-path))) + (if mvn + (return-from find-mvn mvn) + (warn "M2 was set to '~A' in the process environment but '~A' doesn't exist." + m2 mvn-path)))) + (let* ((which-cmd + (if (find :unix *features*) + "which" + ;; Starting with Windows Server 2003 + "where.exe")) + (which-cmd-p + (handler-case + (sys::run-program which-cmd nil) + (t () nil)))) + (when which-cmd-p + (dolist (mvn-path *mavens*) + (let ((mvn + (handler-case + (truename (read-line (sys::process-output + (sys::run-program + which-cmd `(,mvn-path))))) + (end-of-file () nil) + (t (e) + (format *maven-verbose* + "~&Failed to find Maven executable '~A' in PATH because~&~A" + mvn-path e))))) + (when mvn + (return-from find-mvn mvn)))))))) (defun find-mvn-libs () (let ((mvn (find-mvn))) From mevenson at common-lisp.net Thu Feb 2 22:15:07 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Thu, 02 Feb 2012 14:15:07 -0800 Subject: [armedbear-cvs] r13846 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Thu Feb 2 14:15:06 2012 New Revision: 13846 Log: abcl-asdf: fix typo in previous commit. Or maybe I shouldn't attempt to fix code (not (sober)). Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Thu Feb 2 14:08:46 2012 (r13845) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Thu Feb 2 14:15:06 2012 (r13846) @@ -39,7 +39,7 @@ Returns the path of the Maven executable or nil if none are found." (let ((m2-home (asdf:getenv "M2_HOME")) - (m2 (asdf:getenv "M@")) + (m2 (asdf:getenv "M2")) (mvn-executable (if (find :unix *features*) "mvn" "mvn.bat"))) From mevenson at common-lisp.net Fri Feb 3 14:08:21 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 03 Feb 2012 06:08:21 -0800 Subject: [armedbear-cvs] r13847 - trunk/abcl/contrib Message-ID: Author: mevenson Date: Fri Feb 3 06:08:20 2012 New Revision: 13847 Log: abcl-contrib: Create a top-level README for someone browsing the archive. Added: trunk/abcl/contrib/README.markdown Added: trunk/abcl/contrib/README.markdown ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/contrib/README.markdown Fri Feb 3 06:08:20 2012 (r13847) @@ -0,0 +1,37 @@ +ABCL-CONTRIB +============ + +The contributions to Armed Bear consitute Common Lisp only code that is +potentially useful for system construction and distribution. + + +abcl-asdf + + ABCL specific extensions to ASDF, including resolution of binary + JVM artifacts cached from the network according to Maven metadata + with the derived transitory relationships. + + +asdf-jar + + Package ASDF system defintions into JVM artifacts for distribution + + +jss + + High-order, more Lisp oriented interface to dealing with + constructing Lisp interfaces to existing binary code libraries + available for the JVM + + +asdf-install + + Install ASDF system definitions from the network. + + Deprecated, use + + CL-USER> (load "https://quicklisp.org/quicklisp.lisp") + + instead. + + From mevenson at common-lisp.net Sat Feb 4 06:56:02 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 03 Feb 2012 22:56:02 -0800 Subject: [armedbear-cvs] r13848 - trunk/abcl/contrib Message-ID: Author: mevenson Date: Fri Feb 3 22:56:01 2012 New Revision: 13848 Log: abcl-contrib: Corrections to README. Modified: trunk/abcl/contrib/README.markdown Modified: trunk/abcl/contrib/README.markdown ============================================================================== --- trunk/abcl/contrib/README.markdown Fri Feb 3 06:08:20 2012 (r13847) +++ trunk/abcl/contrib/README.markdown Fri Feb 3 22:56:01 2012 (r13848) @@ -1,7 +1,7 @@ ABCL-CONTRIB ============ -The contributions to Armed Bear consitute Common Lisp only code that is +The contributions to Armed Bear constitute Common Lisp only code that is potentially useful for system construction and distribution. @@ -9,28 +9,31 @@ ABCL specific extensions to ASDF, including resolution of binary JVM artifacts cached from the network according to Maven metadata - with the derived transitory relationships. + with the derived transitive relationships. asdf-jar - Package ASDF system defintions into JVM artifacts for distribution + Package ASDF system definitions into JVM artifacts for distribution jss - High-order, more Lisp oriented interface to dealing with - constructing Lisp interfaces to existing binary code libraries - available for the JVM + A higher-order, more Lisp oriented interface for constructing Lisp + interfaces to existing binary code libraries available for the JVM + built on the primitives provided by the JAVA package. + +Deprecated +---------- asdf-install Install ASDF system definitions from the network. - Deprecated, use + Deprecated, use Quicklisp from the REPL via - CL-USER> (load "https://quicklisp.org/quicklisp.lisp") + CL-USER> (load "http://beta.quicklisp.org/quicklisp.lisp") instead. From ehuelsmann at common-lisp.net Sat Feb 4 11:35:40 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 04 Feb 2012 03:35:40 -0800 Subject: [armedbear-cvs] r13849 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Sat Feb 4 03:35:39 2012 New Revision: 13849 Log: Switch compiled closures over to the ArgumentListProcessor completely. Removes Closure.Parameter class. Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java trunk/abcl/src/org/armedbear/lisp/Closure.java trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Fri Feb 3 22:56:01 2012 (r13848) +++ trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Sat Feb 4 03:35:39 2012 (r13849) @@ -102,39 +102,39 @@ * @param moreKeys Indicates whether &allow-other-keys was specified * @param rest Specifies the &rest variable name, if one was specified, or 'null' if none */ - public ArgumentListProcessor(Operator fun, Collection required, - Collection optional, Collection keyword, + public ArgumentListProcessor(Operator fun, int requiredCount, + OptionalParam[] optional, KeywordParam[] keyword, boolean key, boolean moreKeys, Symbol rest) { function = fun; - requiredParameters = new RequiredParam[required.size()]; - requiredParameters = required.toArray(requiredParameters); - - optionalParameters = new OptionalParam[optional.size()]; - optionalParameters = optional.toArray(optionalParameters); + requiredParameters = new RequiredParam[requiredCount]; + positionalParameters = new Param[requiredCount + optional.length + + ((rest != null) ? 1 : 0)]; + + // the same anonymous required parameter can be used any number of times + RequiredParam r = new RequiredParam(); + for (int i = 0; i < requiredCount; i++) { + requiredParameters[i] = r; + positionalParameters[i] = r; + } + + optionalParameters = optional; + System.arraycopy(optional, 0, + positionalParameters, requiredCount, optional.length); - keywordParameters = new KeywordParam[keyword.size()]; - keywordParameters = keyword.toArray(keywordParameters); - restVar = rest; if (restVar != null) - restParam = new RestParam(rest, false); - + positionalParameters[requiredCount + optional.length] = + restParam = new RestParam(rest, false); + andKey = key; allowOtherKeys = moreKeys; - - List positionalParam = new ArrayList(); - positionalParam.addAll(required); - positionalParam.addAll(optional); - if (restVar != null) - positionalParam.add(restParam); + keywordParameters = keyword; + - - positionalParameters = new Param[positionalParam.size()]; - positionalParameters = positionalParam.toArray(positionalParameters); - auxVars = new Param[0]; + variables = extractVariables(); specials = new boolean[variables.length]; // default values 'false' -- leave that way @@ -145,7 +145,7 @@ arity = (rest == null && ! allowOtherKeys && ! andKey && optionalParameters.length == 0) ? maxArgs : -1; - if (optional.isEmpty() && keyword.isEmpty()) + if (keyword.length == 0) matcher = new FastMatcher(); else matcher = new SlowMatcher(); @@ -432,6 +432,10 @@ } + public void setFunction(Operator fun) { + function = fun; + } + /** Matches the function call arguments 'args' with the lambda list, * returning an array with variable values to be used. The array is sorted * the same way as the variables returned by the 'extractVariables' function. @@ -865,6 +869,11 @@ Symbol var; boolean special; + // Used above to create anonymous required parameters + public RequiredParam() { + this(T, false); + } + public RequiredParam(Symbol var, boolean special) { this.var = var; this.special = special; @@ -894,6 +903,9 @@ boolean suppliedSpecial; InitForm initForm; + public OptionalParam(boolean suppliedVar, LispObject form) { + this(T, false, suppliedVar ? T : null, false, form); + } public OptionalParam(Symbol var, boolean special, Symbol suppliedVar, boolean suppliedSpecial, @@ -981,6 +993,10 @@ public static class KeywordParam extends OptionalParam { public Symbol keyword; + public KeywordParam(boolean suppliedVar, LispObject form, Symbol keyword) { + this(T, false, suppliedVar ? T : null, false, form, keyword); + } + public KeywordParam(Symbol var, boolean special, Symbol suppliedVar, boolean suppliedSpecial, LispObject form, Symbol keyword) { Modified: trunk/abcl/src/org/armedbear/lisp/Closure.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/Closure.java Fri Feb 3 22:56:01 2012 (r13848) +++ trunk/abcl/src/org/armedbear/lisp/Closure.java Sat Feb 4 03:35:39 2012 (r13849) @@ -36,8 +36,6 @@ import static org.armedbear.lisp.Lisp.*; -import java.util.ArrayList; - public class Closure extends Function { // Parameter types. @@ -65,37 +63,12 @@ * @param rest the &rest parameter, or NIL if none * @param moreKeys NIL if &allow-other-keys not present, T otherwise */ - public Closure(Parameter[] required, - Parameter[] optional, - Parameter[] keyword, - Symbol keys, Symbol rest, Symbol moreKeys) { + public Closure(ArgumentListProcessor arglist) { // stuff we don't need: we're a compiled function body = null; executionBody = null; environment = null; - - ArrayList reqParams = - new ArrayList(); - for (Parameter req : required) - reqParams.add(new ArgumentListProcessor.RequiredParam(req.var, false)); - - ArrayList optParams = - new ArrayList(); - for (Parameter opt : optional) - optParams.add(new ArgumentListProcessor.OptionalParam(opt.var, false, - (opt.svar == NIL) ? null : (Symbol)opt.svar, false, - opt.initForm)); - - ArrayList keyParams = - new ArrayList(); - for (Parameter key : keyword) - keyParams.add(new ArgumentListProcessor.KeywordParam(key.var, false, - (key.svar == NIL) ? null : (Symbol)key.svar, false, key.initForm, - key.keyword)); - arglist = new ArgumentListProcessor(this, reqParams, optParams, - keyParams, keys != NIL, - moreKeys != NIL, - (rest == NIL) ? null : rest); + this.arglist = arglist; freeSpecials = new Symbol[0]; } @@ -254,99 +227,6 @@ return arglist.match(args, environment, null, null); } - public static class Parameter - { - final Symbol var; - final LispObject initForm; - final LispObject initVal; - final LispObject svar; - private final int type; - final Symbol keyword; - - public Parameter(Symbol var) - { - this.var = var; - this.initForm = null; - this.initVal = null; - this.svar = NIL; - this.type = REQUIRED; - this.keyword = null; - } - - public Parameter(Symbol var, LispObject initForm, int type) - - { - this.var = var; - this.initForm = initForm; - this.initVal = processInitForm(initForm); - this.svar = NIL; - this.type = type; - keyword = - type == KEYWORD ? PACKAGE_KEYWORD.intern(var.name) : null; - } - - public Parameter(Symbol var, LispObject initForm, LispObject svar, - int type) - - { - this.var = var; - this.initForm = initForm; - this.initVal = processInitForm(initForm); - this.svar = (svar != NIL) ? checkSymbol(svar) : NIL; - this.type = type; - keyword = - type == KEYWORD ? PACKAGE_KEYWORD.intern(var.name) : null; - } - - public Parameter(Symbol keyword, Symbol var, LispObject initForm, - LispObject svar) - - { - this.var = var; - this.initForm = initForm; - this.initVal = processInitForm(initForm); - this.svar = (svar != NIL) ? checkSymbol(svar) : NIL; - type = KEYWORD; - this.keyword = keyword; - } - - @Override - public String toString() - { - if (type == REQUIRED) - return var.toString(); - StringBuffer sb = new StringBuffer(); - if (keyword != null) - { - sb.append(keyword); - sb.append(' '); - } - sb.append(var.toString()); - sb.append(' '); - sb.append(initForm); - sb.append(' '); - sb.append(type); - return sb.toString(); - } - - private static final LispObject processInitForm(LispObject initForm) - - { - if (initForm.constantp()) - { - if (initForm instanceof Symbol) - return initForm.getSymbolValue(); - if (initForm instanceof Cons) - { - Debug.assertTrue(initForm.car() == Symbol.QUOTE); - return initForm.cadr(); - } - return initForm; - } - return null; - } - } - // ### lambda-list-names private static final Primitive LAMBDA_LIST_NAMES = new Primitive("lambda-list-names", PACKAGE_SYS, true) Modified: trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java Fri Feb 3 22:56:01 2012 (r13848) +++ trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java Sat Feb 4 03:35:39 2012 (r13849) @@ -41,12 +41,9 @@ public ClosureBinding[] ctx; - public CompiledClosure(Parameter[] required, - Parameter[] optional, - Parameter[] keyword, - Symbol keys, Symbol rest, Symbol moreKeys) + public CompiledClosure(ArgumentListProcessor arglist) { - super(required, optional, keyword, keys, rest, moreKeys); + super(arglist); } Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Fri Feb 3 22:56:01 2012 (r13848) +++ trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Sat Feb 4 03:35:39 2012 (r13849) @@ -949,12 +949,13 @@ :flags '(:public))) ;; We don't normally need to see debugging output for constructors. (super (class-file-superclass class)) - req-params-register opt-params-register key-params-register + req-count rest-p keys-p - more-keys-p) + more-keys-p + alp-register) (with-code-to-method (class method) (allocate-register nil) (unless (eq super +lisp-compiled-primitive+) @@ -964,13 +965,14 @@ (parse-lambda-list args) (setf rest-p rest more-keys-p allow-other-keys-p - keys-p key-p) + keys-p key-p + req-count (length req)) (macrolet - ((parameters-to-array ((param params register) &body body) + ((parameters-to-array ((param params register class) &body body) (let ((count-sym (gensym))) `(progn (emit-push-constant-int (length ,params)) - (emit-anewarray +lisp-closure-parameter+) + (emit-anewarray ,class) (astore (setf ,register *registers-allocated*)) (allocate-register nil) (do* ((,count-sym 0 (1+ ,count-sym)) @@ -980,28 +982,25 @@ (declare (ignorable ,param)) (aload ,register) (emit-push-constant-int ,count-sym) - (emit-new +lisp-closure-parameter+) + (emit-new ,class) (emit 'dup) , at body (emit 'aastore)))))) - ;; process required args - (parameters-to-array (ignore req req-params-register) - (emit-push-t) ;; we don't need the actual symbol - (emit-invokespecial-init +lisp-closure-parameter+ - (list +lisp-symbol+))) - - (parameters-to-array (param opt opt-params-register) - (emit-push-t) ;; we don't need the actual variable-symbol + (parameters-to-array (param opt opt-params-register + +alp-optional-parameter+) + (if (null (third param)) ;; supplied-p or not? + (emit 'iconst_0) + (emit 'iconst_1)) (emit-read-from-string (second param)) ;; initform - (if (null (third param)) ;; supplied-p - (emit-push-nil) - (emit-push-t)) ;; we don't need the actual supplied-p symbol - (emit-getstatic +lisp-closure+ "OPTIONAL" :int) - (emit-invokespecial-init +lisp-closure-parameter+ - (list +lisp-symbol+ +lisp-object+ - +lisp-object+ :int))) + (emit-invokespecial-init +alp-optional-parameter+ + (list :boolean +lisp-object+))) - (parameters-to-array (param key key-params-register) + (parameters-to-array (param key key-params-register + +alp-keyword-parameter+) + (if (null (third param)) ;; supplied-p or not? + (emit 'iconst_0) + (emit 'iconst_1)) + (emit-read-from-string (second param)) ;; initform (let ((keyword (fourth param))) (if (keywordp keyword) (progn @@ -1016,38 +1015,49 @@ (emit-invokestatic +lisp+ "internInPackage" (list +java-string+ +java-string+) +lisp-symbol+)))) - (emit-push-t) ;; we don't need the actual variable-symbol - (emit-read-from-string (second (car key))) - (if (null (third param)) - (emit-push-nil) - (emit-push-t)) ;; we don't need the actual supplied-p symbol - (emit-invokespecial-init +lisp-closure-parameter+ - (list +lisp-symbol+ +lisp-symbol+ - +lisp-object+ +lisp-object+)))))) + (emit-invokespecial-init +alp-keyword-parameter+ + (list :boolean +lisp-object+ + +lisp-symbol+)))))) (aload 0) ;; this (cond ((eq super +lisp-compiled-primitive+) (emit-constructor-lambda-name lambda-name) (emit-constructor-lambda-list args) (emit-invokespecial-init super (lisp-object-arg-types 2))) - ((equal super +lisp-compiled-closure+) ;;### only needs EQ when SUPER is guaranteed to be CLASS-NAME - (aload req-params-register) + ((equal super +lisp-compiled-closure+) + ;;### only needs EQ when SUPER is guaranteed to be CLASS-NAME + (emit-new +argument-list-processor+) + (emit 'dup) + (emit 'dup) + (astore (setf alp-register (allocate-register nil))) + (emit 'aconst_null) + (emit-push-int req-count) (aload opt-params-register) (aload key-params-register) (if keys-p - (emit-push-t) - (emit-push-nil-symbol)) - (if rest-p - (emit-push-t) - (emit-push-nil-symbol)) + (emit 'iconst_1) + (emit 'iconst_0)) (if more-keys-p + (emit 'iconst_1) + (emit 'iconst_0)) + (if rest-p (emit-push-t) - (emit-push-nil-symbol)) + (emit 'aconst_null)) + (emit-invokespecial-init +argument-list-processor+ + (list + +lisp-operator+ + :int + (class-array +alp-optional-parameter+) + (class-array +alp-keyword-parameter+) + :boolean + :boolean + +lisp-symbol+)) (emit-invokespecial-init super - (list +lisp-closure-parameter-array+ - +lisp-closure-parameter-array+ - +lisp-closure-parameter-array+ - +lisp-symbol+ - +lisp-symbol+ +lisp-symbol+))) + (list +argument-list-processor+)) + (aload alp-register) + (aload 0) + (emit-invokevirtual +argument-list-processor+ + "setFunction" + (list +lisp-operator+) nil)) (t (sys::%format t "unhandled superclass ~A for ~A~%" super Modified: trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp Fri Feb 3 22:56:01 2012 (r13848) +++ trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp Sat Feb 4 03:35:39 2012 (r13849) @@ -136,6 +136,7 @@ (define-class-name +java-string+ "java.lang.String") (define-class-name +java-system+ "java.lang.System") (define-class-name +java-io-input-stream+ "java.io.InputStream") +(define-class-name +java-util-collection+ "java.util.Collection") (define-class-name +lisp-object+ "org.armedbear.lisp.LispObject") (defconstant +lisp-object-array+ (class-array +lisp-object+)) (define-class-name +lisp-simple-string+ "org.armedbear.lisp.SimpleString") @@ -177,10 +178,17 @@ (define-class-name +lisp-package+ "org.armedbear.lisp.Package") (define-class-name +lisp-readtable+ "org.armedbear.lisp.Readtable") (define-class-name +lisp-stream+ "org.armedbear.lisp.Stream") +(define-class-name +lisp-operator+ "org.armedbear.lisp.Operator") (define-class-name +lisp-closure+ "org.armedbear.lisp.Closure") (define-class-name +lisp-compiled-closure+ "org.armedbear.lisp.CompiledClosure") -(define-class-name +lisp-closure-parameter+ - "org.armedbear.lisp.Closure$Parameter") +(define-class-name +argument-list-processor+ + "org.armedbear.lisp.ArgumentListProcessor") +(define-class-name +alp-required-parameter+ + "org.armedbear.lisp.ArgumentListProcessor$RequiredParam") +(define-class-name +alp-optional-parameter+ + "org.armedbear.lisp.ArgumentListProcessor$OptionalParam") +(define-class-name +alp-keyword-parameter+ + "org.armedbear.lisp.ArgumentListProcessor$KeywordParam") (defconstant +lisp-closure-parameter-array+ (class-array +lisp-closure-parameter+)) From ehuelsmann at common-lisp.net Sat Feb 4 13:09:36 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 04 Feb 2012 05:09:36 -0800 Subject: [armedbear-cvs] r13850 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Sat Feb 4 05:09:35 2012 New Revision: 13850 Log: Remove Closure.fastProcessArgs(): it's concept has been abstracted away in ArgumentListProcessor. Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java trunk/abcl/src/org/armedbear/lisp/Closure.java trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Sat Feb 4 03:35:39 2012 (r13849) +++ trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Sat Feb 4 05:09:35 2012 (r13850) @@ -545,6 +545,62 @@ /** ArgumentMatcher class which implements full-blown argument matching, * including validation of the keywords passed. */ private class SlowMatcher extends ArgumentMatcher { + private LispObject[] _match(LispObject[] args, Environment _environment, + Environment env, LispThread thread) { + final ArgList argslist = new ArgList(_environment, args); + final LispObject[] array = new LispObject[variables.length]; + int index = 0; + + + for (Param p : positionalParameters) + index = p.assign(index, array, argslist, env, thread); + + if (andKey) { + argslist.assertRemainderKeywords(); + + for (Param p : keywordParameters) + index = p.assign(index, array, argslist, env, thread); + } + for (Param p : auxVars) + index = p.assign(index, array, argslist, env, thread); + + if (andKey) { + if (allowOtherKeys) + return array; + + if (!argslist.consumed()) // verify keywords + { + LispObject allowOtherKeysValue = + argslist.findKeywordArg(Keyword.ALLOW_OTHER_KEYS, NIL); + + if (allowOtherKeysValue != NIL) + return array; + + // verify keywords + next_key: + while (! argslist.consumed()) { + LispObject key = argslist.consume(); + argslist.consume(); // consume value + + if (key == Keyword.ALLOW_OTHER_KEYS) + continue next_key; + + for (KeywordParam k : keywordParameters) + if (k.keyword == key) + continue next_key; + + error(new ProgramError("Unrecognized keyword argument " + + key.printObject())); + } + } + } + + if (restVar == null && !argslist.consumed()) + error(new WrongNumberOfArgumentsException(function)); + + return array; + } + @Override LispObject[] match(LispObject[] args, Environment _environment, Environment env, LispThread thread) { @@ -560,60 +616,12 @@ if (args.length < minArgs) error(new WrongNumberOfArgumentsException(function, minArgs, -1)); + if (thread == null) + return _match(args, _environment, env, thread); final SpecialBindingsMark mark = thread.markSpecialBindings(); - final LispObject[] array = new LispObject[variables.length]; - int index = 0; - ArgList argslist = new ArgList(_environment, args); - try { - for (Param p : positionalParameters) - index = p.assign(index, array, argslist, env, thread); - - if (andKey) { - argslist.assertRemainderKeywords(); - - for (Param p : keywordParameters) - index = p.assign(index, array, argslist, env, thread); - } - for (Param p : auxVars) - index = p.assign(index, array, argslist, env, thread); - - if (andKey) { - if (allowOtherKeys) - return array; - - if (!argslist.consumed()) // verify keywords - { - LispObject allowOtherKeysValue = - argslist.findKeywordArg(Keyword.ALLOW_OTHER_KEYS, NIL); - - if (allowOtherKeysValue != NIL) - return array; - - // verify keywords - next_key: - while (! argslist.consumed()) { - LispObject key = argslist.consume(); - argslist.consume(); // consume value - - if (key == Keyword.ALLOW_OTHER_KEYS) - continue next_key; - - for (KeywordParam k : keywordParameters) - if (k.keyword == key) - continue next_key; - - error(new ProgramError("Unrecognized keyword argument " + - key.printObject())); - } - } - } - - if (restVar == null && !argslist.consumed()) - error(new WrongNumberOfArgumentsException(function)); - - return array; + return _match(args, _environment, env, thread); } finally { thread.resetSpecialBindings(mark); Modified: trunk/abcl/src/org/armedbear/lisp/Closure.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/Closure.java Sat Feb 4 03:35:39 2012 (r13849) +++ trunk/abcl/src/org/armedbear/lisp/Closure.java Sat Feb 4 05:09:35 2012 (r13850) @@ -221,12 +221,6 @@ return arglist.match(args, environment, environment, thread); } - // No optional or keyword parameters. - protected final LispObject[] fastProcessArgs(LispObject[] args) - { - return arglist.match(args, environment, null, null); - } - // ### lambda-list-names private static final Primitive LAMBDA_LIST_NAMES = new Primitive("lambda-list-names", PACKAGE_SYS, true) Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Sat Feb 4 03:35:39 2012 (r13849) +++ trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Sat Feb 4 05:09:35 2012 (r13850) @@ -7046,7 +7046,6 @@ (let* ((p1-result (compiland-p1-result compiland)) (class-file (compiland-class-file compiland)) (*this-class* (abcl-class-file-class class-file)) - (args (cadr p1-result)) (closure-args (intersection *closure-variables* (compiland-arg-vars compiland))) (local-closure-vars @@ -7233,24 +7232,16 @@ (aload 0) ; this (aver (not (null (compiland-argument-register compiland)))) (aload (compiland-argument-register compiland)) ; arg vector - (cond ((or (memq '&OPTIONAL args) (memq '&KEY args)) - (ensure-thread-var-initialized) - (maybe-initialize-thread-var) - (emit-push-current-thread) - (emit-invokevirtual *this-class* "processArgs" - (list +lisp-object-array+ +lisp-thread+) - +lisp-object-array+)) - (t - (emit-invokevirtual *this-class* "fastProcessArgs" - (list +lisp-object-array+) - +lisp-object-array+))) + (emit 'aconst_null) ;; no thread arg required: + ;; there's no non-constant initform or special + ;; which might require the thread + (emit-invokevirtual *this-class* "processArgs" + (list +lisp-object-array+ +lisp-thread+) + +lisp-object-array+) (astore (compiland-argument-register compiland))) - (unless (and *hairy-arglist-p* - (or (memq '&OPTIONAL args) (memq '&KEY args))) - (maybe-initialize-thread-var)) - (setf *code* (nconc code *code*))) - )) + (maybe-initialize-thread-var) + (setf *code* (nconc code *code*))))) t) (defun compile-to-jvm-class (compiland) Modified: trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp Sat Feb 4 03:35:39 2012 (r13849) +++ trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp Sat Feb 4 05:09:35 2012 (r13850) @@ -189,8 +189,6 @@ "org.armedbear.lisp.ArgumentListProcessor$OptionalParam") (define-class-name +alp-keyword-parameter+ "org.armedbear.lisp.ArgumentListProcessor$KeywordParam") -(defconstant +lisp-closure-parameter-array+ - (class-array +lisp-closure-parameter+)) #| From ehuelsmann at common-lisp.net Sat Feb 4 15:53:23 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 04 Feb 2012 07:53:23 -0800 Subject: [armedbear-cvs] r13851 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Sat Feb 4 07:53:21 2012 New Revision: 13851 Log: Force FASL recompilation due to Closure.java ABI changes: increase FASL number. Modified: trunk/abcl/src/org/armedbear/lisp/Load.java Modified: trunk/abcl/src/org/armedbear/lisp/Load.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/Load.java Sat Feb 4 05:09:35 2012 (r13850) +++ trunk/abcl/src/org/armedbear/lisp/Load.java Sat Feb 4 07:53:21 2012 (r13851) @@ -346,7 +346,7 @@ // ### *fasl-version* // internal symbol static final Symbol _FASL_VERSION_ = - exportConstant("*FASL-VERSION*", PACKAGE_SYS, Fixnum.getInstance(38)); + exportConstant("*FASL-VERSION*", PACKAGE_SYS, Fixnum.getInstance(39)); // ### *fasl-external-format* // internal symbol From mevenson at common-lisp.net Sat Feb 4 19:08:04 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sat, 04 Feb 2012 11:08:04 -0800 Subject: [armedbear-cvs] r13852 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Sat Feb 4 11:08:03 2012 New Revision: 13852 Log: CL:SORT implementation replace non-optimal quicksort with public version. With these changes, SORT seems to be a little faster (for vectors) although I was not worried with optimizations. In ABCL 1.0.1, in my machine, sorting 1000000 random integers takes around 10s on average while now it takes 2s. However, I must point out I didn't do any serious and proper benchmarking, just some runs. I will be happy to answer any questions if necessary. Cheers, Jorge Tavares Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/sort.lisp Sat Feb 4 07:53:21 2012 (r13851) +++ trunk/abcl/src/org/armedbear/lisp/sort.lisp Sat Feb 4 11:08:03 2012 (r13852) @@ -36,7 +36,7 @@ (defun sort (sequence predicate &rest args &key key) (sequence::seq-dispatch sequence (sort-list sequence predicate key) - (quick-sort sequence 0 (length sequence) predicate key) + (quicksort sequence 0 (1- (length sequence)) predicate (or key #'identity)) (apply #'sequence:sort sequence predicate args))) (defun stable-sort (sequence predicate &rest args &key key) @@ -182,6 +182,56 @@ (if (eq list-1 (cdr head)) (return list-1)))))) +#| +<> dc:author "Jorge Tavares" ; + dc:description +""" +The quicksort function picks the pivot by selecting a midpoint and +also sorts the smaller partition first. These are enough to avoid the +stack overflow problem as reported. I've performed some tests and it +looks it is correct +"""" . +|# +;;; +;;; QUICKSORT +;;; - the pivot is a middle point +;;; - sorts the smaller partition first +;;; +(defun quicksort (vector start end predicate key) + (declare (type fixnum start end) + (type function predicate key)) + (if (< start end) + (let* ((i start) + (j (1+ end)) + (p (+ start (ash (- end start) -1))) + (d (aref vector p)) + (kd (funcall key d))) + (rotatef (aref vector p) (aref vector start)) + (block outer-loop + (loop + (loop + (unless (> (decf j) i) (return-from outer-loop)) + (when (funcall predicate + (funcall key (aref vector j)) kd) + (return))) + (loop + (unless (< (incf i) j) (return-from outer-loop)) + (unless (funcall predicate + (funcall key (aref vector i)) kd) + (return))) + (rotatef (aref vector i) (aref vector j)))) + (setf (aref vector start) (aref vector j) + (aref vector j) d) + (if (< (- j start) (- end j)) + (progn + (quicksort vector start (1- j) predicate key) + (quicksort vector (1+ j) end predicate key)) + (progn + (quicksort vector (1+ j) end predicate key) + (quicksort vector start (1- j) predicate key)))) + vector)) + +;;; DEPRECATED -- to be removed in abcl-1.4 ;;; From ECL. (defun quick-sort (seq start end pred key) (unless key (setq key #'identity)) From rschlatte at common-lisp.net Sat Feb 4 21:58:40 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Sat, 04 Feb 2012 13:58:40 -0800 Subject: [armedbear-cvs] r13853 - trunk/abcl/doc/manual Message-ID: Author: rschlatte Date: Sat Feb 4 13:58:39 2012 New Revision: 13853 Log: Linkify manual. Also some light adjustments to contents. Modified: trunk/abcl/doc/manual/abcl.bib trunk/abcl/doc/manual/abcl.sty trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.bib ============================================================================== --- trunk/abcl/doc/manual/abcl.bib Sat Feb 4 11:08:03 2012 (r13852) +++ trunk/abcl/doc/manual/abcl.bib Sat Feb 4 13:58:39 2012 (r13853) @@ -1,6 +1,6 @@ @Misc{maso2000, author = {Brian Maso}, - title = {{A New Era for Java Protocol Handlers}}, + title = {A New Era for {Java} Protocol Handlers}, howpublished = {\url{http://java.sun.com/developer/onlineTraining/protocolhandlers/}}, month = aug, year = 2000, @@ -39,3 +39,38 @@ year = {1991}, } + at Misc{CLHS, + key = {CLHS}, + author = {Pitman, Kent and others}, + title = {{Common Lisp HyperSpec}}, + howpublished = {\url{http://www.lispworks.com/documentation/HyperSpec/Front/index.htm}}, + year = 1996, + note = {Last accessed Feb 4, 2012}, +} + + at Misc{AMOPspec, + key = {AMOP}, + author = {Kiczales, Gregor and des Rivi?res, Jim and Bobrow, Daniel G.}, + title = {{The Common Lisp Object System} MetaObject Protocol}, + howpublished = {\url{http://www.alu.org/mop/index.html}}, + year = 1997, + note = {Last accessed Feb 4, 2012}, +} + + at Misc{slime, + key = {slime}, + title = {{SLIME: The Superior Lisp Interaction Mode for Emacs}}, + howpublished = {\url{http://common-lisp.net/project/slime/}}, + note = {Last accessed Feb 4, 2012}, +} + + at TechReport{jsr-223, + author = {Mike Grogan}, + title = {Scripting for the {Java} Platform}, + institution = {Sun Microsystems, Inc.}, + year = 2006, + type = {Final Draft Specification}, + number = {JSR-223}, + note = {\url{http://jcp.org/aboutJava/communityprocess/final/jsr223/index.html}}, +} + Modified: trunk/abcl/doc/manual/abcl.sty ============================================================================== --- trunk/abcl/doc/manual/abcl.sty Sat Feb 4 11:08:03 2012 (r13852) +++ trunk/abcl/doc/manual/abcl.sty Sat Feb 4 13:58:39 2012 (r13853) @@ -12,8 +12,8 @@ \usepackage{a4wide} -\newcommand{\code}[1]{ - \texttt{#1} +\newcommand{\code}[1]{% + \texttt{#1}% } \usepackage{listings} Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sat Feb 4 11:08:03 2012 (r13852) +++ trunk/abcl/doc/manual/abcl.tex Sat Feb 4 13:58:39 2012 (r13853) @@ -3,10 +3,16 @@ \documentclass[10pt]{book} \usepackage{abcl} +\usepackage{hyperref} % Put this one last, it redefines lots of internals + + \begin{document} -\title{A Manual for Armed Bear Common Lisp} -\date{January 25, 2012} -\author{Mark~Evenson, Erik~H\"{u}lsmann, Rudi~Schlatte, Alessio~Stalla, Ville~Voutilainen} +\title{Armed Bear Common Lisp User Manual} +\date{Version 1.1.0-dev\\ +\smallskip +January 25, 2012} +\author{Mark Evenson \and Erik H\"{u}lsmann \and Rudolf Schlatte \and + Alessio Stalla \and Ville Voutilainen} \maketitle @@ -14,173 +20,160 @@ \chapter{Introduction} -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.1.0-dev, as yet unreleased.. - -\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. +Armed Bear Common Lisp (ABCL) is an implementation of Common Lisp that +runs on the Java Virtual Machine. It compiles to Java bytecode and +integrates with Java code and libraries in a seamless way: +\begin{itemize} +\item Lisp code can create Java objects and call their methods (see + Section~\ref{sec:lisp-java}, page~\pageref{sec:lisp-java}). +\item Java code can call Lisp functions and generic functions, either + directly (Section~\ref{sec:calling-lisp-from-java}, + page~\pageref{sec:calling-lisp-from-java}) or via \texttt{JSR-223} + (Section~\ref{sec:java-scripting-api}, + page~\pageref{sec:java-scripting-api}). +\item \code{jinterface-implementation} creates Lisp-side implementations + of Java interfaces that can be used as listeners for Swing classes and + similar. +\end{itemize} +ABCL is supported by the Lisp library manager +QuickLisp\footnote{\url{http://quicklisp.org/}} and can run many of the +programs and libraries provided therein out-of-the-box. -\subsection{Contributors} +\section{Conformance} +\label{section:conformance} -% TODO format this better, optionally link to URI +\subsection{ANSI Common Lisp} +\textsc{ABCL} is currently a (non)-conforming ANSI Common Lisp +implementation due to the following known issues: \begin{itemize} -\item Philipp Marek -\texttt{Thanks for the markup} -\item Douglas Miles -\texttt{Thanks for the whacky IKVM stuff and keeping the flame alive - in the dark years.} +\item The generic function signatures of the \code{DOCUMENTATION} symbol + do not match the specification. +\item The \code{TIME} form does not return a proper \code{VALUES} + environment to its caller. +\end{itemize} + +Somewhat confusingly, this statement of non-conformance in the +accompanying user documentation fulfills the requirements that +\textsc{ABCL} is a conforming ANSI Common Lisp implementation according +to the Common Lisp HyperSpec~\cite{CLHS}. 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. +\subsection{Contemporary Common Lisp} +In addition to ANSI conformance, \textsc{ABCL} strives to implement +features expected of a contemporary Common Lisp, i.e. a Lisp of the +post-2005 Renaissance. -\item Alan Ruttenberg -\texttt{Thanks for JSS.} +The following known problems detract from \textsc{ABCL} being a proper +contemporary Common 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 proper metaobject protocol + (c.f. the (A)MOP specification~\cite{AMOP, AMOPspec}) +\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 + and the draft status of this user manual). +\end{itemize} + + +\section{License} + +ABCL is licensed under the terms of the GPL v2 of June 1991 with the +``classpath-exception'' (see the file \texttt{COPYING} in the source +distribution for the license, term 13 in the same file for the classpath +exception). This license broadly means that you must distribute the +sources to ABCL, including any changes you make, together with a program +that includes ABCL, but that you are not required to distribute the +sources of the whole program. Submitting your changes upstream to the +ABCL development team is actively encouraged and very much appreciated, +of course. + +\section{Contributors} + +\begin{itemize} +\item Philipp Marek \texttt{Thanks for the markup} +\item Douglas Miles \texttt{Thanks for the whacky IKVM stuff and keeping the flame alive + in the dark years.} +\item Alan Ruttenberg \texttt{Thanks for JSS.} \item and of course \emph{Peter Graves} \end{itemize} -\chapter{Running} +\chapter{Running ABCL} \textsc{ABCL} is packaged as a single jar file usually named either -``abcl.jar'' or possibly``abcl-1.0.1.jar'' if one is using a versioned -package on the local filesystem from your system vendor. This byte -archive can be executed 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: +\texttt{abcl.jar} or possibly something like \texttt{abcl-1.0.1.jar} if +using a versioned package on the local filesystem from your system +vendor. This jar file can be executed from the command line to obtain a +REPL\footnote{Read-Eval Print Loop, a Lisp commandline}, viz: \begin{listing-shell} cmd$ java -jar abcl.jar -\end{listing-shell} +\end{listing-shell} %$ unconfuse Emacs syntax highlighting -\emph{N.b.} for the proceeding command to work, the ``java'' executable needs -to be in your path. +\emph{N.b.} for the proceeding command to work, the \texttt{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 \textsc{UNIX} or a \textsc{DOS} command script under Windows so that ABCL may be -executed simply as: +To facilitate the use of ABCL in tool chains such as SLIME~\cite{slime} +(the Superior Lisp Interaction Mode for Emacs), we provide both a Bourne +shell script and a \textsc{DOS} batch file. If you or your +administrator adjusted the path properly, ABCL may be executed simply +as: \begin{listing-shell} cmd$ abcl -\end{listing-shell} +\end{listing-shell}%$ + +Probably the easiest way of setting up an editing environment using the +Emacs editor is to use QuickLisp and follow the instructions at +\url{http://www.quicklisp.org/beta/#slime}. \section{Options} ABCL supports the following command line options: -\begin{verbatim} ---help - Displays this message. ---noinform - Suppresses the printing of startup information and banner. ---noinit - Suppresses the loading of the '~/.abclrc' startup file. ---nosystem - Suppresses loading the 'system.lisp' customization file. ---eval

- Evaluates the before initializing REPL. ---load - Loads the file before initializing REPL. ---load-system-file - Loads the system file before initializing REPL. ---batch - The process evaluates forms specified by arguments and possibly by those - by those in the intialization file '~/.abcl', and then exits. - -The occurance of '--' copies the remaining arguments, unprocessed, into -the variable EXTENSIONS:*COMMAND-LINE-ARGUMENT-LIST*. -\end{verbatim} - -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. +\begin{description} +\item[\texttt{--help}] displays a help message. +\item[\texttt{--noinform}] Suppresses the printing of startup information and banner. +\item[\texttt{--noinit}] suppresses the loading of the \texttt{\~/.abclrc} startup file. +\item[\texttt{--nosystem}] suppresses loading the \texttt{system.lisp} customization file. +\item[\texttt{--eval FORM}] evaluates FORM before initializing the REPL. +\item[\texttt{--load FILE}] loads the file FILE before initializing the REPL. +\item[\texttt{--load-system-file FILE}] loads the system file FILE before initializing the REPL. +\item[\texttt{--batch}] evaluates forms specified by arguments and in + the intialization file \texttt{\~/.abclrc}, and then exits without + starting a REPL. +\end{description} + +All of the command line arguments following the occurrence of \verb+--+ +are passed unprocessed into a list of strings accessible via the +variable \code{EXT:*COMMAND-LINE-ARGUMENT-LIST*} from within ABCL. \section{Initialization} -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. +If the \textsc{ABCL} process is started without the \code{--noinit} +flag, it attempts to load a file named \code{.abclrc} in the user's home +directory and then interpret its contents. The user's home directory is determined by the value of the JVM system -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} -\label{chapter:conformance} - -\section{ANSI Common Lisp} -\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 environment to - its caller. -\end{itemize} - -Somewhat confusingly, this statement of non-conformance in the -accompanying user documentation fulfills 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 \footnote{i.e. a Lisp of the - post 2005 Renaissance} +property \texttt{user.home}. This value may or may not correspond +to the value of the \texttt{HOME} system environment variable, at the +discretion of the JVM implementation that \textsc{ABCL} finds itself +hosted upon. -\subsection{Deficiencies} -The following known problems detract from \textsc{ABCL} being a proper -contemporary Common 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 (c.f. the (A)MOP \footnote{The Art of the Metaobject Protocol} specification) - - % 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 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 and the draft status of the User Manual). - -\end{itemize} - -\chapter{Interaction with Hosting JVM} +\chapter{Interaction with the Hosting JVM} % Plan of Attack % @@ -194,33 +187,32 @@ implementation interacts with that hosting mechanism. \section{Lisp to Java} +\label{sec:lisp-java} \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 +When calling Java routines, some values will automatically be converted +by the FFI\footnote{Foreign Function Interface, the term for the part of + a Lisp implementation that implements calling code written 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}. +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{Low-level Java API} -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 Section~\ref{section:jss} on page -\pageref{section:jss}. This section covers the lower level API -directly available after evaluating \code{(require 'JAVA)}. +This subsection covers the low-level API available after evaluating +\code{(require 'JAVA)}. A higher level Java API, developed by Alan +Ruttenberg, is available in the \code{contrib/} directory and described +later in this document, see Section~\ref{section:jss} on page +\pageref{section:jss}. \subsubsection{Calling Java Object Methods} @@ -233,23 +225,21 @@ Section~\ref{sec:param-matching-for-ffi}). \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 two or more arguments. The first is a 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. + +When \code{JAVA:JMETHOD} 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. -\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 one has a reference to the method, one may invoke it using +Once a method reference has been acquired, it can be invoked 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 @@ -280,8 +270,8 @@ method.invoke(els); \end{listing-java} -even though the method \code{hasMoreElements()} is public in \code{Enumeration}, -the above code fails with +Even though the method \code{hasMoreElements()} is public in +\code{Enumeration}, the above code fails with \begin{listing-java} java.lang.IllegalAccessException: Class ... can @@ -292,8 +282,8 @@ 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. +This is because the method has been overridden by a non-public class and +the reflection API, unlike \texttt{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: @@ -307,15 +297,15 @@ except that the dynamic dispatch part is not shown. 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 -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} -is \code{java.util.Enumeration} because that's the return type of -the \code{entries} method. +field representing the ``intended class'' of the object. That class 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 +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} is \code{java.util.Enumeration} because that is 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 @@ -340,11 +330,9 @@ \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 non-static methods, references to static methods can be acquired by +using the \code{JAVA:JMETHOD} primitive. Static methods are called with +\code{JAVA:JSTATIC} instead of \code{JAVA:JCALL}. 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. @@ -363,88 +351,69 @@ \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 +a constructor from the class of the object to be created. The +\code{JAVA:JCONSTRUCTOR} primitive is 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}. - -\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. +The obtained constructor is passed as an argument to \code{JAVA:JNEW}, +together with any arguments. \code{JAVA:JNEW} can also be invoked with +a string naming the class as its first argument. + +\subsubsection{Accessing Java object and class fields} + +Fields in Java objects can be accessed using the getter and setter +functions \code{JAVA:JFIELD} and \code{(SETF JAVA:JFIELD)}. Static +(class) fields are accessed the same way, but with a class object or +string naming a class as first argument. 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 +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{Java to Lisp} -\section{Lisp from Java} - -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. +This section describes the various ways that one interacts with Lisp +from Java code. In order to access the Lisp world from Java, one needs +to be aware of a few things, the most important ones being 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. +\item All Lisp values are descendants of \code{LispObject}. +\item Lisp symbols are accessible either via static members of the + \code{Symbol} class, or by dynamically introspecting a \code{Package} + object. \item The Lisp dynamic environment may be saved via \code{LispThread.bindSpecial(Binding)} and restored via \code{LispThread.resetSpecialBindings(Mark)}. -\item Functions may be executed by invocation of the - Function.execute(args [...]) +\item Functions can be executed by invoking \code{LispObject.execute(args + [...])} \end{itemize} -\subsection{Lisp FFI} - -FFI stands for "Foreign Function Interface" which is the phase which -the contemporary Lisp world refers to methods of "calling out" from -Lisp into "foreign" languages and environments. This document -describes the various ways that one interacts with Lisp world of ABCL -from Java, considering the hosted Lisp as the "Foreign Function" that -needs to be "Interfaced". - \subsection{Calling Lisp from Java} +\label{sec:calling-lisp-from-java} -Note: As the entire ABCL Lisp system resides in the org.armedbear.lisp -package the following code snippets do not show the relevant import -statements in the interest of brevity. An example of the import -statement would be - +Note: the entire ABCL Lisp system resides in the +\texttt{org.armedbear.lisp} package, but the following code snippets do +not show the relevant import statements in the interest of brevity. An +example of the import statement would be \begin{listing-java} import org.armedbear.lisp.*; \end{listing-java} - to potentially import all the JVM symbol from the `org.armedbear.lisp' namespace. -Per JVM, there can only ever be a single Lisp interpreter. This is -started by calling the static method `Interpreter.createInstance()`. +There can only ever be a single Lisp interpreter per JVM instance. A +reference to this interpreter is obtained by calling the static method +\code{Interpreter.createInstance()}. \begin{listing-java} Interpreter interpreter = Interpreter.createInstance(); \end{listing-java} If this method has already been invoked in the lifetime of the current -Java process it will return null, so if you are writing Java whose -life-cycle is a bit out of your control (like in a Java servlet), a -safer invocation pattern might be: +Java process it will return \texttt{null}, so if you are writing Java +whose life-cycle is a bit out of your control (like in a Java servlet), +a safer invocation pattern might be: \begin{listing-java} Interpreter interpreter = Interpreter.getInstance(); @@ -454,8 +423,7 @@ \end{listing-java} -The Lisp \code{eval} primitive may be simply passed strings for evaluation, -as follows +The Lisp \code{eval} primitive may simply be passed strings for evaluation: \begin{listing-java} String line = "(load \"file.lisp\")"; @@ -464,115 +432,118 @@ Notice that all possible return values from an arbitrary Lisp computation are collapsed into a single return value. Doing useful -further computation on the ``LispObject'' depends on knowing what the -result of the computation might be, usually involves some amount +further computation on the \code{LispObject} depends on knowing what the +result of the computation might be. This usually involves some amount of \code{instanceof} introspection, and forms a whole topic to itself -(c.f. [Introspecting a LispObject]) +(see Section~\ref{topic:Introspecting a LispObject}, +page~\pageref{topic:Introspecting a LispObject}). Using \code{eval} involves the Lisp interpreter. Lisp functions may -be directly invoked by Java method calls as follows. One simply -locates the package containing the symbol, then obtains a reference to -the symbol, and then invokes the \code{execute()} method with the -desired parameters. +also be directly invoked by Java method calls as follows. One simply +locates the package containing the symbol, obtains a reference to the +symbol, and then invokes the \code{execute()} method with the desired +parameters. \begin{listing-java} - interpreter.eval("(defun foo (msg) (format nil \"You told me '~A'~%\" msg))"); - Package pkg = Packages.findPackage("CL-USER"); - Symbol foo = pkg.findAccessibleSymbol("FOO"); - Function fooFunction = (Function)foo.getSymbolFunction(); - JavaObject parameter = new JavaObject("Lisp is fun!"); - LispObject result = fooFunction.execute(parameter); - // How to get the "naked string value"? - System.out.println("The result was " + result.writeToString()); + interpreter.eval("(defun foo (msg)" + + "(format nil \"You told me '~A'~%\" msg))"); + Package pkg = Packages.findPackage("CL-USER"); + Symbol foo = pkg.findAccessibleSymbol("FOO"); + Function fooFunction = (Function)foo.getSymbolFunction(); + JavaObject parameter = new JavaObject("Lisp is fun!"); + LispObject result = fooFunction.execute(parameter); + // How to get the "naked string value"? + System.out.println("The result was " + result.writeToString()); \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 Java source, we can invoke the symbol directly. -For instance, to tell if a `LispObject` contains a reference to a symbol. +If one is calling a function in the CL package, the syntax can become +considerably simpler. If we can locate the instance of definition in +the ABCL Java source, we can invoke the symbol directly. For instance, +to tell if a \code{LispObject} is (Lisp) \texttt{NIL}, we can invoke the +CL function \code{NULL} in the following way: \begin{listing-java} - boolean nullp(LispObject object) { - LispObject result = Primitives.NULL.execute(object); - if (result == NIL) { // the symbol 'NIL' is explicitly named in the Java - // namespace at ``Symbol.NIL'' - // but is always present in the - // local namespace in its unadorned form for - // the convenience of the User. - return false; - } - return true; - } + boolean nullp(LispObject object) { + LispObject result = Primitives.NULL.execute(object); + if (result == NIL) { // the symbol 'NIL' is explicitly named in the Java + // namespace at ``Symbol.NIL'' + // but is always present in the + // local namespace in its unadorned form for + // the convenience of the User. + return false; + } + return true; + } \end{listing-java} \subsubsection{Introspecting a LispObject} \label{topic:Introspecting a LispObject} -We present various patterns for introspecting an an arbitrary -`LispObject` which can represent the result of every Lisp evaluation +We present various patterns for introspecting an arbitrary +\code{LispObject} which can hold the result of every Lisp evaluation into semantics that Java can meaningfully deal with. -\subsubsection{LispObject as \code{boolean}} +\paragraph{LispObject as \code{boolean}} -If the LispObject a generalized boolean values, one can use -\code{getBooleanValue()} to convert to Java: +If the \code{LispObject} is to be interpreted as a generalized boolean +value, one can use \code{getBooleanValue()} to convert to Java: \begin{listing-java} - LispObject object = Symbol.NIL; - boolean javaValue = object.getBooleanValue(); + LispObject object = Symbol.NIL; + boolean javaValue = object.getBooleanValue(); \end{listing-java} -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: +Since in Lisp any value other than \code{NIL} means "true", Java +equality can also be used, which is a bit easier to type and better in +terms of information it conveys to the compiler: \begin{listing-java} boolean javaValue = (object != Symbol.NIL); \end{listing-java} -\paragraph{LispObject is a list} +\paragraph{LispObject as a list} -If LispObject is a list, it will have the type `Cons`. One can then use -the \code{copyToArray} to make things a bit more suitable for Java -iteration. +If \code{LispObject} is a list, it will have the type \code{Cons}. One +can then use the \code{copyToArray} method to make things a bit more +suitable for Java iteration. \begin{listing-java} - LispObject result = interpreter.eval("'(1 2 4 5)"); - if (result instanceof Cons) { - LispObject array[] = ((Cons)result.copyToArray()); - ... - } + LispObject result = interpreter.eval("'(1 2 4 5)"); + if (result instanceof Cons) { + LispObject array[] = ((Cons)result.copyToArray()); + ... + } \end{listing-java} -A more Lispy way to iterated down a list is to use the `cdr()` access +A more Lispy way to iterate down a list is to use the `cdr()` access function just as like one would traverse a list in Lisp:; \begin{listing-java} - LispObject result = interpreter.eval("'(1 2 4 5)"); - while (result != Symbol.NIL) { - doSomething(result.car()); - result = result.cdr(); - } + LispObject result = interpreter.eval("'(1 2 4 5)"); + while (result != Symbol.NIL) { + doSomething(result.car()); + result = result.cdr(); + } \end{listing-java} -\subsection{Java Scripting API (JSR-223)} +\section{Java Scripting API (JSR-223)} +\label{sec:java-scripting-api} -ABCL can be built with support for JSR-223, which offers a -language-agnostic API to invoke other languages from Java. The binary -distribution download-able 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. +ABCL can be built with support for JSR-223~\cite{jsr-223}, which offers +a language-agnostic API to invoke other languages from Java. The binary +distribution download-able from ABCL's homepage 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 +\url{http://trac.common-lisp.net/armedbear/browser/trunk/abcl/examples/jsr-223} for example usage. -\subsubsection{Conversions} +\subsection{Conversions} In general, ABCL's implementation of the JSR-223 API performs implicit conversion from Java objects to Lisp objects when invoking Lisp from @@ -580,45 +551,46 @@ 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} +\subsection{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 (\code{Invocable} +and \code{Compilable}) are optional. ABCL implements all the three +interfaces - \code{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 +The main interface defined by JSR-223, \code{javax.script.ScriptEngine}, +is implemented by the class +\code{org.armedbear.lisp.scripting.AbclScriptEngine}. \code{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). +well. You can obtain an instance of \code{AbclScriptEngine} using the +\code{AbclScriptEngineFactory} or by using the service provider +mechanism through \code{ScriptEngineManager} (refer to the +\texttt{javax.script} documentation). -\subsubsection{Start-up and configuration file} +\subsection{Start-up and configuration file} At start-up (i.e. when its constructor is invoked, as part of the -static initialization phase of AbclScriptEngineFactory) the ABCL +static initialization phase of \code{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 +(\texttt{/abcl-script-config.lisp}). If present, this file can be used to customize the behavior of the engine, by setting a number of -variables in the ABCL-SCRIPT package. Here is a list of the available +variables in the \code{ABCL-SCRIPT} package. Here is a list of the available variables: -\begin{itemize} -\item *use-throwing-debugger* Controls whether ABCL uses a +\begin{description} +\item[\texttt{*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 Default value: \texttt{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. @@ -626,39 +598,41 @@ 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[\texttt{*launch-swank-at-startup*}] If true, Swank will be launched at + startup. See \texttt{*swank-dir*} and \texttt{*swank-port*}. \begin{itemize} - \item Default value: NIL + \item Default value: \texttt{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[\texttt{*swank-dir*}] The directory where Swank is installed. Must be set + if \texttt{*launch-swank-at-startup*} is true. +\item[\texttt{*swank-port*}] The port where Swank will listen for + connections. Must be set if \texttt{*launch-swank-at-startup*} is + true. \begin{itemize} \item Default value: 4005 \end{itemize} -\end{itemize} +\end{description} Additionally, at startup the AbclScriptEngine will \code{(require 'asdf)} - in fact, it uses asdf to load Swank. -\subsubsection{Evaluation} +\subsection{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. +Code is read and evaluated in the package \code{ABCL-SCRIPT-USER}. This +packages \texttt{USE}s the \code{COMMON-LISP}, \code{JAVA} and +\code{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 behavior of +\code{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 +``ScriptContext'' (basically a flat environment of name$\rightarrow$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 +point of view, they are first interned using \code{READ-FROM-STRING} with, as +usual, \code{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. @@ -667,29 +641,29 @@ of forms returns the value of the last form instead of T, so the evaluation of short scripts does the Right Thing. -\subsubsection{Compilation} +\subsection{Compilation} 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 -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). +\texttt{javax.script.CompiledScript}, is read, compiled and executed by +default in the \texttt{ABCL-SCRIPT-USER} package, just like evaluated +code. In contrast to 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 ``\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 \code{(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 \texttt{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} +\subsection{Invocation of functions and methods} AbclScriptEngine implements the \code{javax.script.Invocable} interface, which allows to directly call Lisp functions and methods, @@ -698,10 +672,10 @@ 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()} +\texttt{UnsupportedOperationException} when called. The \code{invokeFunction()} method should be used to call both regular and generic functions. -\subsubsection{Implementation of Java interfaces in Lisp} +\subsection{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 @@ -729,7 +703,7 @@ 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 +\item a hash-map of method-name $\rightarrow$ 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 @@ -738,12 +712,12 @@ 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 class \code{AbclScriptEngine} via +the two methods \code{getInterface(Class)} and +\code{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 \code{jmake-proxy} generic function. \chapter{Implementation Dependent Extensions} @@ -1102,7 +1076,7 @@ Superseded by Quicklisp (see Xach2011 \cite{quicklisp}). The \code{require} of the \code{asdf-install} symbol has the side -effect of pushing the directory ``~/.asdf-install-dir/systems/'' into +effect of pushing the directory ``\~/.asdf-install-dir/systems/'' into the value of the \textsc{ASDF} central registry in \code{asdf:*central-registry*}, providing a convenient mechanism for stashing \textsc{ABCL} specific system definitions for convenient From mevenson at common-lisp.net Sun Feb 5 09:22:01 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 05 Feb 2012 01:22:01 -0800 Subject: [armedbear-cvs] r13854 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Feb 5 01:21:58 2012 New Revision: 13854 Log: manual: extend content in the Beyond ANSI section. Describe CL:REQUIRE overloading. Describe the values that the Pathname extensions stores in the Pathname object. Add references to ASDF and RDF3986. Modified: trunk/abcl/doc/manual/abcl.bib trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.bib ============================================================================== --- trunk/abcl/doc/manual/abcl.bib Sat Feb 4 13:58:39 2012 (r13853) +++ trunk/abcl/doc/manual/abcl.bib Sun Feb 5 01:21:58 2012 (r13854) @@ -1,5 +1,5 @@ @Misc{maso2000, - author = {Brian Maso}, + author = {Maso, Brian}, title = {A New Era for {Java} Protocol Handlers}, howpublished = {\url{http://java.sun.com/developer/onlineTraining/protocolhandlers/}}, month = aug, @@ -7,11 +7,25 @@ note = {Last accessed Jan 25, 2012}} @Misc{quicklisp, - author = {Zach Beane}, + author = {Beane, Zach}, title = {Quicklisp}, howpublished = {\url{http://www.quicklisp.org/}}, note = {Last accessed Jan 25, 2012}} + + at Misc{asdf, + author = {Rideau, Fran\c{c}ois-Ren\'{e} and Barlow, Daniel and Rhodes, Christopher and King, Garry}, + title = {ASDF}, + howpublished = {\url{http://common-lisp.net/project/asdf/}}, + note = {Last accessed Feb 5, 2012}} + + at Misc{rfc3986, + author = {Berners-Lee, Tim and Fielding, Roy and Masinter, Larry}, + title = {RFC 3986: URI Generic Syntax}, + year = {2005}, + howpublished = {\url{http://www.ietf.org/rfc/rfc3986.txt}}, + note = {Last accessed Feb 5, 2012}} + @inproceedings{Rhodes2007, author = {Rhodes, Christophe}, title = {User-extensible sequences in {Common Lisp}}, Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sat Feb 4 13:58:39 2012 (r13853) +++ trunk/abcl/doc/manual/abcl.tex Sun Feb 5 01:21:58 2012 (r13854) @@ -10,7 +10,7 @@ \title{Armed Bear Common Lisp User Manual} \date{Version 1.1.0-dev\\ \smallskip -January 25, 2012} +Feburary 5, 2012} \author{Mark Evenson \and Erik H\"{u}lsmann \and Rudolf Schlatte \and Alessio Stalla \and Ville Voutilainen} @@ -114,7 +114,7 @@ \chapter{Running ABCL} \textsc{ABCL} is packaged as a single jar file usually named either -\texttt{abcl.jar} or possibly something like \texttt{abcl-1.0.1.jar} if +\texttt{abcl.jar} or possibly something like \texttt{abcl-1.1.0.jar} if using a versioned package on the local filesystem from your system vendor. This jar file can be executed from the command line to obtain a REPL\footnote{Read-Eval Print Loop, a Lisp commandline}, viz: @@ -758,13 +758,13 @@ \section{EXTENSIONS} The symbols in the EXTENSIONS package (nicknamed ``EXT'') constitutes -extensions to the ANSI standard that are potentially useful to the +extensions to the \textsc{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 \cite{RHODES2007} for a generic function interface to the native -JVM contract for \code{java.util.List}. +\textsc{JVM} contract for \code{java.util.List}. % include autogen docs for the EXTENSIONS package. \include{extensions} @@ -774,28 +774,34 @@ Naturally, in striving to be a useful contemporary Common Lisp implementation, ABCL endeavors to include extensions beyond the ANSI specification which are either widely adopted or are especially useful -in working with the hosting JVM. +in working with the hosting \textsc{JVM}. -\section{Implementation Dependent} -\begin{enumerate} - \item Compiler to JVM 5 bytecode - \item Pathname extensions -\end{enumerate} +\section{Compiler to Java 5 Bytecode} + +The \code{CL:COMPILE-FILE} interface emits a packed fasl format whose +Pathname has the type ``abcl''. These fasls are operating system neutral +byte archives packaged by the zip compression format which contain +artifacts whose loading \code{CL:LOAD} understands. \section{Pathname} 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 +description and retrieval of resources named in a +\textsc{URI} \footnote{A \textsc{URI} is essentially a superset of + what is commonly understood as a \textsc{URL} We sometimesuse 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 \cite{rfc3986}.} scheme that the \textsc{JVM} +``understands''. Support is built-in to comprehend the ``http'' and ``https'' implementations but additional protocol handlers may be -installed at runtime by having JVM symbols present in the +installed at runtime by having \textsc{JVM} symbols present in the sun.net.protocol.dynamic pacakge. See \cite{maso2000} for more details. -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 canonical -representation is defined to be the NAMESTRING of the Pathname. +\textsc{ABCL} has created specializations of the ANSI Pathname object to +enable to use of \textsc{URI}s to address dynamically loaded resources for the +JVM. A \code{URL-PATHNAME} has a corresponding \textsc{URI} whose canonical +representation is defined to be the \code{NAMESTRING} of the Pathname. % \begin{verbatim} @@ -804,19 +810,25 @@ % TODO Render via some LaTeX mode for graphviz? a . - a . - a . + a . + a . \end{verbatim} -Both URL-PATHNAME and JAR-PATHNAME may be used anywhere a PATHNAME is -accepted with the following caveats: +\label{EXTENSIONS:URL-PATHNAME} +\index{URL-PATHNAME} + +\label{EXTENSIONS:JAR-PATHNAME} +\index{JAR-PATHNAME} + +Both \code{URL-PATHNAME} and \code{JAR-PATHNAME} may be used anywhere +a \code{CL:PATHNAME} is accepted with the following caveats: \begin{itemize} \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 +\item No canonicalization is performed on the underlying \textsc{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 @@ -824,8 +836,10 @@ \end{itemize} -The implementation of URL-PATHNAME allows the ABCL user to laod dynamically -code from the network. For example, for Quicklisp (\cite{quicklisp}): +The implementation of \code{URL-PATHNAME} allows the \textsc{ABCL} +user to dynamically load code from the network. For example, +Quicklisp (\cite{quicklisp}) may be completely installed from the REPL +as the single form: \begin{listing-lisp} CL-USER> (load "http://beta.quicklisp.org/quicklisp.lisp") @@ -837,8 +851,55 @@ \subsubsection{Implementation} -\code{DEVICE} either a string denoting a drive letter under DOS or a cons -specifying a \code{URL-PATHNAME}. +The implementation of these extensions stores all the additional +information in the PATHNAME object itself in ways that while strictly +speaking are conformant, nonetheless may trip up libraries that don't +expect the following: + +\begin{itemize} +\item \code{DEVICE} can be either a string denoting a drive letter + under DOS or a list of exactly one or two elements. If + \code{DEVICE} is a list, it denotes a \code{JAR-PATHNAME}, with the entries + containing \code{PATHNAME} objects which describe the outer and (possibley) + locations of the jar archive. + +\item A \code{URL-PATHNAME} always has a \code{HOST} component that is a + property list. The values of the \code{HOST} property list are + always character strings. The allowed keys have the following meanings: + \begin{description} + \item[:SCHEME] Scheme of URI ("http", "ftp", "bundle", etc.) + \item[:AUTHORITY] Valid authority according to the URI scheme. For + "http" this could be "example.org:8080". + \item[:QUERY] The query of the \textsc{URI} + \item[:FRAGMENT] The fragment portion of the \textsc{URI} + \end{description} + + +\item In order to encapsulate the implementation decisions for these + meanings, the following functions provide a setf-able API for + reading and writing such values: \code{URL-PATHNAME-QUERY}, + \code{URL-PATHNAME-FRAGMENT}, \code{URL-PATHNAME-AUTHORITY}, and + \code{URL-PATHNAME-SCHEME}. The specific subtype of a Pathname may + be determined with the predicates \code{PATHNAME-URL-P} and + \code{PATHNAME-JAR-P}. + +\label{EXTENSIONS:URL-PATHNAME-SCHEME} +\index{URL-PATHNAME-SCHEME} + +\label{EXTENSIONS:URL-PATHNAME-FRAGMENT} +\index{URL-PATHNAME-FRAGMENT} + +\label{EXTENSIONS:URL-PATHNAME-AUTHORITY} +\index{URL-PATHNAME-AUTHORITY} + +\label{EXTENSIONS:PATHNAME-URL-P} +\index{PATHNAME-URL-P} + +\label{EXTENSIONS:URL-PATHNAME-QUERY} +\index{URL-PATHNAME-QUERY} + +\end{itemize} + \section{Extensible Sequences} @@ -921,21 +982,46 @@ the corresponding Unicode character is output for characters whose code is greater than 0x00ff. +\section{Overloading of the CL:REQUIRE mechanism} + +The CL:REQUIRE mechanism is overloaded in the following ways: + +\begin{description} + + \item{ASDF} Loads the ASDF implementation shipped with the + implementation. After ASDF has been loaded in this manner, + symbols passed to CL:REQUIRE which are otherwise unresolved, are + passed to ASDF for a chance for resolution. This means, for + instance that if CL-PPCRE can be located as a loadable ASDF system + \code{(require 'cl-ppcre)} is equivalent to + \code{(asdf:load-system 'cl-ppcre)}. + + \item{ABCL-CONTRIB} Locates and pushes the toplevel contents of + ``abcl-contrib.jar'' into the ASDF central registry. + +\end{description} + +The user may extend the CL:REQUIRE mechanism by pushing function hooks +into SYSTEM:*MODULE-PROVIDER-FUNCTIONS*. Each such hook function +takes a single argument containing the symbol passed to CL:REQUIRE and +returns a non-nil value if it can successful resolve the symbol. + \subsection{JSS optionally extends the Reader} The JSS contrib consitutes an additional, optional extension to the -reader in the definition of the \#\" reader macro. See +reader in the definition of the \#\" reader macro. See section \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 -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: +asdf-2.019 (see \cite{asdf}) is packaged as core component of ABCL, +but not 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}. The packaged ASDF +may be loaded by the \textsc{ANSI} \code{REQUIRE} mechanism as +follows: \begin{listing-lisp} CL-USER> (require 'asdf) @@ -945,7 +1031,7 @@ 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 +\code{abcl-contrib-1.1.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: @@ -1048,9 +1134,14 @@ To one used to the more universal syntax of Lisp pairs for which the definition of read and compile time macros is quite natural, the Java syntax available to the Java programmer may be said to suck. To -alleviate this situation, we introduce the -\code{SHARPSIGN-DOUBLE-QUOTE} (\code{\#"}) reader macro, the first of perhaps - many exper +alleviate this situation, the JSS contrib introduces the +\code{SHARPSIGN-DOUBLE-QUOTE} (\code{\#"}) reader macro, which allows the +the specification of the name of invoking function as the first +element of the relevant s-expr which tends to be more congruent to +how Lisp programmers seem to be wired to think. + +While quite useful, we don't expect that the JSS contrib will be the +last experiment in wrangling Java from Common Lisp. \subsection{JSS usage} @@ -1088,7 +1179,7 @@ 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. +Common Lisp implementation candidate. From 2006 to 2008, Peter manned the development lists, incorporating patches as made sense. After a suitable search, Peter nominated Erik @@ -1109,8 +1200,3 @@ \printindex \end{document} - -% TODO -% 1. Create mechanism for swigging DocString and Lisp docs into -% sections ('grovel.lisp') - From mevenson at common-lisp.net Sun Feb 5 09:28:55 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 05 Feb 2012 01:28:55 -0800 Subject: [armedbear-cvs] r13855 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Sun Feb 5 01:28:54 2012 New Revision: 13855 Log: manual: minor corrections to previous commit. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Feb 5 01:21:58 2012 (r13854) +++ trunk/abcl/doc/manual/abcl.tex Sun Feb 5 01:28:54 2012 (r13855) @@ -959,7 +959,9 @@ (defparameter *other-classloader* (jcall "getBaseLoader" cl-user::*classpath-manager*)) -(defmethod print-object ((device-id (java:jclass "dto.nbi.service.hdm.alcatel.com.NBIDeviceID" *other-classloader*)) +(defmethod print-object ((device-id (java:jclass + "dto.nbi.service.hdm.alcatel.com.NBIDeviceID" + *other-classloader*)) stream) ;;; ... ) @@ -982,31 +984,34 @@ the corresponding Unicode character is output for characters whose code is greater than 0x00ff. -\section{Overloading of the CL:REQUIRE mechanism} +\section{Overloading of the CL:REQUIRE Mechanism} -The CL:REQUIRE mechanism is overloaded in the following ways: +The \code{CL:REQUIRE} mechanism is overloaded by attaching the following +semantic to the execution of \code{REQUIRE} on the following symbols: \begin{description} - \item{ASDF} Loads the ASDF implementation shipped with the - implementation. After ASDF has been loaded in this manner, - symbols passed to CL:REQUIRE which are otherwise unresolved, are - passed to ASDF for a chance for resolution. This means, for - instance that if CL-PPCRE can be located as a loadable ASDF system - \code{(require 'cl-ppcre)} is equivalent to - \code{(asdf:load-system 'cl-ppcre)}. + \item{\code{ASDF}} Loads the \textsc{ASDF} implementation shipped + with the implementation. After \textsc{ASDF} has been loaded in + this manner, symbols passed to \code{CL:REQUIRE} which are + otherwise unresolved, are passed to ASDF for a chance for + resolution. This means, for instance if \code{CL-PPCRE} can be + located as a loadable \textsc{ASDF} system \code{(require + 'cl-ppcre)} is equivalent to \code{(asdf:load-system + 'cl-ppcre)}. - \item{ABCL-CONTRIB} Locates and pushes the toplevel contents of - ``abcl-contrib.jar'' into the ASDF central registry. + \item{\code{ABCL-CONTRIB}} Locates and pushes the toplevel contents of + ``abcl-contrib.jar'' into the \textsc{ASDF} central registry. \end{description} -The user may extend the CL:REQUIRE mechanism by pushing function hooks -into SYSTEM:*MODULE-PROVIDER-FUNCTIONS*. Each such hook function -takes a single argument containing the symbol passed to CL:REQUIRE and -returns a non-nil value if it can successful resolve the symbol. +The user may extend the \code{CL:REQUIRE} mechanism by pushing +function hooks into \code{SYSTEM:*MODULE-PROVIDER-FUNCTIONS*}. Each +such hook function takes a single argument containing the symbol +passed to \code{CL:REQUIRE} and returns a non-\code{NIL} value if it +can successful resolve the symbol. -\subsection{JSS optionally extends the Reader} +\section{JSS optionally extends the Reader} The JSS contrib consitutes an additional, optional extension to the reader in the definition of the \#\" reader macro. See section From mevenson at common-lisp.net Sun Feb 5 12:17:08 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sun, 05 Feb 2012 04:17:08 -0800 Subject: [armedbear-cvs] r13856 - in trunk/abcl/doc: design/pathnames manual Message-ID: Author: mevenson Date: Sun Feb 5 04:17:08 2012 New Revision: 13856 Log: manual: clarify the interface for the default implementation for cannonicalization of URIs. Modified: trunk/abcl/doc/design/pathnames/pathnames.tex trunk/abcl/doc/manual/abcl.bib trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/design/pathnames/pathnames.tex ============================================================================== --- trunk/abcl/doc/design/pathnames/pathnames.tex Sun Feb 5 01:28:54 2012 (r13855) +++ trunk/abcl/doc/design/pathnames/pathnames.tex Sun Feb 5 04:17:08 2012 (r13856) @@ -4,7 +4,7 @@ % \usepackage{abcl} \begin{document} -\title{An Implementation and Analysis of Addding IRI to Common Lisp's Pathname} +\title{An Implementation and Analysis of Adding IRI to Common Lisp's Pathname} \date{October 2011} \author{Mark~Evenson} Modified: trunk/abcl/doc/manual/abcl.bib ============================================================================== --- trunk/abcl/doc/manual/abcl.bib Sun Feb 5 01:28:54 2012 (r13855) +++ trunk/abcl/doc/manual/abcl.bib Sun Feb 5 04:17:08 2012 (r13856) @@ -79,7 +79,7 @@ } @TechReport{jsr-223, - author = {Mike Grogan}, + author = {Grogan,Mike}, title = {Scripting for the {Java} Platform}, institution = {Sun Microsystems, Inc.}, year = 2006, @@ -88,3 +88,12 @@ note = {\url{http://jcp.org/aboutJava/communityprocess/final/jsr223/index.html}}, } + + at Misc{uri-pathname, + key = {evenson2011}, + author = {Evenson, Mark}, + title = {Unpublished draft of {An Implementation and Analysis of Adding IRI to Common Lisp's Pathname}}, + howpublished = {\url{http://code.google.com/p/abcl-dynamic-install/source/browse/doc/design/pathnames/pathnames.tex}}, + year = {2011}, + note = {Last accessed Feb 5, 2012}, +} Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Sun Feb 5 01:28:54 2012 (r13855) +++ trunk/abcl/doc/manual/abcl.tex Sun Feb 5 04:17:08 2012 (r13856) @@ -828,11 +828,21 @@ \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 \textsc{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. +\index{URI} +\item No canonicalization is performed on the underlying \textsc{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. Users may programatically initiate a new, local + computation by applying the \code{CL:TRUENAME} function to a + \code{EXT:URL-PATHNAME} object. Depending on the reliablity and + properties of your local \textsc{REST} infrastructure, these results + may not necessarily be idempotent over time\footnote {See + \cite{evenson2011} for the draft of the publication of the technical + details}. + + \end{itemize} From rschlatte at common-lisp.net Sun Feb 5 20:19:32 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Sun, 05 Feb 2012 12:19:32 -0800 Subject: [armedbear-cvs] r13857 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Sun Feb 5 12:19:30 2012 New Revision: 13857 Log: Enable :generic-function-class keyword. ... full ensure-class-using-class protocol not implemented yet. Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/clos.lisp Sun Feb 5 04:17:08 2012 (r13856) +++ trunk/abcl/src/org/armedbear/lisp/clos.lisp Sun Feb 5 12:19:30 2012 (r13857) @@ -1406,6 +1406,8 @@ &allow-other-keys) (when (autoloadp function-name) (resolve function-name)) + (setf all-keys (copy-list all-keys)) ; since we modify it + (remf all-keys :generic-function-class) (let ((gf (find-generic-function function-name nil))) (if gf (progn From rschlatte at common-lisp.net Mon Feb 6 11:21:49 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Mon, 06 Feb 2012 03:21:49 -0800 Subject: [armedbear-cvs] r13858 - trunk/abcl/doc/manual Message-ID: Author: rschlatte Date: Mon Feb 6 03:21:48 2012 New Revision: 13858 Log: Manual: fix grovel.lisp, add to Makefile (not run by default) ... also create new versions of generated files. Modified: trunk/abcl/doc/manual/Makefile trunk/abcl/doc/manual/extensions.tex trunk/abcl/doc/manual/grovel.lisp trunk/abcl/doc/manual/java.tex trunk/abcl/doc/manual/threads.tex Modified: trunk/abcl/doc/manual/Makefile ============================================================================== --- trunk/abcl/doc/manual/Makefile Sun Feb 5 12:19:30 2012 (r13857) +++ trunk/abcl/doc/manual/Makefile Mon Feb 6 03:21:48 2012 (r13858) @@ -1,12 +1,15 @@ all: abcl.pdf -abcl.pdf: abcl.tex abcl.bib +abcl.pdf: abcl.tex abcl.bib java.tex extensions.tex threads.tex pdflatex abcl.tex bibtex abcl makeindex abcl pdflatex abcl.tex pdflatex abcl.tex +grovel: + abcl --batch --noinform --load "grovel.lisp" --eval '(progn (grovel-docstrings-as-tex (find-package :java)) (grovel-docstrings-as-tex (find-package :extensions)) (grovel-docstrings-as-tex (find-package :threads)))' + clean: rm -f *.aux *.bbl *.blg *.idx *.ilg *.ind *.log *.out *.toc abcl.pdf Modified: trunk/abcl/doc/manual/extensions.tex ============================================================================== --- trunk/abcl/doc/manual/extensions.tex Sun Feb 5 12:19:30 2012 (r13857) +++ trunk/abcl/doc/manual/extensions.tex Mon Feb 6 03:21:48 2012 (r13858) @@ -1,12 +1,10 @@ -\subsection{Exported Symbols from the EXTENSIONS package} - \paragraph{} \label{EXTENSIONS:COMPILE-FILE-IF-NEEDED} \index{COMPILE-FILE-IF-NEEDED} --- Function: \textbf{compile-file-if-needed} [\textbf{extensions}] \textit{input-file \&rest allargs \&key force-compile \&allow-other-keys} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -15,7 +13,7 @@ --- Variable: \textbf{most-positive-java-long} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -24,7 +22,7 @@ --- Function: \textbf{dump-java-stack} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -33,7 +31,7 @@ --- Function: \textbf{memql} [\textbf{extensions}] \textit{item list} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -42,7 +40,7 @@ --- Variable: \textbf{double-float-negative-infinity} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -51,7 +49,7 @@ --- Function: \textbf{grovel-java-definitions} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -60,7 +58,7 @@ --- Variable: \textbf{*autoload-verbose*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -69,7 +67,7 @@ --- Function: \textbf{make-slime-input-stream} [\textbf{extensions}] \textit{function output-stream} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -78,7 +76,7 @@ --- Function: \textbf{url-pathname-fragment} [\textbf{extensions}] \textit{p} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -87,7 +85,7 @@ --- Function: \textbf{process-kill} [\textbf{extensions}] \textit{process} \begin{adjustwidth}{5em}{5em} -Kills the process. +not-documented \end{adjustwidth} \paragraph{} @@ -96,7 +94,7 @@ --- Class: \textbf{nil-vector} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -105,7 +103,7 @@ --- Function: \textbf{source-pathname} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -114,7 +112,7 @@ --- Function: \textbf{uri-decode} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -123,7 +121,7 @@ --- Function: \textbf{simple-string-fill} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -132,7 +130,7 @@ --- Function: \textbf{memq} [\textbf{extensions}] \textit{item list} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -141,7 +139,7 @@ --- Function: \textbf{url-pathname-scheme} [\textbf{extensions}] \textit{p} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -150,7 +148,16 @@ --- Special Operator: \textbf{truly-the} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented +\end{adjustwidth} + +\paragraph{} +\label{EXTENSIONS:CDR} +\index{CDR} +--- Macro: \textbf{\%cdr} [\textbf{extensions}] \textit{} + +\begin{adjustwidth}{5em}{5em} +not-documented \end{adjustwidth} \paragraph{} @@ -159,7 +166,7 @@ --- Class: \textbf{slime-input-stream} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -168,7 +175,7 @@ --- Function: \textbf{make-socket} [\textbf{extensions}] \textit{host port} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -177,7 +184,7 @@ --- Variable: \textbf{*enable-inline-expansion*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -186,7 +193,7 @@ --- Function: \textbf{process-input} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -195,7 +202,7 @@ --- Class: \textbf{mailbox} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -204,7 +211,7 @@ --- Function: \textbf{string-position} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -213,7 +220,7 @@ --- Function: \textbf{precompile} [\textbf{extensions}] \textit{name \&optional definition} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -222,7 +229,7 @@ --- Variable: \textbf{*suppress-compiler-warnings*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -231,7 +238,16 @@ --- Class: \textbf{process} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented +\end{adjustwidth} + +\paragraph{} +\label{EXTENSIONS:CADDR} +\index{CADDR} +--- Macro: \textbf{\%caddr} [\textbf{extensions}] \textit{} + +\begin{adjustwidth}{5em}{5em} +not-documented \end{adjustwidth} \paragraph{} @@ -240,7 +256,7 @@ --- Function: \textbf{simple-search} [\textbf{extensions}] \textit{sequence1 sequence2} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -249,7 +265,7 @@ --- Variable: \textbf{*lisp-home*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -258,7 +274,7 @@ --- Variable: \textbf{*command-line-argument-list*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -267,7 +283,7 @@ --- Function: \textbf{file-directory-p} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -276,7 +292,7 @@ --- Function: \textbf{make-dialog-prompt-stream} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -285,7 +301,7 @@ --- Function: \textbf{classp} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -294,7 +310,7 @@ --- Variable: \textbf{*disassembler*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -303,7 +319,7 @@ --- Function: \textbf{set-floating-point-modes} [\textbf{extensions}] \textit{\&key traps} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -312,7 +328,7 @@ --- Variable: \textbf{*debug-condition*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -321,7 +337,7 @@ --- Function: \textbf{exit} [\textbf{extensions}] \textit{\&key status} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -330,7 +346,7 @@ --- Function: \textbf{process-error} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -357,7 +373,7 @@ --- Variable: \textbf{*inspector-hook*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -366,7 +382,7 @@ --- Variable: \textbf{*require-stack-frame*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -375,7 +391,7 @@ --- Function: \textbf{probe-directory} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -384,7 +400,7 @@ --- Function: \textbf{char-to-utf8} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -393,7 +409,7 @@ --- Function: \textbf{autoload} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -402,7 +418,7 @@ --- Class: \textbf{mutex} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -411,7 +427,7 @@ --- Function: \textbf{uri-encode} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -420,7 +436,7 @@ --- Function: \textbf{autoload-macro} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -429,7 +445,7 @@ --- Function: \textbf{socket-close} [\textbf{extensions}] \textit{socket} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -438,7 +454,7 @@ --- Function: \textbf{uptime} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -447,7 +463,7 @@ --- Variable: \textbf{*ed-functions*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -456,7 +472,7 @@ --- Function: \textbf{compile-system} [\textbf{extensions}] \textit{\&key quit (zip t) output-path} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -465,7 +481,7 @@ --- Variable: \textbf{*load-truename-fasl*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -474,7 +490,7 @@ --- Function: \textbf{special-variable-p} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -483,7 +499,7 @@ --- Function: \textbf{socket-accept} [\textbf{extensions}] \textit{socket} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -492,7 +508,7 @@ --- Variable: \textbf{*warn-on-redefinition*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -501,7 +517,7 @@ --- Function: \textbf{url-pathname-authority} [\textbf{extensions}] \textit{p} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -510,7 +526,7 @@ --- Function: \textbf{autoloadp} [\textbf{extensions}] \textit{symbol} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -519,7 +535,7 @@ --- Function: \textbf{make-weak-reference} [\textbf{extensions}] \textit{obj} \begin{adjustwidth}{5em}{5em} -Creates a weak reference to 'obj'. +not-documented \end{adjustwidth} \paragraph{} @@ -528,7 +544,7 @@ --- Function: \textbf{resolve} [\textbf{extensions}] \textit{symbol} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -537,7 +553,7 @@ --- Function: \textbf{cancel-finalization} [\textbf{extensions}] \textit{object} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -546,7 +562,7 @@ --- Function: \textbf{make-slime-output-stream} [\textbf{extensions}] \textit{function} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -597,7 +613,7 @@ --- Function: \textbf{fixnump} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -606,7 +622,7 @@ --- Variable: \textbf{single-float-negative-infinity} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -615,7 +631,7 @@ --- Function: \textbf{quit} [\textbf{extensions}] \textit{\&key status} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -624,7 +640,7 @@ --- Function: \textbf{internal-compiler-error} [\textbf{extensions}] \textit{format-control \&rest format-arguments} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -633,7 +649,7 @@ --- Class: \textbf{jar-pathname} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} NIL @@ -644,7 +660,7 @@ --- Function: \textbf{simple-string-search} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -653,7 +669,7 @@ --- Function: \textbf{assql} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -662,7 +678,7 @@ --- Function: \textbf{finalize} [\textbf{extensions}] \textit{object function} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -671,7 +687,7 @@ --- Function: \textbf{run-shell-command} [\textbf{extensions}] \textit{command \&key directory (output *standard-output*)} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -680,7 +696,16 @@ --- Variable: \textbf{*saved-backtrace*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented +\end{adjustwidth} + +\paragraph{} +\label{EXTENSIONS:CAR} +\index{CAR} +--- Macro: \textbf{\%car} [\textbf{extensions}] \textit{} + +\begin{adjustwidth}{5em}{5em} +not-documented \end{adjustwidth} \paragraph{} @@ -689,7 +714,7 @@ --- Macro: \textbf{collect} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -698,7 +723,7 @@ --- Function: \textbf{arglist} [\textbf{extensions}] \textit{extended-function-designator} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -707,7 +732,7 @@ --- Function: \textbf{adjoin-eql} [\textbf{extensions}] \textit{item list} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -716,7 +741,7 @@ --- Function: \textbf{charpos} [\textbf{extensions}] \textit{stream} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -725,7 +750,7 @@ --- Function: \textbf{make-temp-file} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -734,7 +759,7 @@ --- Function: \textbf{describe-compiler-policy} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -743,7 +768,7 @@ --- Variable: \textbf{*print-structure*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -761,7 +786,7 @@ --- Function: \textbf{gc} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -779,7 +804,7 @@ --- Function: \textbf{server-socket-close} [\textbf{extensions}] \textit{socket} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -788,7 +813,7 @@ --- Class: \textbf{weak-reference} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -797,7 +822,7 @@ --- Function: \textbf{get-floating-point-modes} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -815,7 +840,7 @@ --- Variable: \textbf{single-float-positive-infinity} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -824,7 +849,16 @@ --- Function: \textbf{featurep} [\textbf{extensions}] \textit{form} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented +\end{adjustwidth} + +\paragraph{} +\label{EXTENSIONS:CADR} +\index{CADR} +--- Macro: \textbf{\%cadr} [\textbf{extensions}] \textit{} + +\begin{adjustwidth}{5em}{5em} +not-documented \end{adjustwidth} \paragraph{} @@ -842,7 +876,7 @@ --- Function: \textbf{string-input-stream-current} [\textbf{extensions}] \textit{stream} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -851,7 +885,7 @@ --- Function: \textbf{make-server-socket} [\textbf{extensions}] \textit{port} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -860,7 +894,7 @@ --- Function: \textbf{interrupt-lisp} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -869,7 +903,7 @@ --- Macro: \textbf{aver} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -887,7 +921,7 @@ --- Function: \textbf{url-pathname-query} [\textbf{extensions}] \textit{p} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -905,7 +939,7 @@ --- Function: \textbf{source-file-position} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -923,7 +957,7 @@ --- Function: \textbf{assq} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -932,7 +966,7 @@ --- Function: \textbf{source} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -950,7 +984,7 @@ --- Function: \textbf{neq} [\textbf{extensions}] \textit{obj1 obj2} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -959,7 +993,7 @@ --- Function: \textbf{string-find} [\textbf{extensions}] \textit{char string} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -968,7 +1002,7 @@ --- Function: \textbf{pathname-jar-p} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -986,7 +1020,7 @@ --- Function: \textbf{show-restarts} [\textbf{extensions}] \textit{restarts stream} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -995,7 +1029,7 @@ --- Variable: \textbf{*batch-mode*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1004,7 +1038,7 @@ --- Function: \textbf{process-p} [\textbf{extensions}] \textit{object} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1013,7 +1047,7 @@ --- Variable: \textbf{*gui-backend*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1022,7 +1056,7 @@ --- Variable: \textbf{double-float-positive-infinity} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1031,7 +1065,7 @@ --- Function: \textbf{style-warn} [\textbf{extensions}] \textit{format-control \&rest format-arguments} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1040,7 +1074,7 @@ --- Variable: \textbf{most-negative-java-long} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1049,7 +1083,7 @@ --- Class: \textbf{slime-output-stream} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1068,7 +1102,7 @@ --- Function: \textbf{process-output} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1077,7 +1111,7 @@ --- Class: \textbf{url-pathname} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1086,7 +1120,7 @@ --- Class: \textbf{compiler-unsupported-feature-error} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1095,7 +1129,7 @@ --- Variable: \textbf{*debug-level*} [\textbf{extensions}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1104,7 +1138,7 @@ --- Function: \textbf{compiler-error} [\textbf{extensions}] \textit{format-control \&rest format-arguments} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -1113,6 +1147,6 @@ --- Function: \textbf{macroexpand-all} [\textbf{extensions}] \textit{form \&optional env} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} Modified: trunk/abcl/doc/manual/grovel.lisp ============================================================================== --- trunk/abcl/doc/manual/grovel.lisp Sun Feb 5 12:19:30 2012 (r13857) +++ trunk/abcl/doc/manual/grovel.lisp Mon Feb 6 03:21:48 2012 (r13858) @@ -1,4 +1,4 @@ -#-abcl We're only grovelling ABCL docstrings here. + (defun grovel-docstrings-as-tex (&optional (package (find-package :java))) (let ((output-file (format nil "~A.tex" (string-downcase (package-name package))))) (with-open-file (stream output-file :direction :output) @@ -6,22 +6,31 @@ (loop :for symbol :being :each :external-symbol :of package :doing (format stream "~&~A~%~%" (symbol-as-tex symbol)))))) +(require :asdf) + (asdf:load-system 'swank) ;; XXX Does this load the SWANK-BACKEND package as well +(defun texify-string (string &optional remove) + (with-output-to-string (s) + (loop for char across string + do (if (find char '(#\& #\% #\#)) + (unless remove + (write-char #\\ s) + (write-char char s)) + (write-char char s))))) + +(defun texify (thing) + "Return STRING with LaTeX-sensitive characters escaped. +Downcase symbol names but leave strings alone." + (cond ((listp thing) + (format nil "~A" (mapcar #'texify thing))) + ((stringp thing) (texify-string thing)) + ((symbolp thing) (texify-string (string-downcase (symbol-name thing)))))) + (defun arglist-as-tex (symbol) (handler-case (loop :for arg :in (arglist symbol) - :collecting - (format nil - ;;; XXX should really check the entire input for TeX escapes - (if (and (symbolp arg) - (or (string= (subseq (symbol-name arg) 0 1) #\&) - (string= (subseq (symbol-name arg) 0 1) #\%))) - "\\~A" - "~A") - (if (symbolp arg) - (string-downcase (symbol-name arg)) - (format nil "~(~A~)" arg)))) + :collecting (texify arg)) (t (e) (progn (warn "Failed to form arglist for ~A: ~A" symbol e) (list ""))))) @@ -72,15 +81,22 @@ symbol) package-name (string-downcase (package-name (find-package (symbol-package symbol))))) - (format nil "~&\\paragraph{}~&\\label{~A:~A}~&\\index{~A}~&--- ~A: \\textbf{~A} [\\textbf{~A}] \\textit{~A}~%~%\\begin{adjustwidth}{5em}{5em}~&~A~&\\end{adjustwidth}" - (package-name (find-package (symbol-package symbol))) - (symbol-name symbol) - (symbol-name symbol) + (format nil "~&\\paragraph{} +\\label{~A:~A} +\\index{~A} +--- ~A: \\textbf{~A} [\\textbf{~A}] \\textit{~A} + +\\begin{adjustwidth}{5em}{5em} +~A +\\end{adjustwidth}" + (texify-string (package-name (find-package (symbol-package symbol))) t) + (texify-string (symbol-name symbol) t) + (texify-string (symbol-name symbol) t) (cdr (assoc type *type-alist*)) - symbol-name - package-name + (texify symbol-name) + (texify package-name) (if arglist arglist "") - (if documentation documentation ""))))) + (if documentation (texify documentation) ""))))) @@ -89,4 +105,4 @@ - \ No newline at end of file + Modified: trunk/abcl/doc/manual/java.tex ============================================================================== --- trunk/abcl/doc/manual/java.tex Sun Feb 5 12:19:30 2012 (r13857) +++ trunk/abcl/doc/manual/java.tex Mon Feb 6 03:21:48 2012 (r13858) @@ -1,12 +1,10 @@ -\subsection{Exported Symbols from the JAVA package} \paragraph{} \label{JAVA:JAVA-EXCEPTION-CAUSE} \index{JAVA-EXCEPTION-CAUSE} --- Function: \textbf{java-exception-cause} [\textbf{java}] \textit{java-exception} \begin{adjustwidth}{5em}{5em} -Returns the cause of JAVA-EXCEPTION. (The cause is the Java Throwable - object that caused JAVA-EXCEPTION to be signalled.) +not-documented \end{adjustwidth} \paragraph{} @@ -44,7 +42,7 @@ --- Function: \textbf{dump-classpath} [\textbf{java}] \textit{\&optional classloader} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -84,15 +82,6 @@ \end{adjustwidth} \paragraph{} -\label{JAVA:JRUN-EXCEPTION-PROTECTED} -\index{JRUN-EXCEPTION-PROTECTED} ---- Function: \textbf{jrun-exception-protected} [\textbf{java}] \textit{closure} - -\begin{adjustwidth}{5em}{5em} -Invokes the function CLOSURE and returns the result. Signals an error if stack or heap exhaustion occurs. -\end{adjustwidth} - -\paragraph{} \label{JAVA:JINSTANCE-OF-P} \index{JINSTANCE-OF-P} --- Function: \textbf{jinstance-of-p} [\textbf{java}] \textit{obj class} @@ -102,21 +91,21 @@ \end{adjustwidth} \paragraph{} -\label{JAVA:JMETHOD-NAME} -\index{JMETHOD-NAME} ---- Function: \textbf{jmethod-name} [\textbf{java}] \textit{method} +\label{JAVA:JSTATIC-RAW} +\index{JSTATIC-RAW} +--- Function: \textbf{jstatic-raw} [\textbf{java}] \textit{method class \&rest args} \begin{adjustwidth}{5em}{5em} -Returns the name of METHOD as a Lisp string +Invokes the static method METHOD on class CLASS with ARGS. Does not attempt to coerce the arguments or result into a Lisp object. \end{adjustwidth} \paragraph{} -\label{JAVA:JSTATIC-RAW} -\index{JSTATIC-RAW} ---- Function: \textbf{jstatic-raw} [\textbf{java}] \textit{method class \&rest args} +\label{JAVA:DEFINE-JAVA-CLASS} +\index{DEFINE-JAVA-CLASS} +--- Macro: \textbf{define-java-class} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -Invokes the static method METHOD on class CLASS with ARGS. Does not attempt to coerce the arguments or result into a Lisp object. +not-documented \end{adjustwidth} \paragraph{} @@ -125,9 +114,25 @@ --- Function: \textbf{jclass-of} [\textbf{java}] \textit{object \&optional name} \begin{adjustwidth}{5em}{5em} -Returns the name of the Java class of OBJECT. If the NAME argument is - supplied, verifies that OBJECT is an instance of the named class. The name - of the class or nil is always returned as a second value. +not-documented +\end{adjustwidth} + +\paragraph{} +\label{JAVA:JRUN-EXCEPTION-PROTECTED} +\index{JRUN-EXCEPTION-PROTECTED} +--- Function: \textbf{jrun-exception-protected} [\textbf{java}] \textit{closure} + +\begin{adjustwidth}{5em}{5em} +Invokes the function CLOSURE and returns the result. Signals an error if stack or heap exhaustion occurs. +\end{adjustwidth} + +\paragraph{} +\label{JAVA:JMETHOD-NAME} +\index{JMETHOD-NAME} +--- Function: \textbf{jmethod-name} [\textbf{java}] \textit{method} + +\begin{adjustwidth}{5em}{5em} +Returns the name of METHOD as a Lisp string \end{adjustwidth} \paragraph{} @@ -136,9 +141,18 @@ --- Function: \textbf{get-current-classloader} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} +\paragraph{} +\label{JAVA:JGET-PROPERTY-VALUE} +\index{JGET-PROPERTY-VALUE} +--- Function: \textbf{\%jget-property-value} [\textbf{java}] \textit{java-object property-name} + +\begin{adjustwidth}{5em}{5em} +Gets a JavaBeans property on JAVA-OBJECT. +SYSTEM-INTERNAL: Use jproperty-value instead. +\end{adjustwidth} \paragraph{} \label{JAVA:JNEW-ARRAY-FROM-LIST} @@ -146,7 +160,7 @@ --- Function: \textbf{jnew-array-from-list} [\textbf{java}] \textit{element-type list} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -164,7 +178,7 @@ --- Function: \textbf{get-default-classloader} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -200,7 +214,17 @@ --- Function: \textbf{jproperty-value} [\textbf{java}] \textit{obj prop} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented +\end{adjustwidth} + +\paragraph{} +\label{JAVA:JSET-PROPERTY-VALUE} +\index{JSET-PROPERTY-VALUE} +--- Function: \textbf{\%jset-property-value} [\textbf{java}] \textit{java-object property-name value} + +\begin{adjustwidth}{5em}{5em} +Sets a JavaBean property on JAVA-OBJECT. +SYSTEM-INTERNAL: Use (setf jproperty-value) instead. \end{adjustwidth} \paragraph{} @@ -215,10 +239,33 @@ \paragraph{} \label{JAVA:JNEW-RUNTIME-CLASS} \index{JNEW-RUNTIME-CLASS} ---- Function: \textbf{jnew-runtime-class} [\textbf{java}] \textit{} +--- Function: \textbf{jnew-runtime-class} [\textbf{java}] \textit{class-name \&rest args \&key (superclass java.lang.Object) interfaces constructors methods fields (access-flags (quote (public))) annotations} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +Creates and loads a Java class with methods calling Lisp closures + as given in METHODS. CLASS-NAME and SUPER-NAME are strings, + INTERFACES is a list of strings, CONSTRUCTORS, METHODS and FIELDS are + lists of constructor, method and field definitions. + + Constructor definitions - currently NOT supported - are lists of the form + (argument-types function \&optional super-invocation-arguments) + where argument-types is a list of strings and function is a lisp function of + (1+ (length argument-types)) arguments; the instance (`this') is passed in as + the last argument. The optional super-invocation-arguments is a list of numbers + between 1 and (length argument-types), where the number k stands for the kth argument + to the just defined constructor. If present, the constructor of the superclass + will be called with the appropriate arguments. E.g., if the constructor definition is + (("java.lang.String" "int") \#'(lambda (string i this) ...) (2 1)) + then the constructor of the superclass with argument types (int, java.lang.String) will + be called with the second and first arguments. + + Method definitions are lists of the form + (method-name return-type argument-types function \&key modifiers annotations) + where method-name is a string, return-type and argument-types are strings or keywords for + primitive types (:void, :int, etc.), and function is a Lisp function of minimum arity + (1+ (length argument-types)); the instance (`this') is passed in as the first argument. + + Field definitions are lists of the form (field-name type \&key modifiers annotations). \end{adjustwidth} \paragraph{} @@ -249,12 +296,21 @@ \end{adjustwidth} \paragraph{} +\label{JAVA:JNEW} +\index{JNEW} +--- Function: \textbf{jnew} [\textbf{java}] \textit{constructor \&rest args} + +\begin{adjustwidth}{5em}{5em} +Invokes the Java constructor CONSTRUCTOR with the arguments ARGS. +\end{adjustwidth} + +\paragraph{} \label{JAVA:JREGISTER-HANDLER} \index{JREGISTER-HANDLER} --- Function: \textbf{jregister-handler} [\textbf{java}] \textit{object event handler \&key data count} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -276,33 +332,6 @@ \end{adjustwidth} \paragraph{} -\label{JAVA:UNREGISTER-JAVA-EXCEPTION} -\index{UNREGISTER-JAVA-EXCEPTION} ---- Function: \textbf{unregister-java-exception} [\textbf{java}] \textit{exception-name} - -\begin{adjustwidth}{5em}{5em} -Unregisters the Java Throwable EXCEPTION-NAME previously registered by REGISTER-JAVA-EXCEPTION. -\end{adjustwidth} - -\paragraph{} -\label{JAVA:JNEW} -\index{JNEW} ---- Function: \textbf{jnew} [\textbf{java}] \textit{constructor \&rest args} - -\begin{adjustwidth}{5em}{5em} -Invokes the Java constructor CONSTRUCTOR with the arguments ARGS. -\end{adjustwidth} - -\paragraph{} -\label{JAVA:JRUNTIME-CLASS-EXISTS-P} -\index{JRUNTIME-CLASS-EXISTS-P} ---- Function: \textbf{jruntime-class-exists-p} [\textbf{java}] \textit{} - -\begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED -\end{adjustwidth} - -\paragraph{} \label{JAVA:JARRAY-COMPONENT-TYPE} \index{JARRAY-COMPONENT-TYPE} --- Function: \textbf{jarray-component-type} [\textbf{java}] \textit{atype} @@ -317,7 +346,16 @@ --- Generic Function: \textbf{add-to-classpath} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented +\end{adjustwidth} + +\paragraph{} +\label{JAVA:UNREGISTER-JAVA-EXCEPTION} +\index{UNREGISTER-JAVA-EXCEPTION} +--- Function: \textbf{unregister-java-exception} [\textbf{java}] \textit{exception-name} + +\begin{adjustwidth}{5em}{5em} +Unregisters the Java Throwable EXCEPTION-NAME previously registered by REGISTER-JAVA-EXCEPTION. \end{adjustwidth} \paragraph{} @@ -335,9 +373,7 @@ --- Function: \textbf{jclass-name} [\textbf{java}] \textit{class-ref \&optional name} \begin{adjustwidth}{5em}{5em} -When called with one argument, returns the name of the Java class - designated by CLASS-REF. When called with two arguments, tests - whether CLASS-REF matches NAME. +not-documented \end{adjustwidth} \paragraph{} @@ -364,7 +400,7 @@ --- Function: \textbf{ensure-java-class} [\textbf{java}] \textit{jclass} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -373,7 +409,7 @@ --- Class: \textbf{java-class} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -382,7 +418,7 @@ --- Macro: \textbf{jmethod-let} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -447,7 +483,7 @@ --- Macro: \textbf{chain} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -484,6 +520,7 @@ Stores value in a field of the instance. The class is derived from the instance. + \end{adjustwidth} \paragraph{} @@ -492,7 +529,7 @@ --- Class: \textbf{java-object} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -519,7 +556,7 @@ --- Function: \textbf{jmake-invocation-handler} [\textbf{java}] \textit{function} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -537,7 +574,7 @@ --- Function: \textbf{make-classloader} [\textbf{java}] \textit{\&optional parent} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -586,15 +623,6 @@ \end{adjustwidth} \paragraph{} -\label{JAVA:JREDEFINE-METHOD} -\index{JREDEFINE-METHOD} ---- Function: \textbf{jredefine-method} [\textbf{java}] \textit{} - -\begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED -\end{adjustwidth} - -\paragraph{} \label{JAVA:JCLASS-FIELDS} \index{JCLASS-FIELDS} --- Function: \textbf{jclass-fields} [\textbf{java}] \textit{class \&key declared public} @@ -609,7 +637,7 @@ --- Class: \textbf{java-exception} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -618,7 +646,7 @@ --- Function: \textbf{describe-java-object} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -656,6 +684,7 @@ Stores value in a field of the instance. The class is derived from the instance. + \end{adjustwidth} \paragraph{} @@ -709,7 +738,7 @@ --- Function: \textbf{jarray-length} [\textbf{java}] \textit{java-array} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -736,7 +765,7 @@ --- Generic Function: \textbf{jmake-proxy} [\textbf{java}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} Modified: trunk/abcl/doc/manual/threads.tex ============================================================================== --- trunk/abcl/doc/manual/threads.tex Sun Feb 5 12:19:30 2012 (r13857) +++ trunk/abcl/doc/manual/threads.tex Mon Feb 6 03:21:48 2012 (r13858) @@ -1,12 +1,10 @@ -\subsection{Exported Symbols from the THREADS package} - \paragraph{} \label{THREADS:MAILBOX-EMPTY-P} \index{MAILBOX-EMPTY-P} --- Function: \textbf{mailbox-empty-p} [\textbf{threads}] \textit{mailbox} \begin{adjustwidth}{5em}{5em} -Returns non-NIL if the mailbox can be read from, NIL otherwise. +not-documented \end{adjustwidth} \paragraph{} @@ -15,7 +13,7 @@ --- Function: \textbf{threadp} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -24,7 +22,7 @@ --- Function: \textbf{destroy-thread} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -33,7 +31,7 @@ --- Macro: \textbf{with-mutex} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -60,7 +58,7 @@ --- Function: \textbf{object-wait} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -69,7 +67,7 @@ --- Function: \textbf{make-thread} [\textbf{threads}] \textit{function \&key name} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -87,16 +85,16 @@ --- Function: \textbf{object-notify-all} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} \label{THREADS:MAKE-MAILBOX} \index{MAKE-MAILBOX} ---- Function: \textbf{make-mailbox} [\textbf{threads}] \textit{} +--- Function: \textbf{make-mailbox} [\textbf{threads}] \textit{\&key ((queue g2304220) NIL)} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -105,7 +103,7 @@ --- Function: \textbf{object-notify} [\textbf{threads}] \textit{object} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -154,9 +152,10 @@ \paragraph{} \label{THREADS:SYNCHRONIZED-ON} \index{SYNCHRONIZED-ON} ---- NIL: \textbf{synchronized-on} [\textbf{threads}] \textit{} +--- Special Operator: \textbf{synchronized-on} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} +not-documented \end{adjustwidth} \paragraph{} @@ -172,10 +171,10 @@ \paragraph{} \label{THREADS:MAKE-MUTEX} \index{MAKE-MUTEX} ---- Function: \textbf{make-mutex} [\textbf{threads}] \textit{} +--- Function: \textbf{make-mutex} [\textbf{threads}] \textit{\&key ((in-use g2304421) NIL)} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -184,7 +183,7 @@ --- Class: \textbf{thread} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -193,7 +192,7 @@ --- Macro: \textbf{with-thread-lock} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -212,7 +211,7 @@ --- Function: \textbf{thread-name} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -221,7 +220,7 @@ --- Function: \textbf{current-thread} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} \paragraph{} @@ -230,6 +229,6 @@ --- Function: \textbf{mapcar-threads} [\textbf{threads}] \textit{} \begin{adjustwidth}{5em}{5em} -NOT-DOCUMENTED +not-documented \end{adjustwidth} From mevenson at common-lisp.net Mon Feb 6 18:20:22 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 06 Feb 2012 10:20:22 -0800 Subject: [armedbear-cvs] r13859 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Mon Feb 6 10:20:20 2012 New Revision: 13859 Log: abcl-asdf: return the connector for "https" role-hint. Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 03:21:48 2012 (r13858) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 10:20:20 2012 (r13859) @@ -159,9 +159,14 @@ "org.sonatype.aether.connector.wagon.WagonProvider" "lookup" (lambda (role-hint) - (if (string-equal "http" role-hint) - (some (lambda (provider) (java:jnew provider)) *http-wagon-implementations*) - java:+null+)) + (cond + ((find role-hint '("http" "https") :test #'string-equal) + (some (lambda (provider) (java:jnew provider)) *http-wagon-implementations*)) + (t + (progn + (format *maven-verbose* + "~&WagonProvider stub passed '~A' as a hint it couldn't satisfy.~%" role-hint) + java:+null+)))) "release" (lambda (wagon) (declare (ignore wagon))))) @@ -361,4 +366,3 @@ #'log))) - From mevenson at common-lisp.net Mon Feb 6 18:20:22 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 06 Feb 2012 10:20:22 -0800 Subject: [armedbear-cvs] r13860 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Mon Feb 6 10:20:21 2012 New Revision: 13860 Log: ABCL-ASDF:RESOLVE-ARTIFACT now returns the namestring of the artifact. This aligns the function to the underlying Maven Aether API. As far as I can tell, nothing was using RESOLVE-ARTIFACT anyways. Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd ============================================================================== --- trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd Mon Feb 6 10:20:20 2012 (r13859) +++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.asd Mon Feb 6 10:20:21 2012 (r13860) @@ -3,7 +3,7 @@ (defsystem :abcl-asdf :author "Mark Evenson" - :version "0.6.0" + :version "0.7.0" :depends-on (jss) :components ((:module packages :pathname "" Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 10:20:20 2012 (r13859) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 10:20:21 2012 (r13860) @@ -211,7 +211,7 @@ "A string containing the URI of an http proxy for Maven to use.") (defun make-proxy () - "Return an org.sonatype.aether.repository.Proxy instance initialized form *MAVEN-HTTP-PROXY*." + "Return an org.sonatype.aether.repository.Proxy instance initialized from *MAVEN-HTTP-PROXY*." (unless *maven-http-proxy* (warn "No proxy specified in *MAVEN-HTTP-PROXY*") (return-from make-proxy nil)) @@ -255,7 +255,7 @@ ;;; TODO change this to work on artifact strings like log4j:log4j:jar:1.2.16 (defun resolve-artifact (group-id artifact-id &optional (version "LATEST" versionp)) - "Directly resolve Maven dependencies for item with GROUP-ID and ARTIFACT-ID at VERSION, ignoring dependencies. + "Resolve artifact to location on the local filesystem. Declared dependencies are not attempted to be located. @@ -272,7 +272,9 @@ (java:jnew "org.sonatype.aether.resolution.ArtifactRequest"))) (#"setArtifact" artifact-request artifact) (#"addRepository" artifact-request (ensure-remote-repository)) - (#"toString" (#"resolveArtifact" (ensure-repository-system) (ensure-session) artifact-request)))) + (#"toString" (#"getFile" + (#"getArtifact" (#"resolveArtifact" (ensure-repository-system) + (ensure-session) artifact-request)))))) (defun make-remote-repository (id type url) (jss:new 'aether.repository.RemoteRepository id type url)) From mevenson at common-lisp.net Mon Feb 6 18:20:24 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 06 Feb 2012 10:20:24 -0800 Subject: [armedbear-cvs] r13861 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Mon Feb 6 10:20:23 2012 New Revision: 13861 Log: abcl-asdf: Use the JVM's notion of the classpath separator. Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Mon Feb 6 10:20:21 2012 (r13860) +++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Mon Feb 6 10:20:23 2012 (r13861) @@ -64,11 +64,11 @@ (defun as-classpath (classpath) "Break apart the JVM CLASSPATH string into a list of its consituents." - ;;; XXX Maybe doesn't work under Windows? - (split-string classpath ":")) + (split-string classpath + (java:jfield "java.io.File" "pathSeparator"))) (defun split-string (string split-char) (loop :for i = 0 :then (1+ j) :as j = (position split-char string :test #'string-equal :start i) :collect (subseq string i j) - :while j)) \ No newline at end of file + :while j)) From mevenson at common-lisp.net Mon Feb 6 18:20:26 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 06 Feb 2012 10:20:26 -0800 Subject: [armedbear-cvs] r13862 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Mon Feb 6 10:20:25 2012 New Revision: 13862 Log: Make ABCL-ASDF:SATISFY a generic function, override it to interpret mvn artifact streams. Now something like (satisfy "logj:log4j") will return the necessary classpath entries to add these dependencies specified by the Maven pom.xml graph in the hosting JVM process. Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Mon Feb 6 10:20:23 2012 (r13861) +++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Mon Feb 6 10:20:25 2012 (r13862) @@ -14,7 +14,7 @@ (defmethod find-component ((component iri) path) component) -;;; We interpret compilation to ensure that load-op will succeed +;;; We intercept compilation to ensure that load-op will succeed (defmethod perform ((op compile-op) (c mvn)) (maybe-parse-mvn c) (abcl-asdf:satisfy c)) @@ -54,7 +54,10 @@ (in-package #:abcl-asdf) -(defun satisfy (mvn-component) +(defgeneric satisfy (something) + :documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string." + +(defmethod satisfy ((mvn-component asdf::mvn)) "Resolve all runtime dependencies of MVN-COMPONENT. Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string." Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 10:20:23 2012 (r13861) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 10:20:25 2012 (r13862) @@ -368,3 +368,10 @@ #'log))) +;;; "log4j:log4j:1.9.2" or "log4j:log4j" +(defmethod satisfy ((string t)) + (let ((result (split-string string ":"))) + (cond + ((<= 2 (length result) 3) + (apply #'resolve-dependencies result))))) + From mevenson at common-lisp.net Mon Feb 6 18:20:27 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 06 Feb 2012 10:20:27 -0800 Subject: [armedbear-cvs] r13863 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Mon Feb 6 10:20:27 2012 New Revision: 13863 Log: abcl-asdf: always use runtime scope for resolving Maven artifacts. Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Mon Feb 6 10:20:25 2012 (r13862) +++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Mon Feb 6 10:20:27 2012 (r13863) @@ -55,7 +55,7 @@ (in-package #:abcl-asdf) (defgeneric satisfy (something) - :documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string." + (:documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string.")) (defmethod satisfy ((mvn-component asdf::mvn)) "Resolve all runtime dependencies of MVN-COMPONENT. Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 10:20:25 2012 (r13862) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Mon Feb 6 10:20:27 2012 (r13863) @@ -308,7 +308,7 @@ group-id artifact-id version))) (dependency (java:jnew (jss:find-java-class "aether.graph.Dependency") - artifact "compile")) + artifact (java:jfield (jss:find-java-class "JavaScopes") "RUNTIME"))) (collect-request (java:jnew (jss:find-java-class "CollectRequest")))) (#"setRoot" collect-request dependency) (#"addRepository" collect-request (ensure-remote-repository)) From rschlatte at common-lisp.net Tue Feb 7 08:59:25 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Tue, 07 Feb 2012 00:59:25 -0800 Subject: [armedbear-cvs] r13864 - in trunk/abcl: doc/manual src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Tue Feb 7 00:59:24 2012 New Revision: 13864 Log: Remove export of some internal symbols from package java. ... also re-create documentation. Modified: trunk/abcl/doc/manual/java.tex trunk/abcl/src/org/armedbear/lisp/Java.java Modified: trunk/abcl/doc/manual/java.tex ============================================================================== --- trunk/abcl/doc/manual/java.tex Mon Feb 6 10:20:27 2012 (r13863) +++ trunk/abcl/doc/manual/java.tex Tue Feb 7 00:59:24 2012 (r13864) @@ -136,43 +136,6 @@ \end{adjustwidth} \paragraph{} -\label{JAVA:GET-CURRENT-CLASSLOADER} -\index{GET-CURRENT-CLASSLOADER} ---- Function: \textbf{get-current-classloader} [\textbf{java}] \textit{} - -\begin{adjustwidth}{5em}{5em} -not-documented -\end{adjustwidth} - -\paragraph{} -\label{JAVA:JGET-PROPERTY-VALUE} -\index{JGET-PROPERTY-VALUE} ---- Function: \textbf{\%jget-property-value} [\textbf{java}] \textit{java-object property-name} - -\begin{adjustwidth}{5em}{5em} -Gets a JavaBeans property on JAVA-OBJECT. -SYSTEM-INTERNAL: Use jproperty-value instead. -\end{adjustwidth} - -\paragraph{} -\label{JAVA:JNEW-ARRAY-FROM-LIST} -\index{JNEW-ARRAY-FROM-LIST} ---- Function: \textbf{jnew-array-from-list} [\textbf{java}] \textit{element-type list} - -\begin{adjustwidth}{5em}{5em} -not-documented -\end{adjustwidth} - -\paragraph{} -\label{JAVA:JMETHOD} -\index{JMETHOD} ---- Function: \textbf{jmethod} [\textbf{java}] \textit{class-ref method-name \&rest parameter-class-refs} - -\begin{adjustwidth}{5em}{5em} -Returns a reference to the Java method METHOD-NAME of CLASS-REF with the given PARAMETER-CLASS-REFS. -\end{adjustwidth} - -\paragraph{} \label{JAVA:GET-DEFAULT-CLASSLOADER} \index{GET-DEFAULT-CLASSLOADER} --- Function: \textbf{get-default-classloader} [\textbf{java}] \textit{} @@ -191,6 +154,15 @@ \end{adjustwidth} \paragraph{} +\label{JAVA:GET-CURRENT-CLASSLOADER} +\index{GET-CURRENT-CLASSLOADER} +--- Function: \textbf{get-current-classloader} [\textbf{java}] \textit{} + +\begin{adjustwidth}{5em}{5em} +not-documented +\end{adjustwidth} + +\paragraph{} \label{JAVA:REGISTER-JAVA-EXCEPTION} \index{REGISTER-JAVA-EXCEPTION} --- Function: \textbf{register-java-exception} [\textbf{java}] \textit{exception-name condition-symbol} @@ -209,22 +181,30 @@ \end{adjustwidth} \paragraph{} -\label{JAVA:JPROPERTY-VALUE} -\index{JPROPERTY-VALUE} ---- Function: \textbf{jproperty-value} [\textbf{java}] \textit{obj prop} +\label{JAVA:JNEW-ARRAY-FROM-LIST} +\index{JNEW-ARRAY-FROM-LIST} +--- Function: \textbf{jnew-array-from-list} [\textbf{java}] \textit{element-type list} \begin{adjustwidth}{5em}{5em} not-documented \end{adjustwidth} \paragraph{} -\label{JAVA:JSET-PROPERTY-VALUE} -\index{JSET-PROPERTY-VALUE} ---- Function: \textbf{\%jset-property-value} [\textbf{java}] \textit{java-object property-name value} +\label{JAVA:JMETHOD} +\index{JMETHOD} +--- Function: \textbf{jmethod} [\textbf{java}] \textit{class-ref method-name \&rest parameter-class-refs} \begin{adjustwidth}{5em}{5em} -Sets a JavaBean property on JAVA-OBJECT. -SYSTEM-INTERNAL: Use (setf jproperty-value) instead. +Returns a reference to the Java method METHOD-NAME of CLASS-REF with the given PARAMETER-CLASS-REFS. +\end{adjustwidth} + +\paragraph{} +\label{JAVA:JPROPERTY-VALUE} +\index{JPROPERTY-VALUE} +--- Function: \textbf{jproperty-value} [\textbf{java}] \textit{obj prop} + +\begin{adjustwidth}{5em}{5em} +not-documented \end{adjustwidth} \paragraph{} Modified: trunk/abcl/src/org/armedbear/lisp/Java.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/Java.java Mon Feb 6 10:20:27 2012 (r13863) +++ trunk/abcl/src/org/armedbear/lisp/Java.java Tue Feb 7 00:59:24 2012 (r13864) @@ -1228,7 +1228,7 @@ { pf__jget_property_value() { - super("%jget-property-value", PACKAGE_JAVA, true, + super("%jget-property-value", PACKAGE_JAVA, false, "java-object property-name"); } @@ -1259,7 +1259,7 @@ { pf__jset_property_value() { - super("%jset-property-value", PACKAGE_JAVA, true, + super("%jset-property-value", PACKAGE_JAVA, false, "java-object property-name value"); } From mevenson at common-lisp.net Tue Feb 7 14:53:25 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Tue, 07 Feb 2012 06:53:25 -0800 Subject: [armedbear-cvs] r13865 - trunk/abcl/contrib/abcl-asdf Message-ID: Author: mevenson Date: Tue Feb 7 06:53:22 2012 New Revision: 13865 Log: abcl-asdf: Rename SATISFY to RESOLVE. Re-jiggle the exported symbols Sharpen documentation, adding docstrings. Freshen README.markdown. Modified: trunk/abcl/contrib/abcl-asdf/README.markdown trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp trunk/abcl/contrib/abcl-asdf/packages.lisp Modified: trunk/abcl/contrib/abcl-asdf/README.markdown ============================================================================== --- trunk/abcl/contrib/abcl-asdf/README.markdown Tue Feb 7 00:59:24 2012 (r13864) +++ trunk/abcl/contrib/abcl-asdf/README.markdown Tue Feb 7 06:53:22 2012 (r13865) @@ -11,20 +11,36 @@ ABCL specific contributions to ASDF system definition mainly concerned with finding JVM artifacts such as jar archives to be dynamically loaded. -Examples --------- +Example 1 +--------- + +For the following ASDF definition stored in a file named "log4j.asd" +that loadable by ASDF ;;;; -*- Mode: LISP -*- (in-package :asdf) - (defsystem :log4j - :components ((:mvn "log4j/log4j" - :version "1.4.9"))) + (defsystem log4j + :components ((:mvn "log4j/log4j/1.4.9"))) + +After issuing + + CL-USER> (asdf:load-system :log4j) + +all the Log4j libraries would be dynamically added to the classpath so +that the following code would + + (let ((logger (#"getLogger" 'log4j.Logger (symbol-name (gensym))))) + (#"trace" logger "Kilroy wuz here."))) + + output the message "Kilroy wuz here" to the log4j logging system. + API --- -We define an API as consisting of the following ASDF classes: +We define an API within the ASDF package consisting of the following +ASDF classes: JAR-DIRECTORY, JAR-FILE, and CLASS-FILE-DIRECTORY for JVM artifacts that have a currently valid pathname representation @@ -32,24 +48,34 @@ 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, -RESOLVE-DEPENDENCIES which locates, downloads, caches, and then loads +For use outside of ASDF, we currently define the generic function +ABCL-ASDF:RESOLVE which locates, downloads, caches, and then loads into the currently executing JVM process all recursive dependencies annotated in the Maven pom.xml graph. +One can muffle the verbosity of the Maven Aether resolver by setting +ABCL-ASDF:*MAVEN-VERBOSE* to NIL. + Example 2 --------- Bypassing ASDF, one can directly issue requests for the Maven artifacts to be downloaded - CL-USER> (abcl-asdf:resolve-dependencies "com.google.gwt" "gwt-user") + CL-USER> (abcl-asdf:resolve "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" Notice that all recursive dependencies have been located and installed as well. +ABCL-ASDF:RESOLVE does not added the resolved dependencies to the +current JVM classpath. Use JAVA:ADD-TO-CLASSPATH as follows to do +that: + + CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user"))) + + Example 3 --------- @@ -102,16 +128,21 @@ ((:jar-file "WSML-grammar-20081202") (:jar-file "wsmo-api-0.6.2") (:jar-file "wsmo4j-0.6.2"))) - (:module log4j-libs - :pathname "lib/ext/log4j/" :components - ((:jar-file "log4j-1.2.14"))))) + (:module log4j-libs + :pathname "lib/ext/log4j/" :components + ((:jar-file "log4j-1.2.14"))))) [1]: http://www.iris-reasoner.org/ - -Problems +Releases -------- +### 0.7.0 2012-02-05 + +Plausibly work under MSFT operating systems. + +Working with maven-3.0.4 and working in more places. + ### 0.5.0 2012-01-22 o just bless this as a release to stablize its offered API "as is" @@ -138,5 +169,5 @@ Mark Created: 2011-01-01 - Revised: 2012-01-24 + Revised: 2012-02-06 Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Tue Feb 7 00:59:24 2012 (r13864) +++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Tue Feb 7 06:53:22 2012 (r13865) @@ -17,13 +17,13 @@ ;;; We intercept compilation to ensure that load-op will succeed (defmethod perform ((op compile-op) (c mvn)) (maybe-parse-mvn c) - (abcl-asdf:satisfy c)) + (abcl-asdf:resolve c)) (defmethod perform ((operation load-op) (c mvn)) (maybe-parse-mvn c) (java:add-to-classpath (abcl-asdf:as-classpath - (abcl-asdf:satisfy c)))) + (abcl-asdf:resolve c)))) ;;; A Maven URI has the form "mvn:group-id/artifact-id/version" ;;; @@ -54,10 +54,10 @@ (in-package #:abcl-asdf) -(defgeneric satisfy (something) +(defgeneric resolve (something) (:documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string.")) -(defmethod satisfy ((mvn-component asdf::mvn)) +(defmethod resolve ((mvn-component asdf::mvn)) "Resolve all runtime dependencies of MVN-COMPONENT. Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string." Modified: trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Tue Feb 7 00:59:24 2012 (r13864) +++ trunk/abcl/contrib/abcl-asdf/maven-embedder.lisp Tue Feb 7 06:53:22 2012 (r13865) @@ -3,9 +3,12 @@ #| -# Implementation references +# Implementation + +Not multi-threaded safe, and unclear how much work that would be. ## Installing Maven +http://maven.apache.org/download.html ## Current Javadoc for Maven Aether connector http://sonatype.github.com/sonatype-aether/apidocs/overview-summary.html @@ -13,6 +16,10 @@ ## Incomplete, seemingly often wrong https://docs.sonatype.org/display/AETHER/Home +Note that this is not an implementation of Maven per se, but the use +of the Maven Aether connector infrastructure. Among other things, this means +that the Maven specific "~/.m2/settings.xml" file is NOT parsed for settings. + |# (in-package :abcl-asdf) @@ -368,8 +375,15 @@ #'log))) -;;; "log4j:log4j:1.9.2" or "log4j:log4j" -(defmethod satisfy ((string t)) +(defmethod resolve ((string t)) + "Resolve a colon separated GROUP-ID:ARTIFACT-ID[:VERSION] reference to a Maven artifact. + +Examples of artifact references: \"log4j:log4j:1.2.14\" for +'log4j-1.2.14.jar'. Resolving \"log4j:log4j\" would return the latest +version of the artifact known to the distributed Maven pom.xml graph. + +Returns a string containing the necessary classpath entries for this +artifact and all of its transitive dependencies." (let ((result (split-string string ":"))) (cond ((<= 2 (length result) 3) Modified: trunk/abcl/contrib/abcl-asdf/packages.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/packages.lisp Tue Feb 7 00:59:24 2012 (r13864) +++ trunk/abcl/contrib/abcl-asdf/packages.lisp Tue Feb 7 06:53:22 2012 (r13865) @@ -2,7 +2,10 @@ (:use :cl) (:export ;;; Public API + #:resolve + #:resolve-dependencies + #:resolve-artifact #:find-mvn @@ -22,7 +25,6 @@ #:resolve-artifact #:resolve-dependencies - #:satisfy #:as-classpath #:add-directory-jars-to-class-path From mevenson at common-lisp.net Tue Feb 7 16:36:33 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Tue, 07 Feb 2012 08:36:33 -0800 Subject: [armedbear-cvs] r13866 - in trunk/abcl: doc/manual src/org/armedbear/lisp Message-ID: Author: mevenson Date: Tue Feb 7 08:36:32 2012 New Revision: 13866 Log: Promote JAVA:JARRAY-FROM-LIST to the public API. Re-run grovel on the docstrings. Modified: trunk/abcl/doc/manual/extensions.tex trunk/abcl/doc/manual/java.tex trunk/abcl/doc/manual/threads.tex trunk/abcl/src/org/armedbear/lisp/autoloads.lisp Modified: trunk/abcl/doc/manual/extensions.tex ============================================================================== --- trunk/abcl/doc/manual/extensions.tex Tue Feb 7 06:53:22 2012 (r13865) +++ trunk/abcl/doc/manual/extensions.tex Tue Feb 7 08:36:32 2012 (r13866) @@ -85,7 +85,7 @@ --- Function: \textbf{process-kill} [\textbf{extensions}] \textit{process} \begin{adjustwidth}{5em}{5em} -not-documented +Kills the process. \end{adjustwidth} \paragraph{} Modified: trunk/abcl/doc/manual/java.tex ============================================================================== --- trunk/abcl/doc/manual/java.tex Tue Feb 7 06:53:22 2012 (r13865) +++ trunk/abcl/doc/manual/java.tex Tue Feb 7 08:36:32 2012 (r13866) @@ -114,7 +114,9 @@ --- Function: \textbf{jclass-of} [\textbf{java}] \textit{object \&optional name} \begin{adjustwidth}{5em}{5em} -not-documented +Returns the name of the Java class of OBJECT. If the NAME argument is + supplied, verifies that OBJECT is an instance of the named class. The name + of the class or nil is always returned as a second value. \end{adjustwidth} \paragraph{} @@ -353,7 +355,20 @@ --- Function: \textbf{jclass-name} [\textbf{java}] \textit{class-ref \&optional name} \begin{adjustwidth}{5em}{5em} -not-documented +When called with one argument, returns the name of the Java class + designated by CLASS-REF. When called with two arguments, tests + whether CLASS-REF matches NAME. +\end{adjustwidth} + +\paragraph{} +\label{JAVA:JARRAY-FROM-LIST} +\index{JARRAY-FROM-LIST} +--- Function: \textbf{jarray-from-list} [\textbf{java}] \textit{list} + +\begin{adjustwidth}{5em}{5em} +Return a Java array from LIST whose type is inferred from the first element. + +For more control over the type of the array, use JNEW-ARRAY-FROM-LIST. \end{adjustwidth} \paragraph{} Modified: trunk/abcl/doc/manual/threads.tex ============================================================================== --- trunk/abcl/doc/manual/threads.tex Tue Feb 7 06:53:22 2012 (r13865) +++ trunk/abcl/doc/manual/threads.tex Tue Feb 7 08:36:32 2012 (r13866) @@ -4,7 +4,7 @@ --- Function: \textbf{mailbox-empty-p} [\textbf{threads}] \textit{mailbox} \begin{adjustwidth}{5em}{5em} -not-documented +Returns non-NIL if the mailbox can be read from, NIL otherwise. \end{adjustwidth} \paragraph{} Modified: trunk/abcl/src/org/armedbear/lisp/autoloads.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/autoloads.lisp Tue Feb 7 06:53:22 2012 (r13865) +++ trunk/abcl/src/org/armedbear/lisp/autoloads.lisp Tue Feb 7 08:36:32 2012 (r13866) @@ -250,6 +250,8 @@ (autoload 'jnew-array-from-array "java") (export 'jnew-array-from-list "JAVA") (autoload 'jnew-array-from-list "java") +(export 'jarray-from-list "JAVA") +(autoload 'jarray-from-list "java") (export 'jclass-constructors "JAVA") (autoload 'jclass-constructors "java") (export 'jconstructor-params "JAVA") From mevenson at common-lisp.net Wed Feb 8 08:21:39 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 08 Feb 2012 00:21:39 -0800 Subject: [armedbear-cvs] r13867 - in trunk/abcl/contrib/abcl-asdf: . tests Message-ID: Author: mevenson Date: Wed Feb 8 00:21:35 2012 New Revision: 13867 Log: abcl-asdf: fix logic for dealing with ASDF::MVN entries without ASDF::VERSION. Modified: trunk/abcl/contrib/abcl-asdf/README.markdown trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp trunk/abcl/contrib/abcl-asdf/tests/log4j.asd Modified: trunk/abcl/contrib/abcl-asdf/README.markdown ============================================================================== --- trunk/abcl/contrib/abcl-asdf/README.markdown Tue Feb 7 08:36:32 2012 (r13866) +++ trunk/abcl/contrib/abcl-asdf/README.markdown Wed Feb 8 00:21:35 2012 (r13867) @@ -21,7 +21,7 @@ (in-package :asdf) (defsystem log4j - :components ((:mvn "log4j/log4j/1.4.9"))) + :components ((:mvn "log4j/log4j/1.2.13"))) After issuing @@ -31,27 +31,28 @@ that the following code would (let ((logger (#"getLogger" 'log4j.Logger (symbol-name (gensym))))) - (#"trace" logger "Kilroy wuz here."))) + (#"trace" logger "Kilroy wuz here.")) - output the message "Kilroy wuz here" to the log4j logging system. +output the message "Kilroy wuz here" to the log4j logging system. API --- We define an API within the ASDF package consisting of the following -ASDF classes: +ASDF classes derived from ASDF:COMPONENT: JAR-DIRECTORY, JAR-FILE, and CLASS-FILE-DIRECTORY for JVM artifacts -that have a currently valid pathname representation +that have a currently valid pathname representation (i.e. they exist +on the local filesystem). -And the MVN and IRI classes descend from ASDF-COMPONENT, but do not +And we define MVN and IRI classes descend from ASDF-COMPONENT, but do not directly have a filesystem location. For use outside of ASDF, we currently define the generic function ABCL-ASDF:RESOLVE which locates, downloads, caches, and then loads into the currently executing JVM process all recursive dependencies -annotated in the Maven pom.xml graph. +annotated in the ditributed Maven pom.xml graph. One can muffle the verbosity of the Maven Aether resolver by setting ABCL-ASDF:*MAVEN-VERBOSE* to NIL. @@ -75,8 +76,6 @@ CL-USER> (java:add-to-classpath (abcl-asdf:as-classpath (abcl-asdf:resolve "com.google.gwt:gwt-user"))) - - Example 3 --------- @@ -141,7 +140,7 @@ Plausibly work under MSFT operating systems. -Working with maven-3.0.4 and working in more places. +Working with maven-3.0.4. ### 0.5.0 2012-01-22 Modified: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp ============================================================================== --- trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Tue Feb 7 08:36:32 2012 (r13866) +++ trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp Wed Feb 8 00:21:35 2012 (r13867) @@ -31,20 +31,25 @@ ;;; use the component 'version' for the version string. (defun maybe-parse-mvn (component) (with-slots (asdf::name asdf::group-id asdf::artifact-id - asdf::version asdf::schema asdf::path) component + asdf::version asdf::schema asdf::path) + component (when (null asdf::artifact-id) - (let ((slash (search "/" name))) - (unless (and (integerp slash) - asdf::version) + (let ((parsed (abcl-asdf::split-string name "/"))) + (unless (or (= (length parsed) 3) + (and (= (length parsed) 2) + asdf::version)) (error "Failed to construct a mvn reference from name '~A' and version '~A'" - asdf::name asdf::version)) - (setf asdf::group-id (subseq asdf::name 0 slash) - asdf::artifact-id (subseq asdf::name (1+ slash)) - asdf::schema "mvn" - asdf::version (if (eq asdf::version :latest) - "LATEST" - asdf::version) - asdf::path (format nil "~A/~A" asdf::name asdf::version)))))) + asdf::name + (if asdf::version + asdf::version + "UNSPECIFED"))) + (setf asdf::group-id (first parsed) + asdf::artifact-id (second parsed) + asdf::schema "mvn" + asdf::version (if (third parsed) + (third parsed) + "LATEST")) + (setf asdf::path (format nil "~A/~A" asdf::name asdf::version)))))) (defmethod source-file-type ((component iri) (system system)) nil) Modified: trunk/abcl/contrib/abcl-asdf/tests/log4j.asd ============================================================================== --- trunk/abcl/contrib/abcl-asdf/tests/log4j.asd Tue Feb 7 08:36:32 2012 (r13866) +++ trunk/abcl/contrib/abcl-asdf/tests/log4j.asd Wed Feb 8 00:21:35 2012 (r13867) @@ -4,7 +4,7 @@ (defsystem :log4j :components ((:module log4j.jar :components - ((:mvn "log4j/log4j" :version "1.2.15"))) + ((:mvn "log4j/log4j/1.2.15"))) (:module source :pathname "" :components ((:file "example")) :depends-on (log4j.jar)))) From rschlatte at common-lisp.net Wed Feb 8 11:18:45 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Wed, 08 Feb 2012 03:18:45 -0800 Subject: [armedbear-cvs] r13868 - trunk/abcl/doc/manual Message-ID: Author: rschlatte Date: Wed Feb 8 03:18:44 2012 New Revision: 13868 Log: Fix tilde appearances. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Wed Feb 8 00:21:35 2012 (r13867) +++ trunk/abcl/doc/manual/abcl.tex Wed Feb 8 03:18:44 2012 (r13868) @@ -147,13 +147,13 @@ \begin{description} \item[\texttt{--help}] displays a help message. \item[\texttt{--noinform}] Suppresses the printing of startup information and banner. -\item[\texttt{--noinit}] suppresses the loading of the \texttt{\~/.abclrc} startup file. +\item[\texttt{--noinit}] suppresses the loading of the \verb+~/.abclrc+ startup file. \item[\texttt{--nosystem}] suppresses loading the \texttt{system.lisp} customization file. \item[\texttt{--eval FORM}] evaluates FORM before initializing the REPL. \item[\texttt{--load FILE}] loads the file FILE before initializing the REPL. \item[\texttt{--load-system-file FILE}] loads the system file FILE before initializing the REPL. \item[\texttt{--batch}] evaluates forms specified by arguments and in - the intialization file \texttt{\~/.abclrc}, and then exits without + the intialization file \verb+~/.abclrc+, and then exits without starting a REPL. \end{description} @@ -1182,7 +1182,7 @@ Superseded by Quicklisp (see Xach2011 \cite{quicklisp}). The \code{require} of the \code{asdf-install} symbol has the side -effect of pushing the directory ``\~/.asdf-install-dir/systems/'' into +effect of pushing the directory \verb+~/.asdf-install-dir/systems/+ into the value of the \textsc{ASDF} central registry in \code{asdf:*central-registry*}, providing a convenient mechanism for stashing \textsc{ABCL} specific system definitions for convenient From mevenson at common-lisp.net Thu Feb 9 05:46:06 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 08 Feb 2012 21:46:06 -0800 Subject: [armedbear-cvs] r13869 - trunk/abcl/contrib/jss Message-ID: Author: mevenson Date: Wed Feb 8 21:46:03 2012 New Revision: 13869 Log: jss doc: spellchecking Modified: trunk/abcl/contrib/jss/README.markdown Modified: trunk/abcl/contrib/jss/README.markdown ============================================================================== --- trunk/abcl/contrib/jss/README.markdown Wed Feb 8 03:18:44 2012 (r13868) +++ trunk/abcl/contrib/jss/README.markdown Wed Feb 8 21:46:03 2012 (r13869) @@ -1,7 +1,7 @@ JSS === -Created by Alan Ruttenburg +Created by Alan Ruttenberg JSS stands for either "Java Simple Syntax" or "Java Syntax Sucks", @@ -107,7 +107,7 @@ mode to existing users of JSS by importing the necessary symbols into CL-USER. -Some notes on other compatibilty issues: +Some notes on other compatibility issues: *classpath-manager* From mevenson at common-lisp.net Sat Feb 11 15:53:35 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Sat, 11 Feb 2012 07:53:35 -0800 Subject: [armedbear-cvs] r13870 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Sat Feb 11 07:53:33 2012 New Revision: 13870 Log: See #196: further patch for STABLE-SORT from Jorge Tavares. easye: still seeing the ANSI failures, but this is a much more plausible "final" implementation with the appropiate optimizations which should be easier to fix modulo the possible hairy macro debugging part. But that's why they call it trunk, right? I send in attach a patch with further improvements to sort and stable-sort for sequences other than lists. In short, the patch includes a merge sort for vectors. To allow different types I've written the algorithm using macros and these generate the appropriate code according to the vector type. This way the algorithm is in a single place avoiding duplication of code. The macros also take care of the situation of when no key is present, avoiding the use of unnecessary funcalls. The quicksort algorithm was also refactored in the same way. I've tested the algorithms and they seem to be working correct. Stable sort is now considerably faster since the fix before converted the sequences to a list and used the sort-list function. I've made some benchmarking to verify how fast is sort and stable-sort. The tables with the results are also in a file sent in attach [1]. For stable-sort I've compare the current trunk version with the patched one while for sort I've compared 1.0.1, the trunk and with the patch. For unsorted vectors sort has a speed up of 7.5 from 1.0.1 and this considers only vectors of size 8 to 8192 (1.0.1 hits the worst-case quite fast). For stable-sort the speed up is around 90.2 from vectors of size 8 to 32768. The sort functions become even faster for the nearly sorted vectors. I think the tables clearly show t he speed-ups Naturally these benchmarks cannot be used to draw definite conclusions since they lack rigorous testing but I think they can provide some indications. With this patch, I think ABCL gets good performant sorting functions, especially for large vectors. As for lists, I haven't looked at them so probably they can also be improved (but I really don't know). Cheers, Jorge [1] The tables result from the generation of simple-vectors of sizes 8 to 524288 (powers of 2 from 3 to 19) with distinct integer: unsorted, nearly sorted (distances 0, 4 and 16), sorted and reversed sorted. The nearly sorted vectors were constructed by selecting pairs where they would swap with a neighbor at a certain distance. I did 100 runs and timed only the sorting operation. The tables contain the averages of the 100 runs. They were performed in an iMac (2.5GHz i5, 4GB) with Mac OS X 10.7.3. [1]: http://article.gmane.org/gmane.lisp.armedbear.devel/2220 Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/sort.lisp Wed Feb 8 21:46:03 2012 (r13869) +++ trunk/abcl/src/org/armedbear/lisp/sort.lisp Sat Feb 11 07:53:33 2012 (r13870) @@ -33,26 +33,149 @@ (require "EXTENSIBLE-SEQUENCES-BASE") -(defun sort (sequence predicate &rest args &key key) - (sequence::seq-dispatch sequence - (sort-list sequence predicate key) - (quicksort sequence 0 (1- (length sequence)) predicate (or key #'identity)) - (apply #'sequence:sort sequence predicate args))) +;;; +;;; STABLE SORT +;;; + +;;; +;;; MERGE SORT for vectors (and sequences in general) +;;; +;;; - top-down stable merge sort +;;; - it is defined with 2 macros to allow a single algorithm +;;; and multiple sequence types: merge-vectors-body and merge-sort-body +;;; - merge-vectors-body merges two given sequences +;;; - merge-sort-body contains the top-down algorithm +;;; - the body macro is called by the merge-sort-vectors functions, +;;; which typecases the type of sequence and expands the apropriate body +;;; - more types of sequences/vectors can be added +;;; - the macros generate the merge sort body with or without funcall to key +;;; - the merge-vectors algorithm is inspired from the CCL base code +;;; + +(defmacro merge-vectors-body (type ref a start-a end-a b start-b end-b aux start-aux predicate &optional key) + (let ((i-a (gensym)) + (i-b (gensym)) + (i-aux (gensym)) + (v-a (gensym)) + (v-b (gensym)) + (k-a (gensym)) + (k-b (gensym)) + (merge-block (gensym))) + `(locally + (declare (type fixnum ,start-a ,end-a ,start-b ,end-b ,start-aux) + (type ,type ,a ,b) + (type simple-vector ,aux) + (type function ,predicate ,@(if key `(,key))) + (optimize (speed 3) (safety 0))) + (block ,merge-block + (let ((,i-a ,start-a) + (,i-b ,start-b) + (,i-aux ,start-aux) + ,v-a ,v-b ,k-a ,k-b) + (declare (type fixnum ,i-a ,i-b ,i-aux)) + (cond ((= ,start-a ,end-a) + (when (= ,start-b ,end-b) + (return-from ,merge-block)) + (setf ,i-a ,start-b + ,end-a ,end-b + ,a ,b + ,v-a (,ref ,a ,i-a))) + ((= ,start-b ,end-b) + (setf ,i-a ,start-a + ,v-a (,ref ,a ,i-a))) + (t + (setf ,v-a (,ref ,a ,i-a) + ,v-b (,ref ,b ,i-b) + ,@(if key + `(,k-a (funcall ,key ,v-a)) + `(,k-a ,v-a)) + ,@(if key + `(,k-b (funcall ,key ,v-b)) + `(,k-b ,v-b))) + (loop + (if (funcall ,predicate ,k-b ,k-a) + (progn + (setf (svref ,aux ,i-aux) ,v-b + ,i-aux (+ ,i-aux 1) + ,i-b (+ ,i-b 1)) + (when (= ,i-b ,end-b) (return)) + (setf ,v-b (,ref ,b ,i-b) + ,@(if key + `(,k-b (funcall ,key ,v-b)) + `(,k-b ,v-b)))) + (progn + (setf (svref ,aux ,i-aux) ,v-a + ,i-aux (+ ,i-aux 1) + ,i-a (+ ,i-a 1)) + (when (= ,i-a ,end-a) + (setf ,a ,b + ,i-a ,i-b + ,end-a ,end-b + ,v-a ,v-b) + (return)) + (setf ,v-a (,ref ,a ,i-a) + ,@(if key + `(,k-a (funcall ,key ,v-a)) + `(,k-a ,v-a)))))))) + (loop + (setf (svref ,aux ,i-aux) ,v-a + ,i-a (+ ,i-a 1)) + (when (= ,i-a ,end-a) (return)) + (setf ,v-a (,ref ,a ,i-a) + ,i-aux (+ ,i-aux 1)))))))) + +(defmacro merge-sort-body (type ref mpredicate mkey msequence mstart mend) + (let ((merge-sort-call (gensym)) + (maux (gensym)) + (aux (gensym)) + (sequence (gensym)) + (start (gensym)) + (end (gensym)) + (predicate (gensym)) + (key (gensym)) + (mid (gensym)) + (direction (gensym))) + `(locally + (declare (optimize (speed 3) (safety 0))) + (labels ((,merge-sort-call (,sequence ,start ,end ,predicate ,key ,aux ,direction) + (declare (type function ,predicate ,@(if mkey `(,key))) + (type fixnum ,start ,end) + (type ,type ,sequence)) + (let ((,mid (+ ,start (ash (- ,end ,start) -1)))) + (declare (type fixnum ,mid)) + (if (<= (- ,mid 1) ,start) + (unless ,direction (setf (,ref ,aux ,start) (,ref ,sequence ,start))) + (,merge-sort-call ,sequence ,start ,mid ,predicate ,key ,aux (not ,direction))) + (if (>= (+ ,mid 1) ,end) + (unless ,direction (setf (,ref ,aux ,mid) (,ref ,sequence ,mid))) + (,merge-sort-call ,sequence ,mid ,end ,predicate ,key ,aux (not ,direction))) + (unless ,direction (psetq ,sequence ,aux ,aux ,sequence)) + ,(if mkey + `(merge-vectors-body ,type ,ref ,sequence ,start ,mid ,sequence + ,mid ,end ,aux ,start ,predicate ,key) + `(merge-vectors-body ,type ,ref ,sequence ,start ,mid ,sequence + ,mid ,end ,aux ,start ,predicate))))) + (let ((,maux (make-array ,mend))) + (declare (type simple-vector ,maux)) + (,merge-sort-call ,msequence ,mstart ,mend ,mpredicate ,mkey ,maux nil)))))) + +(defun merge-sort-vectors (sequence predicate key) + (let ((end (length sequence))) + (typecase sequence + (simple-vector + (if key + (merge-sort-body simple-vector svref predicate key sequence 0 end) + (merge-sort-body simple-vector svref predicate nil sequence 0 end))) + (vector + (if key + (merge-sort-body vector aref predicate key sequence 0 end) + (merge-sort-body vector aref predicate nil sequence 0 end)))) + sequence)) -(defun stable-sort (sequence predicate &rest args &key key) - (sequence::seq-dispatch sequence - (sort-list sequence predicate key) -;;; Jorge Tavares: -;;; As a quick fix, I send in attach a patch that uses in stable-sort merge -;;; sort for all sequences. This is done by coercing the sequence to list, -;;; calling merge sort and coercing it back to the original sequence type. -;;; However, as a long term improvement, the best solution would be to -;;; implement a merge sort for non-list sequences. - (coerce (sort-list (coerce sequence 'list) - predicate - key) - (type-of sequence)) - (apply #'sequence:stable-sort sequence predicate args))) + +;;; +;;; MERGE SORT for lists +;;; ;; Adapted from SBCL. (declaim (ftype (function (list) cons) last-cons-of)) @@ -182,107 +305,105 @@ (if (eq list-1 (cdr head)) (return list-1)))))) -#| -<> dc:author "Jorge Tavares" ; - dc:description -""" -The quicksort function picks the pivot by selecting a midpoint and -also sorts the smaller partition first. These are enough to avoid the -stack overflow problem as reported. I've performed some tests and it -looks it is correct -"""" . -|# + +;;; +;;; SORT +;;; + ;;; ;;; QUICKSORT -;;; - the pivot is a middle point +;;; +;;; - algorithm is in the quicksort-body macro, so that it allows +;;; the use of different types (e.g., simple-vector, vector) +;;; - the pivot is picked by selecting middle point ;;; - sorts the smaller partition first +;;; - the macro generates the quicksort body with or without funcall to key +;;; + +(defmacro quicksort-body (type ref mpredicate mkey sequence mstart mend) + (let ((quicksort-call (gensym)) + (predicate (gensym)) + (key (gensym)) + (vector (gensym)) + (start (gensym)) + (end (gensym)) + (i (gensym)) + (j (gensym)) + (p (gensym)) + (d (gensym)) + (kd (gensym))) + `(locally + (declare (speed 3) (safety 0)) + (labels ((,quicksort-call (,vector ,start ,end ,predicate ,key) + (declare (type function ,predicate ,@(if mkey `(,key))) + (type fixnum ,start ,end) + (type ,type ,sequence)) + (if (< ,start ,end) + (let* ((,i ,start) + (,j (1+ ,end)) + (,p (the fixnum (+ ,start (ash (- ,end ,start) -1)))) + (,d (,ref ,vector ,p)) + ,@(if mkey + `((,kd (funcall ,key ,d))) + `((,kd ,d)))) + (rotatef (,ref ,vector ,p) (,ref ,vector ,start)) + (block outer-loop + (loop + (loop + (unless (> (decf ,j) ,i) (return-from outer-loop)) + (when (funcall ,predicate + ,@(if mkey + `((funcall ,key (,ref ,vector ,j))) + `((,ref ,vector ,j))) + ,kd) (return))) + (loop + (unless (< (incf ,i) ,j) (return-from outer-loop)) + (unless (funcall ,predicate + ,@(if mkey + `((funcall ,key (,ref ,vector ,i))) + `((,ref ,vector ,i))) + ,kd) (return))) + (rotatef (,ref ,vector ,i) (,ref ,vector ,j)))) + (setf (,ref ,vector ,start) (,ref ,vector ,j) + (,ref ,vector ,j) ,d) + (if (< (- ,j ,start) (- ,end ,j)) + (progn + (,quicksort-call ,vector ,start (1- ,j) ,predicate ,key) + (,quicksort-call ,vector (1+ ,j) ,end ,predicate ,key)) + (progn + (,quicksort-call ,vector (1+ ,j) ,end ,predicate ,key) + (,quicksort-call ,vector ,start (1- ,j) ,predicate ,key))))))) + (,quicksort-call ,sequence ,mstart ,mend ,mpredicate ,mkey))))) + +(defun quicksort (sequence predicate key) + (let ((end (1- (length sequence)))) + (typecase sequence + (simple-vector + (if key + (quicksort-body simple-vector svref predicate key sequence 0 end) + (quicksort-body simple-vector svref predicate nil sequence 0 end))) + (vector + (if key + (quicksort-body vector aref predicate key sequence 0 end) + (quicksort-body vector aref predicate nil sequence 0 end)))) + sequence)) + + +;;; +;;; main SORT and STABLE-SORT function calls ;;; -(defun quicksort (vector start end predicate key) - (declare (type fixnum start end) - (type function predicate key)) - (if (< start end) - (let* ((i start) - (j (1+ end)) - (p (+ start (ash (- end start) -1))) - (d (aref vector p)) - (kd (funcall key d))) - (rotatef (aref vector p) (aref vector start)) - (block outer-loop - (loop - (loop - (unless (> (decf j) i) (return-from outer-loop)) - (when (funcall predicate - (funcall key (aref vector j)) kd) - (return))) - (loop - (unless (< (incf i) j) (return-from outer-loop)) - (unless (funcall predicate - (funcall key (aref vector i)) kd) - (return))) - (rotatef (aref vector i) (aref vector j)))) - (setf (aref vector start) (aref vector j) - (aref vector j) d) - (if (< (- j start) (- end j)) - (progn - (quicksort vector start (1- j) predicate key) - (quicksort vector (1+ j) end predicate key)) - (progn - (quicksort vector (1+ j) end predicate key) - (quicksort vector start (1- j) predicate key)))) - vector)) - -;;; DEPRECATED -- to be removed in abcl-1.4 -;;; From ECL. -(defun quick-sort (seq start end pred key) - (unless key (setq key #'identity)) - (if (<= end (1+ start)) - seq - (let* ((j start) (k end) (d (elt seq start)) (kd (funcall key d))) - (block outer-loop - (loop (loop (decf k) - (unless (< j k) (return-from outer-loop)) - (when (funcall pred (funcall key (elt seq k)) kd) - (return))) - (loop (incf j) - (unless (< j k) (return-from outer-loop)) - (unless (funcall pred (funcall key (elt seq j)) kd) - (return))) - (let ((temp (elt seq j))) - (setf (elt seq j) (elt seq k) - (elt seq k) temp)))) - (setf (elt seq start) (elt seq j) - (elt seq j) d) - (quick-sort seq start j pred key) - (quick-sort seq (1+ j) end pred key)))) - -;;; From ECL. Should already be user-extensible as it does no type dispatch -;;; and uses only user-extensible functions. -(defun merge (result-type sequence1 sequence2 predicate - &key key - &aux (l1 (length sequence1)) (l2 (length sequence2))) - (unless key (setq key #'identity)) - (do ((newseq (make-sequence result-type (+ l1 l2))) - (j 0 (1+ j)) - (i1 0) - (i2 0)) - ((and (= i1 l1) (= i2 l2)) newseq) - (cond ((and (< i1 l1) (< i2 l2)) - (cond ((funcall predicate - (funcall key (elt sequence1 i1)) - (funcall key (elt sequence2 i2))) - (setf (elt newseq j) (elt sequence1 i1)) - (incf i1)) - ((funcall predicate - (funcall key (elt sequence2 i2)) - (funcall key (elt sequence1 i1))) - (setf (elt newseq j) (elt sequence2 i2)) - (incf i2)) - (t - (setf (elt newseq j) (elt sequence1 i1)) - (incf i1)))) - ((< i1 l1) - (setf (elt newseq j) (elt sequence1 i1)) - (incf i1)) - (t - (setf (elt newseq j) (elt sequence2 i2)) - (incf i2))))) +;;; - sort: quicksort and merge sort (only for lists) +;;; - stable-sort: merge sort (all types) +;;; + +(defun sort (sequence predicate &rest args &key key) + (sequence::seq-dispatch sequence + (sort-list sequence predicate key) + (quicksort sequence predicate key) + (apply #'sequence:sort sequence predicate args))) + +(defun stable-sort (sequence predicate &rest args &key key) + (sequence::seq-dispatch sequence + (sort-list sequence predicate key) + (merge-sort-vectors sequence predicate key) + (apply #'sequence:stable-sort sequence predicate args))) From rschlatte at common-lisp.net Sat Feb 11 22:28:12 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Sat, 11 Feb 2012 14:28:12 -0800 Subject: [armedbear-cvs] r13871 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Sat Feb 11 14:28:11 2012 New Revision: 13871 Log: Add FuncallableStandardClass.java ... make classes generic-function and standard-generic-function instances of funcallable-standard-class, per AMOP. Added: trunk/abcl/src/org/armedbear/lisp/FuncallableStandardClass.java - copied, changed from r13870, trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java Modified: trunk/abcl/src/org/armedbear/lisp/StandardClass.java trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java Copied and modified: trunk/abcl/src/org/armedbear/lisp/FuncallableStandardClass.java (from r13870, trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java) ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java Sat Feb 11 07:53:33 2012 (r13870, copy source) +++ trunk/abcl/src/org/armedbear/lisp/FuncallableStandardClass.java Sat Feb 11 14:28:11 2012 (r13871) @@ -1,7 +1,7 @@ /* - * StandardGenericFunctionClass.java + * StandardClass.java * - * Copyright (C) 2005 Peter Graves + * Copyright (C) 2003-2005 Peter Graves * $Id$ * * This program is free software; you can redistribute it and/or @@ -35,46 +35,66 @@ import static org.armedbear.lisp.Lisp.*; -public final class StandardGenericFunctionClass extends StandardClass +public class FuncallableStandardClass extends StandardClass { - public static final int SLOT_INDEX_NAME = 0; - public static final int SLOT_INDEX_LAMBDA_LIST = 1; - public static final int SLOT_INDEX_REQUIRED_ARGS = 2; - public static final int SLOT_INDEX_OPTIONAL_ARGS = 3; - public static final int SLOT_INDEX_INITIAL_METHODS = 4; - public static final int SLOT_INDEX_METHODS = 5; - public static final int SLOT_INDEX_METHOD_CLASS = 6; - public static final int SLOT_INDEX_METHOD_COMBINATION = 7; - public static final int SLOT_INDEX_ARGUMENT_PRECEDENCE_ORDER = 8; - public static final int SLOT_INDEX_CLASSES_TO_EMF_TABLE = 9; - public static final int SLOT_INDEX_DOCUMENTATION = 10; - - public StandardGenericFunctionClass() - { - super(Symbol.STANDARD_GENERIC_FUNCTION, - list(StandardClass.GENERIC_FUNCTION)); - Package pkg = PACKAGE_SYS; - LispObject[] instanceSlotNames = - { - pkg.intern("NAME"), - pkg.intern("LAMBDA-LIST"), - pkg.intern("REQUIRED-ARGS"), - pkg.intern("OPTIONAL-ARGS"), - pkg.intern("INITIAL-METHODS"), - pkg.intern("METHODS"), - pkg.intern("METHOD-CLASS"), - pkg.intern("METHOD-COMBINATION"), - pkg.intern("ARGUMENT-PRECEDENCE-ORDER"), - pkg.intern("CLASSES-TO-EMF-TABLE"), - Symbol.DOCUMENTATION - }; - setClassLayout(new Layout(this, instanceSlotNames, NIL)); - setFinalized(true); + + public FuncallableStandardClass() + { + super(StandardClass.layoutFuncallableStandardClass); + } + + public FuncallableStandardClass(Symbol symbol, LispObject directSuperclasses) + { + super(StandardClass.layoutFuncallableStandardClass, + symbol, directSuperclasses); } @Override + public LispObject typeOf() + { + return Symbol.FUNCALLABLE_STANDARD_CLASS; + } + + @Override + public LispObject classOf() + { + return StandardClass.FUNCALLABLE_STANDARD_CLASS; + } + + @Override + public LispObject typep(LispObject type) + { + if (type == Symbol.FUNCALLABLE_STANDARD_CLASS) + return T; + if (type == StandardClass.FUNCALLABLE_STANDARD_CLASS) + return T; + return super.typep(type); + } + public LispObject allocateInstance() { - return new StandardGenericFunction(); + Layout layout = getClassLayout(); + if (layout == null) + { + Symbol.ERROR.execute(Symbol.SIMPLE_ERROR, + Keyword.FORMAT_CONTROL, + new SimpleString("No layout for class ~S."), + Keyword.FORMAT_ARGUMENTS, + list(this)); + } + return new FuncallableStandardObject(this, layout.getLength()); + } + + @Override + public String printObject() + { + StringBuilder sb = + new StringBuilder(Symbol.FUNCALLABLE_STANDARD_CLASS.printObject()); + if (getName() != null) + { + sb.append(' '); + sb.append(getName().printObject()); + } + return unreadableString(sb.toString()); } } Modified: trunk/abcl/src/org/armedbear/lisp/StandardClass.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/StandardClass.java Sat Feb 11 07:53:33 2012 (r13870) +++ trunk/abcl/src/org/armedbear/lisp/StandardClass.java Sat Feb 11 14:28:11 2012 (r13871) @@ -93,6 +93,31 @@ } }; + static Layout layoutFuncallableStandardClass = + new Layout(null, + list(symName, + symLayout, + symDirectSuperclasses, + symDirectSubclasses, + symPrecedenceList, + symDirectMethods, + symDirectSlots, + symSlots, + symDirectDefaultInitargs, + symDefaultInitargs, + symFinalizedP, + Symbol.DOCUMENTATION), + NIL) + { + @Override + public LispClass getLispClass() + { + return FUNCALLABLE_STANDARD_CLASS; + } + }; + + + public StandardClass() { super(layoutStandardClass); @@ -125,6 +150,38 @@ setFinalized(false); } + public StandardClass(Layout layout) + { + super(layout); + setDirectSuperclasses(NIL); + setDirectSubclasses(NIL); + setClassLayout(layout); + setCPL(NIL); + setDirectMethods(NIL); + setDocumentation(NIL); + setDirectSlotDefinitions(NIL); + setSlotDefinitions(NIL); + setDirectDefaultInitargs(NIL); + setDefaultInitargs(NIL); + setFinalized(false); + } + + public StandardClass(Layout layout, Symbol symbol, LispObject directSuperclasses) + { + super(layout, symbol, directSuperclasses); + setDirectSubclasses(NIL); + setClassLayout(layout); + setCPL(NIL); + setDirectMethods(NIL); + setDocumentation(NIL); + setDirectSlotDefinitions(NIL); + setSlotDefinitions(NIL); + setDirectDefaultInitargs(NIL); + setDefaultInitargs(NIL); + setFinalized(false); + + } + @Override public LispObject getName() { @@ -426,8 +483,11 @@ list(STANDARD_OBJECT, BuiltInClass.FUNCTION)); public static final StandardClass GENERIC_FUNCTION = - addStandardClass(Symbol.GENERIC_FUNCTION, - list(METAOBJECT, FUNCALLABLE_STANDARD_OBJECT)); + new FuncallableStandardClass(Symbol.GENERIC_FUNCTION, + list(METAOBJECT, FUNCALLABLE_STANDARD_OBJECT)); + static { + addClass(Symbol.GENERIC_FUNCTION, GENERIC_FUNCTION); + } public static final StandardClass METHOD_COMBINATION = addStandardClass(Symbol.METHOD_COMBINATION, list(METAOBJECT)); Modified: trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java Sat Feb 11 07:53:33 2012 (r13870) +++ trunk/abcl/src/org/armedbear/lisp/StandardGenericFunctionClass.java Sat Feb 11 14:28:11 2012 (r13871) @@ -35,7 +35,7 @@ import static org.armedbear.lisp.Lisp.*; -public final class StandardGenericFunctionClass extends StandardClass +public final class StandardGenericFunctionClass extends FuncallableStandardClass { public static final int SLOT_INDEX_NAME = 0; public static final int SLOT_INDEX_LAMBDA_LIST = 1; From rschlatte at common-lisp.net Sat Feb 11 22:35:41 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Sat, 11 Feb 2012 14:35:41 -0800 Subject: [armedbear-cvs] r13872 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Sat Feb 11 14:35:40 2012 New Revision: 13872 Log: Fix comment Modified: trunk/abcl/src/org/armedbear/lisp/FuncallableStandardClass.java Modified: trunk/abcl/src/org/armedbear/lisp/FuncallableStandardClass.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/FuncallableStandardClass.java Sat Feb 11 14:28:11 2012 (r13871) +++ trunk/abcl/src/org/armedbear/lisp/FuncallableStandardClass.java Sat Feb 11 14:35:40 2012 (r13872) @@ -1,7 +1,7 @@ /* - * StandardClass.java + * FuncallableStandardClass.java * - * Copyright (C) 2003-2005 Peter Graves + * Copyright (C) 2003-2005 Peter Graves, 2012 Rudolf Schlatte * $Id$ * * This program is free software; you can redistribute it and/or From mevenson at common-lisp.net Mon Feb 13 10:02:37 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 13 Feb 2012 02:02:37 -0800 Subject: [armedbear-cvs] r13873 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: mevenson Date: Mon Feb 13 02:02:35 2012 New Revision: 13873 Log: Restore autoload CL:MERGE as part of ANSI sort triage (See #196). This was mistakenly removed as part of Jorge Tavares' last commit. As an optimization, we attempt to invoke the original quicksort implementation if the new one fails while emitting a warning to the user. Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp Modified: trunk/abcl/src/org/armedbear/lisp/sort.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/sort.lisp Sat Feb 11 14:35:40 2012 (r13872) +++ trunk/abcl/src/org/armedbear/lisp/sort.lisp Mon Feb 13 02:02:35 2012 (r13873) @@ -304,7 +304,41 @@ ;; into one list. This may waste one outer iteration to realize. (if (eq list-1 (cdr head)) (return list-1)))))) +;;; +;;; MERGE +;;; +;;; From ECL. Should already be user-extensible as it does no type dispatch +;;; and uses only user-extensible functions. +(defun merge (result-type sequence1 sequence2 predicate + &key key + &aux (l1 (length sequence1)) (l2 (length sequence2))) + (unless key (setq key #'identity)) + (do ((newseq (make-sequence result-type (+ l1 l2))) + (j 0 (1+ j)) + (i1 0) + (i2 0)) + ((and (= i1 l1) (= i2 l2)) newseq) + (cond ((and (< i1 l1) (< i2 l2)) + (cond ((funcall predicate + (funcall key (elt sequence1 i1)) + (funcall key (elt sequence2 i2))) + (setf (elt newseq j) (elt sequence1 i1)) + (incf i1)) + ((funcall predicate + (funcall key (elt sequence2 i2)) + (funcall key (elt sequence1 i1))) + (setf (elt newseq j) (elt sequence2 i2)) + (incf i2)) + (t + (setf (elt newseq j) (elt sequence1 i1)) + (incf i1)))) + ((< i1 l1) + (setf (elt newseq j) (elt sequence1 i1)) + (incf i1)) + (t + (setf (elt newseq j) (elt sequence2 i2)) + (incf i2))))) ;;; ;;; SORT @@ -376,18 +410,46 @@ (,quicksort-call ,sequence ,mstart ,mend ,mpredicate ,mkey))))) (defun quicksort (sequence predicate key) - (let ((end (1- (length sequence)))) - (typecase sequence - (simple-vector - (if key - (quicksort-body simple-vector svref predicate key sequence 0 end) - (quicksort-body simple-vector svref predicate nil sequence 0 end))) - (vector - (if key - (quicksort-body vector aref predicate key sequence 0 end) - (quicksort-body vector aref predicate nil sequence 0 end)))) - sequence)) - + (handler-case + (let ((end (1- (length sequence)))) + (typecase sequence + (simple-vector + (if key + (quicksort-body simple-vector svref predicate key sequence 0 end) + (quicksort-body simple-vector svref predicate nil sequence 0 end))) + (vector + (if key + (quicksort-body vector aref predicate key sequence 0 end) + (quicksort-body vector aref predicate nil sequence 0 end)))) + sequence) + (t (e) + (warn "~&New quicksort implementation failed with~&'~A'.~&Trying stable implementation...~&" e) + (quick-sort sequence 0 (length sequence) predicate key)))) + +;;; DEPRECATED -- to be removed in abcl-1.4 +;;; From ECL. +;;; Alternative implementation for quick-sort SORT +(defun quick-sort (seq start end pred key) + (unless key (setq key #'identity)) + (if (<= end (1+ start)) + seq + (let* ((j start) (k end) (d (elt seq start)) (kd (funcall key d))) + (block outer-loop + (loop (loop (decf k) + (unless (< j k) (return-from outer-loop)) + (when (funcall pred (funcall key (elt seq k)) kd) + (return))) + (loop (incf j) + (unless (< j k) (return-from outer-loop)) + (unless (funcall pred (funcall key (elt seq j)) kd) + (return))) + (let ((temp (elt seq j))) + (setf (elt seq j) (elt seq k) + (elt seq k) temp)))) + (setf (elt seq start) (elt seq j) + (elt seq j) d) + (quick-sort seq start j pred key) + (quick-sort seq (1+ j) end pred key)))) ;;; ;;; main SORT and STABLE-SORT function calls From rschlatte at common-lisp.net Wed Feb 22 09:26:52 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Wed, 22 Feb 2012 01:26:52 -0800 Subject: [armedbear-cvs] r13874 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Wed Feb 22 01:26:50 2012 New Revision: 13874 Log: Fix class hierarchy of standard classes ... (class-direct-subclasses (car (class-direct-superclasses ...))) returned NIL for our MOP classes. Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/clos.lisp Mon Feb 13 02:02:35 2012 (r13873) +++ trunk/abcl/src/org/armedbear/lisp/clos.lisp Wed Feb 22 01:26:50 2012 (r13874) @@ -164,6 +164,44 @@ (define-class->%class-forwarder class-direct-default-initargs) (define-class->%class-forwarder (setf class-direct-default-initargs)) +(defun fixup-standard-class-hierarchy () + ;; Make the result of class-direct-subclasses for the pre-built + ;; classes agree with AMOP Table 5.1 (pg. 141). This could be done in + ;; StandardClass.java where these classes are defined, but here it's + ;; less painful + (flet ((add-subclasses (class subclasses) + (when (atom subclasses) (setf subclasses (list subclasses))) + (setf (class-direct-subclasses (find-class class)) + (union (class-direct-subclasses (find-class class)) + (mapcar #'find-class subclasses))))) + (add-subclasses t 'standard-object) + (add-subclasses 'function 'funcallable-standard-object) + (add-subclasses 'standard-object '(funcallable-standard-object metaobject)) + (add-subclasses 'metaobject + '(generic-function method method-combination + slot-definition specializer)) + (add-subclasses 'funcallable-standard-object 'generic-function) + (add-subclasses 'generic-function 'standard-generic-function) + (add-subclasses 'method 'standard-method) + (add-subclasses 'standard-method 'standard-accessor-method) + (add-subclasses 'standard-accessor-method + '(standard-reader-method standard-writer-method)) + (add-subclasses 'slot-definition + '(direct-slot-definition effective-slot-definition + standard-slot-definition)) + (add-subclasses 'standard-slot-definition + '(standard-direct-slot-definition + standard-effective-slot-definition)) + (add-subclasses 'direct-slot-definition 'standard-direct-slot-definition) + (add-subclasses 'effective-slot-definition + 'standard-effective-slot-definition) + (add-subclasses 'specializer '(eql-specializer class)) + (add-subclasses 'class + '(built-in-class forward-referenced-class standard-class + funcallable-standard-class)))) +(fixup-standard-class-hierarchy) + + (defun no-applicable-method (generic-function &rest args) (error "There is no applicable method for the generic function ~S when called with arguments ~S." generic-function From rschlatte at common-lisp.net Wed Feb 22 10:14:07 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Wed, 22 Feb 2012 02:14:07 -0800 Subject: [armedbear-cvs] r13875 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Wed Feb 22 02:14:06 2012 New Revision: 13875 Log: make slot subclasses work better ... abcl now passes the slot initialization tests of the MOP test suite. Modified: trunk/abcl/src/org/armedbear/lisp/SlotDefinitionClass.java Modified: trunk/abcl/src/org/armedbear/lisp/SlotDefinitionClass.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/SlotDefinitionClass.java Wed Feb 22 01:26:50 2012 (r13874) +++ trunk/abcl/src/org/armedbear/lisp/SlotDefinitionClass.java Wed Feb 22 02:14:06 2012 (r13875) @@ -71,6 +71,12 @@ for(int i = instanceSlotNames.length - 1; i >= 0; i--) { slotDefinitions = slotDefinitions.push(new SlotDefinition(this, instanceSlotNames[i])); } + // The Java class SlotDefinition sets the location slot to NIL + // in its constructor; here we make Lisp-side subclasses of + // standard-*-slot-definition do the same. + LispObject locationSlot = slotDefinitions.nthcdr(8).car(); + SlotDefinition.SET_SLOT_DEFINITION_INITFORM.execute(locationSlot, NIL); + SlotDefinition.SET_SLOT_DEFINITION_INITFUNCTION.execute(locationSlot, StandardClass.constantlyNil); setDirectSlotDefinitions(slotDefinitions); setSlotDefinitions(slotDefinitions); From rschlatte at common-lisp.net Thu Feb 23 10:33:07 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Thu, 23 Feb 2012 02:33:07 -0800 Subject: [armedbear-cvs] r13876 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Thu Feb 23 02:33:06 2012 New Revision: 13876 Log: Beginning support for non-standard method metaclasses ... canonicalize specializers in defmethod macroexpansion, instead of in the bowels of make-instance-standard-method. ... handle non-standard method metaclass in more places Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/clos.lisp Wed Feb 22 02:14:06 2012 (r13875) +++ trunk/abcl/src/org/armedbear/lisp/clos.lisp Thu Feb 23 02:33:06 2012 (r13876) @@ -1790,7 +1790,9 @@ (if (eq (generic-function-method-class gf) +the-standard-method-class+) (apply #'make-instance-standard-method gf all-keys) (apply #'make-instance (generic-function-method-class gf) all-keys)))) - (std-add-method gf method) + (if (eq (generic-function-method-class gf) +the-standard-method-class+) + (std-add-method gf method) + (add-method gf method)) method))) (defun make-instance-standard-method (gf @@ -2473,7 +2475,7 @@ (ensure-method ',function-name :lambda-list ',lambda-list :qualifiers ',qualifiers - :specializers ,specializers-form + :specializers (canonicalize-specializers ,specializers-form) ,@(if documentation `(:documentation ,documentation)) :function (function ,method-function) ,@(if fast-function `(:fast-function (function ,fast-function))) From rschlatte at common-lisp.net Fri Feb 24 04:20:53 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Thu, 23 Feb 2012 20:20:53 -0800 Subject: [armedbear-cvs] r13877 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Thu Feb 23 20:20:52 2012 New Revision: 13877 Log: Implement the dependent maintenance protocol (AMOP Sec. 5.5.6) Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp trunk/abcl/src/org/armedbear/lisp/mop.lisp Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/clos.lisp Thu Feb 23 02:33:06 2012 (r13876) +++ trunk/abcl/src/org/armedbear/lisp/clos.lisp Thu Feb 23 20:20:52 2012 (r13877) @@ -210,7 +210,11 @@ (defun function-keywords (method) (std-function-keywords method)) - +(declaim (notinline map-dependents)) +(defun map-dependents (metaobject function) + ;; stub, will be redefined later + (declare (ignore metaobject function)) + nil) (defmacro push-on-end (value location) `(setf ,location (nconc ,location (list ,value)))) @@ -1423,7 +1427,12 @@ ;; specified by CLHS, 7.7 (Macro DEFGENERIC). (dolist (method (generic-function-initial-methods gf)) (if (typep gf 'standard-generic-function) - (std-remove-method gf method) + (progn + (std-remove-method gf method) + (map-dependents gf + #'(lambda (dep) + (update-dependent gf dep + 'remove-method method)))) (remove-method gf method))) (setf (generic-function-initial-methods gf) '())))) (apply 'ensure-generic-function function-name all-keys)) @@ -1791,7 +1800,11 @@ (apply #'make-instance-standard-method gf all-keys) (apply #'make-instance (generic-function-method-class gf) all-keys)))) (if (eq (generic-function-method-class gf) +the-standard-method-class+) - (std-add-method gf method) + (progn + (std-add-method gf method) + (map-dependents gf + #'(lambda (dep) + (update-dependent gf dep 'add-method method)))) (add-method gf method)) method))) @@ -2546,7 +2559,11 @@ :generic-function nil ; handled by add-method initargs)))) (if (eq (class-of gf) +the-standard-generic-function-class+) - (std-add-method gf method) + (progn + (std-add-method gf method) + (map-dependents gf + #'(lambda (dep) + (update-dependent gf dep 'add-method method)))) (add-method gf method)) method))) @@ -2591,7 +2608,11 @@ :generic-function nil ; handled by add-method initargs)))) (if (eq (class-of gf) +the-standard-generic-function-class+) - (std-add-method gf method) + (progn + (std-add-method gf method) + (map-dependents gf + #'(lambda (dep) + (update-dependent gf dep 'add-method method)))) (add-method gf method)) method))) @@ -3390,7 +3411,26 @@ (list* class all-keys) class t all-keys nil 'reinitialize-instance) - (apply #'std-after-initialization-for-classes class all-keys)) + (apply #'std-after-initialization-for-classes class all-keys) + (map-dependents class #'(lambda (dep) (update-dependent class dep all-keys)))) + +(defmethod reinitialize-instance :after ((class funcallable-standard-class) + &rest all-keys) + (remhash class *make-instance-initargs-cache*) + (remhash class *reinitialize-instance-initargs-cache*) + (%make-instances-obsolete class) + (setf (class-finalized-p class) nil) + (check-initargs (list #'allocate-instance + #'initialize-instance) + (list* class all-keys) + class t all-keys + nil 'reinitialize-instance) + (apply #'std-after-initialization-for-classes class all-keys) + (map-dependents class #'(lambda (dep) (update-dependent class dep all-keys)))) + +(defmethod reinitialize-instance :after ((gf standard-generic-function) + &rest all-keys) + (map-dependents gf #'(lambda (dep) (update-dependent gf dep all-keys)))) ;;; Finalize inheritance @@ -3686,11 +3726,24 @@ method-lambda-list gf-lambda-list)) (std-add-method generic-function method)) +(defmethod add-method :after ((generic-function standard-generic-function) + (method method)) + (map-dependents generic-function + #'(lambda (dep) (update-dependent generic-function dep + 'add-method method)))) + (defgeneric remove-method (generic-function method)) -(defmethod remove-method ((generic-function standard-generic-function) method) +(defmethod remove-method ((generic-function standard-generic-function) + (method method)) (std-remove-method generic-function method)) +(defmethod remove-method :after ((generic-function standard-generic-function) + (method method)) + (map-dependents generic-function + #'(lambda (dep) (update-dependent generic-function dep + 'remove-method method)))) + ;; See describe.lisp. (defgeneric describe-object (object stream)) @@ -3819,6 +3872,47 @@ (setf (slot-value specializer 'direct-methods) (remove method (slot-value specializer 'direct-methods))))) +;;; The Dependent Maintenance Protocol (AMOP pg. 160ff.) + +(defvar *dependents* (make-hash-table :test 'eq :weakness :key)) + +;;; AMOP pg. 164 +(defgeneric add-dependent (metaobject dependent)) +(defmethod add-dependent ((metaobject standard-class) dependent) + (pushnew dependent (gethash metaobject *dependents* nil))) +(defmethod add-dependent ((metaobject funcallable-standard-class) dependent) + (pushnew dependent (gethash metaobject *dependents* nil))) +(defmethod add-dependent ((metaobject standard-generic-function) dependent) + (pushnew dependent (gethash metaobject *dependents* nil))) + +;;; AMOP pg. 225 +(defgeneric remove-dependent (metaobject dependent)) +(defmethod remove-dependent ((metaobject standard-class) dependent) + (setf (gethash metaobject *dependents*) + (delete dependent (gethash metaobject *dependents* nil) :test #'eq))) +(defmethod remove-dependent ((metaobject funcallable-standard-class) dependent) + (setf (gethash metaobject *dependents*) + (delete dependent (gethash metaobject *dependents* nil) :test #'eq))) +(defmethod remove-dependent ((metaobject standard-generic-function) dependent) + (setf (gethash metaobject *dependents*) + (delete dependent (gethash metaobject *dependents* nil) :test #'eq))) + +;;; AMOP pg. 210 +(atomic-defgeneric map-dependents (metaobject function) + (:method ((metaobject standard-class) function) + (dolist (dependent (gethash metaobject *dependents* nil)) + (funcall function dependent))) + (:method ((metaobject funcallable-standard-class) function) + (dolist (dependent (gethash metaobject *dependents* nil)) + (funcall function dependent))) + (:method ((metaobject standard-generic-function) function) + (dolist (dependent (gethash metaobject *dependents* nil)) + (funcall function dependent)))) + +;;; AMOP pg. 239 +(defgeneric update-dependent (metaobject dependent &rest initargs)) + + ;;; SLIME compatibility functions. (defun %method-generic-function (method) Modified: trunk/abcl/src/org/armedbear/lisp/mop.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/mop.lisp Thu Feb 23 02:33:06 2012 (r13876) +++ trunk/abcl/src/org/armedbear/lisp/mop.lisp Thu Feb 23 20:20:52 2012 (r13877) @@ -82,7 +82,11 @@ extract-lambda-list extract-specializer-names - )) + + add-dependent + remove-dependent + map-dependents + update-dependent)) (provide 'mop) From rschlatte at common-lisp.net Fri Feb 24 10:16:21 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Fri, 24 Feb 2012 02:16:21 -0800 Subject: [armedbear-cvs] r13878 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Fri Feb 24 02:16:20 2012 New Revision: 13878 Log: export mop:slot-definition-location Modified: trunk/abcl/src/org/armedbear/lisp/mop.lisp Modified: trunk/abcl/src/org/armedbear/lisp/mop.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/mop.lisp Thu Feb 23 20:20:52 2012 (r13877) +++ trunk/abcl/src/org/armedbear/lisp/mop.lisp Fri Feb 24 02:16:20 2012 (r13878) @@ -72,6 +72,7 @@ slot-definition slot-definition-readers slot-definition-writers + slot-definition-location intern-eql-specializer eql-specializer-object From rschlatte at common-lisp.net Fri Feb 24 11:13:49 2012 From: rschlatte at common-lisp.net (rschlatte at common-lisp.net) Date: Fri, 24 Feb 2012 03:13:49 -0800 Subject: [armedbear-cvs] r13879 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: rschlatte Date: Fri Feb 24 03:13:48 2012 New Revision: 13879 Log: Export standard-instance-access from package MOP. Modified: trunk/abcl/src/org/armedbear/lisp/mop.lisp Modified: trunk/abcl/src/org/armedbear/lisp/mop.lisp ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/mop.lisp Fri Feb 24 02:16:20 2012 (r13878) +++ trunk/abcl/src/org/armedbear/lisp/mop.lisp Fri Feb 24 03:13:48 2012 (r13879) @@ -73,6 +73,7 @@ slot-definition-readers slot-definition-writers slot-definition-location + standard-instance-access intern-eql-specializer eql-specializer-object From mevenson at common-lisp.net Fri Feb 24 16:14:26 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Fri, 24 Feb 2012 08:14:26 -0800 Subject: [armedbear-cvs] r13880 - trunk/abcl/contrib/mvn Message-ID: Author: mevenson Date: Fri Feb 24 08:14:25 2012 New Revision: 13880 Log: Add a symbol understood by CL:REQUIRE which allows CFFI to load. Use CL-USER> (require 'jna) to include the necessary JVM binary artifact (currently "jna.jar" version 3.0.9) in the currently running JVM process. Added: trunk/abcl/contrib/mvn/ trunk/abcl/contrib/mvn/jna.asd Added: trunk/abcl/contrib/mvn/jna.asd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/abcl/contrib/mvn/jna.asd Fri Feb 24 08:14:25 2012 (r13880) @@ -0,0 +1,6 @@ +;;;; -*- Mode: LISP -*- + +;;;; Need to have jna.jar present for CFFI to have a chance of working. +;;; XXX jna-3.4.0 seems much more capable, but doesn't have a resolvable pom.xml from Maven central +(require :asdf) +(asdf:defsystem :jna :components ((:mvn "com.sun.jna/jna/3.0.9"))) From mevenson at common-lisp.net Mon Feb 27 20:39:11 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 27 Feb 2012 12:39:11 -0800 Subject: [armedbear-cvs] r13881 - trunk/abcl/contrib/mvn Message-ID: Author: mevenson Date: Mon Feb 27 12:39:10 2012 New Revision: 13881 Log: jna.asd: load jna.jar version 3.0.9 under more conditions. Modified: trunk/abcl/contrib/mvn/jna.asd Modified: trunk/abcl/contrib/mvn/jna.asd ============================================================================== --- trunk/abcl/contrib/mvn/jna.asd Fri Feb 24 08:14:25 2012 (r13880) +++ trunk/abcl/contrib/mvn/jna.asd Mon Feb 27 12:39:10 2012 (r13881) @@ -3,4 +3,7 @@ ;;;; Need to have jna.jar present for CFFI to have a chance of working. ;;; XXX jna-3.4.0 seems much more capable, but doesn't have a resolvable pom.xml from Maven central (require :asdf) -(asdf:defsystem :jna :components ((:mvn "com.sun.jna/jna/3.0.9"))) +(asdf:defsystem :jna + :version "3.0.9" + :defsystem-depends-on (abcl-asdf) + :components ((:mvn "com.sun.jna/jna/3.0.9"))) From mevenson at common-lisp.net Mon Feb 27 20:39:13 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Mon, 27 Feb 2012 12:39:13 -0800 Subject: [armedbear-cvs] r13882 - trunk/abcl/doc/manual Message-ID: Author: mevenson Date: Mon Feb 27 12:39:12 2012 New Revision: 13882 Log: manual: description of ABCL-CONTRIB symbols and their meaning. Modified: trunk/abcl/doc/manual/abcl.tex Modified: trunk/abcl/doc/manual/abcl.tex ============================================================================== --- trunk/abcl/doc/manual/abcl.tex Mon Feb 27 12:39:10 2012 (r13881) +++ trunk/abcl/doc/manual/abcl.tex Mon Feb 27 12:39:12 2012 (r13882) @@ -1013,6 +1013,19 @@ \item{\code{ABCL-CONTRIB}} Locates and pushes the toplevel contents of ``abcl-contrib.jar'' into the \textsc{ASDF} central registry. + \begin{enumerate} + \item \code{abcl-asdf} + Functions for loading JVM artifacts dynamically, hooking into ASDF 2 objects where possible. + \item \code{asdf-jar} Package addressable JVM artifacts via + \code{abcl-asdf} descriptions as a single binary artifact + including recursive dependencies. + \item \code{mvn} + These systems name common JVM artifacts from the distributed pom.xml graph of Maven Aether: + \begin{enumerate} + \item \code{jna} Dynamically load 'jna.jar' version 3.0.9 from the network. + + \end{enumeration} + \end{description} The user may extend the \code{CL:REQUIRE} mechanism by pushing From mevenson at common-lisp.net Wed Feb 29 09:40:47 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 29 Feb 2012 01:40:47 -0800 Subject: [armedbear-cvs] r13883 - trunk/abcl/contrib/mvn Message-ID: Author: mevenson Date: Wed Feb 29 01:40:46 2012 New Revision: 13883 Log: Kludgey fix for jna.asd. The ABCL-ASDF system needs to be loaded for the use of the ASDF:MVN component type in the jna.asd. Trying to explictly require this symbol results in seemingly bogus errors from ENSURE-DIRECTORIES-EXIST. For now, just ensure that ABCL-ASDF has been loaded before attempting to load JNA (which seems to work fine.) Modified: trunk/abcl/contrib/mvn/jna.asd Modified: trunk/abcl/contrib/mvn/jna.asd ============================================================================== --- trunk/abcl/contrib/mvn/jna.asd Mon Feb 27 12:39:12 2012 (r13882) +++ trunk/abcl/contrib/mvn/jna.asd Wed Feb 29 01:40:46 2012 (r13883) @@ -5,5 +5,5 @@ (require :asdf) (asdf:defsystem :jna :version "3.0.9" - :defsystem-depends-on (abcl-asdf) +;; :defsystem-depends-on (abcl-asdf) ;;; XXX not working in the bowels of ASDF :components ((:mvn "com.sun.jna/jna/3.0.9"))) From mevenson at common-lisp.net Wed Feb 29 09:40:50 2012 From: mevenson at common-lisp.net (mevenson at common-lisp.net) Date: Wed, 29 Feb 2012 01:40:50 -0800 Subject: [armedbear-cvs] r13884 - trunk/abcl/test/lisp/abcl Message-ID: Author: mevenson Date: Wed Feb 29 01:40:48 2012 New Revision: 13884 Log: See #199: factored test for failing case. Modified: trunk/abcl/test/lisp/abcl/mop-tests.lisp Modified: trunk/abcl/test/lisp/abcl/mop-tests.lisp ============================================================================== --- trunk/abcl/test/lisp/abcl/mop-tests.lisp Wed Feb 29 01:40:46 2012 (r13883) +++ trunk/abcl/test/lisp/abcl/mop-tests.lisp Wed Feb 29 01:40:48 2012 (r13884) @@ -597,3 +597,12 @@ t) +(defgeneric apply-rule (rule)) +(defmethod apply-rule ((rule t) &aux (context (format nil "~A" rule))) + (format nil "Applying rule '~A' in context '~A'" rule context)) + +;;; See ticket # 199 +(deftest defmethod-&aux.1 + (apply-rule "1") + "Applying rule '1' in context '1'") + \ No newline at end of file From ehuelsmann at common-lisp.net Wed Feb 29 22:35:44 2012 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Wed, 29 Feb 2012 14:35:44 -0800 Subject: [armedbear-cvs] r13885 - trunk/abcl/src/org/armedbear/lisp Message-ID: Author: ehuelsmann Date: Wed Feb 29 14:35:41 2012 New Revision: 13885 Log: Report the actual parameters passed in a function call with mismatched parameter counts. Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java trunk/abcl/src/org/armedbear/lisp/Lisp.java trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java Modified: trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Wed Feb 29 01:40:48 2012 (r13884) +++ trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java Wed Feb 29 14:35:41 2012 (r13885) @@ -609,7 +609,7 @@ { // Fixed arity. if (args.length != arity) - error(new WrongNumberOfArgumentsException(function, arity)); + error(new WrongNumberOfArgumentsException(function, list(args), arity)); return args; } // Not fixed arity. @@ -639,7 +639,7 @@ { // Fixed arity. if (argsLength != arity) - error(new WrongNumberOfArgumentsException(function, arity)); + error(new WrongNumberOfArgumentsException(function, list(args), arity)); return args; } // Not fixed arity. Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/Lisp.java Wed Feb 29 01:40:48 2012 (r13884) +++ trunk/abcl/src/org/armedbear/lisp/Lisp.java Wed Feb 29 14:35:41 2012 (r13885) @@ -882,6 +882,13 @@ env.bind(sym, value); } + public static LispObject list(LispObject[] obj) { + LispObject theList = NIL; + if (obj.length > 0) + for (int i = obj.length - 1; i >= 0; i--) + theList = new Cons(obj[i], theList); + return theList; + } public static final Cons list(LispObject obj1, LispObject... remaining) { Modified: trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java ============================================================================== --- trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java Wed Feb 29 01:40:48 2012 (r13884) +++ trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java Wed Feb 29 14:35:41 2012 (r13885) @@ -40,28 +40,40 @@ private Operator operator; private int expectedMinArgs; private int expectedMaxArgs; + private LispObject actualArgs; private String message; public WrongNumberOfArgumentsException(Operator operator) { this(operator, -1); } - public WrongNumberOfArgumentsException(Operator operator, int expectedMin, - int expectedMax) { + public WrongNumberOfArgumentsException(Operator operator, LispObject args, + int expectedMin, int expectedMax) { // This is really just an ordinary PROGRAM-ERROR, broken out into its // own Java class as a convenience for the implementation. super(StandardClass.PROGRAM_ERROR); this.operator = operator; this.expectedMinArgs = expectedMin; this.expectedMaxArgs = expectedMax; + this.actualArgs = args; setFormatControl(getMessage()); setFormatArguments(NIL); } - + + public WrongNumberOfArgumentsException(Operator operator, + int expectedMin, int expectedMax) { + this(operator, null, expectedMin, expectedMax); + } + public WrongNumberOfArgumentsException(Operator operator, int expectedArgs) { this(operator, expectedArgs, expectedArgs); } + public WrongNumberOfArgumentsException(Operator operator, LispObject args, + int expectedArgs) { + this(operator, args, expectedArgs, expectedArgs); + } + public WrongNumberOfArgumentsException(String message) { super(StandardClass.PROGRAM_ERROR); if(message == null) { @@ -99,6 +111,10 @@ sb.append(" expected"); } + if (actualArgs != null) { + sb.append(" -- provided: "); + sb.append(actualArgs.princToString()); + } sb.append('.'); return message = sb.toString(); }