Changeset 14292 for branches/1.1.x/doc/manual/abcl.tex
- Timestamp:
- 12/04/12 21:06:12 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1.x/doc/manual/abcl.tex
r14288 r14292 30 30 runs on the Java Virtual Machine. It compiles Common Lisp to Java 5 31 31 bytecode, providing the following integration methods for interfacing 32 with Java code and libraries s:32 with Java code and libraries: 33 33 \begin{itemize} 34 34 \item Lisp code can create Java objects and call their methods (see … … 67 67 result of a merge won't fill in a DEVICE with the wrong "default 68 68 device for the host" in the sense of the fourth paragraph in the 69 [CLHS description of MERGE-PATHNAMES][2] (the paragraph beginning69 CLHS description of MERGE-PATHNAMES (see in \cite{CLHS} the paragraph beginning 70 70 "If the PATHNAME explicitly specifies a host and not a deviceâŠ"). 71 71 A future version of the implementation may return to conformance … … 137 137 using a versioned package on the local filesystem from your system 138 138 vendor. This jar file can be executed from the command line to obtain a 139 REPL\footnote{Read-Eval Print Loop, a Lisp command line}, viz:139 REPL\footnote{Read-Eval Print Loop, a Lisp command-line}, viz: 140 140 141 141 \begin{listing-shell} … … 173 173 \item[\texttt{ --load-system-file FILE}] loads the system file FILE before initializing the REPL. 174 174 \item[\texttt{ --batch}] evaluates forms specified by arguments and in 175 the in tialization file \verb+~/.abclrc+, and then exits without175 the initialization file \verb+~/.abclrc+, and then exits without 176 176 starting a REPL. 177 177 \end{description} … … 214 214 objects, and construction of new Java objects. 215 215 216 When calling Java routines, some values will automatically be converted 217 by the FFI\footnote{Foreign Function Interface, the term for the part of 218 a Lisp implementation that implements calling code written in other 219 languages.} from Lisp values to Java values. These conversions 220 typically apply to strings, integers and floats. Other values need to be 221 converted to their Java equivalents by the programmer before calling the 222 Java object method. Java values returned to Lisp are also generally 223 converted back to their Lisp counterparts. Some operators make an 224 exception to this rule and do not perform any conversion; those are the 225 ``raw'' counterparts of certain FFI functions and are recognizable by 226 their name ending with \code{-RAW}. 216 When calling Java routines, some values will automatically be 217 converted by the FFI\footnote{Foreign Function Interface, is the term 218 of art for the part of a Lisp implementation which implements 219 calling code written in other languages, typically normalized to the 220 local C compiler calling conventions.} from Lisp values to Java 221 values. These conversions typically apply to strings, integers and 222 floats. Other values need to be converted to their Java equivalents by 223 the programmer before calling the Java object method. Java values 224 returned to Lisp are also generally converted back to their Lisp 225 counterparts. Some operators make an exception to this rule and do not 226 perform any conversion; those are the ``raw'' counterparts of certain 227 FFI functions and are recognizable by their name ending with 228 \code{-RAW}. 227 229 228 230 \subsection{Low-level Java API} … … 739 741 be passed to the \code{jmake-proxy} generic function. 740 742 743 \subsection{Implementation of Java classes in Lisp} 744 745 See \code{JAVA:JNEW-RUNTIME-CLASS} on \ref{JAVA:JNEW-RUNTIME-CLASS}. 746 747 741 748 \chapter{Implementation Dependent Extensions} 742 749 … … 761 768 (the value of the special variable \code{JAVA:*CLASSLOADER*}. It has 762 769 no effect on Java code outside ABCL. 770 771 \subsection{Creating a synthetic Java Class at Runtime} 772 773 See \code{JAVA:JNEW-RUNTIME-CLASS} on \ref{JAVA:JNEW-RUNTIME-CLASS}. 763 774 764 775 % include autogen docs for the JAVA package. … … 805 816 \section{Pathname} 806 817 807 We implement an extension to the Pathname that allows for the808 description and retrieval of resources named in a818 We implement an extension to the \code{CL:PATHNAME} that allows for 819 the description and retrieval of resources named in a 809 820 \textsc{URI} \footnote{A \textsc{URI} is essentially a superset of 810 what is commonly understood as a \textsc{URL} We sometime suse the821 what is commonly understood as a \textsc{URL} We sometime suse the 811 822 term URL as shorthand in describing the URL Pathnames, even though 812 823 the corresponding encoding is more akin to a URI as described in 813 824 RFC3986 \cite{rfc3986}.} scheme that the \textsc{JVM} 814 ``understands''. Support is built-in to comprehend the ``http'' and 815 ``https'' implementations but additional protocol handlers may be 816 installed at runtime by having \textsc{JVM} symbols present in the 817 sun.net.protocol.dynamic pacakge. See \cite{maso2000} for more 818 details. 819 820 \textsc{ABCL} has created specializations of the ANSI Pathname object to 821 enable to use of \textsc{URI}s to address dynamically loaded resources for the 822 JVM. A \code{URL-PATHNAME} has a corresponding \textsc{URI} whose canonical 823 representation is defined to be the \code{NAMESTRING} of the Pathname. 824 825 % 825 ``understands''. By definition, support is built-in into the JVM to 826 access the ``http'' and ``https'' schemes but additional protocol 827 handlers may be installed at runtime by having \textsc{JVM} symbols 828 present in the sun.net.protocol.dynamic pacakge. See \cite{maso2000} 829 for more details. 830 831 \textsc{ABCL} has created specializations of the ANSI 832 \code{CL:PATHNAME} object to enable to use of \textsc{URI}s to address 833 dynamically loaded resources for the JVM. The \code{EXT:URL-PATHNAME} 834 specialization. has a corresponding \textsc{URI} whose canonical 835 representation is defined to be the \code{NAMESTRING} of the 836 Pathname. The \code{EXT:JAR-PATHNAME} extension further specializes 837 the the \code{EXT:URL-PATHNAME} to provide access to components of zip 838 archives. 839 840 % RDF description of type hierarchy 841 % TODO Render via some LaTeX mode for graphviz? 826 842 \begin{verbatim} 827 828 # RDF description of type hierarchy 829 % TODO Render via some LaTeX mode for graphviz? 830 831 <jar-pathname> a <url-pathname>. 832 <url-pathname> a <cl:pathname>. 843 @prefix ext: <http://abcl.not.org/cl-packages/extensions/> . 844 @prefix cl: <http://abcl.not.org/cl-pacages/common-lisp/> . 845 846 <ext:jar-pathname> a <ext:url-pathname>. 847 <ext:url-pathname> a <cl:pathname>. 833 848 <cl:logical-pathname> a <cl:pathname> . 834 849 \end{verbatim} … … 840 855 \index{JAR-PATHNAME} 841 856 842 Both \code{EXT:URL-PATHNAME} and \code{EXT:JAR-PATHNAME} may be used anywhere 843 a \code{CL:PATHNAME} is accepted with the following caveats: 857 Both the \code{EXT:URL-PATHNAME} and \code{EXT:JAR-PATHNAME} objects 858 may be used anywhere a \code{CL:PATHNAME} is accepted with the 859 following caveats: 844 860 845 861 \begin{itemize} … … 849 865 850 866 \index{URI} 851 \item No canonicalization is performed on the underlying \textsc{URI} 852 (i.e. the implementation does not attempt to compute the current 853 name of the representing resource unless it is requested to be 867 \item Any results of canonicalization procesures performed on the 868 underlying \textsc{URI} are discarded between resolutions (i.e. the 869 implementation does not attempt to cache the results of current name 870 resolution of the representing resource unless it is requested to be 854 871 resolved.) Upon resolution, any cannoicalization procedures 855 872 followed in resolving the resource (e.g. following redirects) are … … 859 876 properties of your local \textsc{REST} infrastructure, these results 860 877 may not necessarily be idempotent over time\footnote {See 861 \cite{evenson2011} for the draft of the publication of the technical862 details}.878 \cite{evenson2011} for the draft of the publication of the 879 technical details}. 863 880 864 881 \end{itemize} … … 875 892 will load and execute the Quicklisp setup code. 876 893 877 The implementation currently breaks ANSIconformance by allowing the878 types able to be READ for the DEVICE to return a possible CONSof879 PATHNAMEobjects. %% citation from CLHS needed.880 881 In order to ``smooth over'' the bit about types being READfrom882 PATHNAMEcomponents, we extend the semantics for the usual PATHNAME883 merge semantics when *DEFAULT-PATHNAME-DEFAULTS*contains a884 \code{ JAR-PATHNAME}.894 The implementation currently breaks \textsc{ANSI} conformance by allowing the 895 types able to be READ for the DEVICE to return a possible \code{CONS} of 896 \code{CL:PATHNAME} objects. %% citation from CLHS needed. 897 898 In order to ``smooth over'' the bit about types being \code{CL:READ} from 899 \code{CL:PATHNAME} components, we extend the semantics for the usual PATHNAME 900 merge semantics when \code{*DEFAULT-PATHNAME-DEFAULTS*} contains a 901 \code{EXT:JAR-PATHNAME}. 885 902 886 903 %See \ref{_:quicklisp} on page \pageref{_:quicklisp}. … … 889 906 890 907 The implementation of these extensions stores all the additional 891 information in the PATHNAMEobject itself in ways that while strictly908 information in the \code{CL:PATHNAME} object itself in ways that while strictly 892 909 speaking are conformant, nonetheless may trip up libraries that don't 893 910 expect the following: … … 895 912 \begin{itemize} 896 913 \item \code{DEVICE} can be either a string denoting a drive letter 897 under DOS or a list of exactly one or two elements. If 898 \code{DEVICE} is a list, it denotes a \code{JAR-PATHNAME}, with the entries 899 containing \code{PATHNAME} objects which describe the outer and (possibley) 900 locations of the jar archive. 901 902 \item A \code{URL-PATHNAME} always has a \code{HOST} component that is a 914 under \textsc{DOS} or a list of exactly one or two elements. If 915 \code{DEVICE} is a list, it denotes a \code{EXT:JAR-PATHNAME}, with 916 the entries containing \code{CL:PATHNAME} objects which describe the 917 outer and (possibly inner) locations of the jar 918 archive \footnote{The case of inner and outer 919 \code{EXT:EJAR-PATHNAME} arises when zip archives themselves 920 contain zip archives which is the case when the ABCL fasl is 921 included in the abcl.jar zip archive.}. 922 923 \item A \code{EXT:URL-PATHNAME} always has a \code{HOST} component that is a 903 924 property list. The values of the \code{HOST} property list are 904 925 always character strings. The allowed keys have the following meanings: … … 911 932 \end{description} 912 933 913 914 934 \item In order to encapsulate the implementation decisions for these 915 935 meanings, the following functions provide a setf-able API for … … 947 967 abstractions on the standard Java collection classes as defined by the 948 968 \code{java.util.List} contract. 969 970 %% an Example of using java.util.Lisp in Lisp would be nice 949 971 950 972 This extension is not automatically loaded by the implementation. It … … 1120 1142 1121 1143 1122 The following \textsc{ASDF} components are added: \code{JAR-FILE}, 1123 \code{JAR- DIRECTORY}, \code{CLASS-FILE-DIRECTORY} and \code{MVN}.1124 1144 When loaded, abcl-asdf adds the following objects to \textsc{ASDF}: 1145 \code{JAR-FILE}, \code{JAR-DIRECTORY}, \code{CLASS-FILE-DIRECTORY} and 1146 \code{MVN}, exporting them (and others) as public symbols. 1125 1147 1126 1148 \subsection{Referencing Maven Artifacts via ASDF} … … 1201 1223 To one used to the more universal syntax of Lisp pairs upon which the 1202 1224 definition of read and compile time macros is quite 1203 natural \footnote{See Graham's ``On Lisp'' http://lib.store.yahoo.net/lib/paulgraham/onlisp.pdf.}, the Java syntax available to 1204 the Java programmer may be said to suck. To alleviate this situation, 1205 the JSS contrib introduces the \code{SHARPSIGN-DOUBLE-QUOTE} 1206 (\code{\#"}) reader macro, which allows the the specification of the 1207 name of invoking function as the first element of the relevant s-expr 1208 which tends to be more congruent to how Lisp programmers seem to be 1209 wired to think. 1225 natural \footnote{See Graham's ``On Lisp'' 1226 http://lib.store.yahoo.net/lib/paulgraham/onlisp.pdf.}, the Java 1227 syntax available to the Java programmer may be said to suck. To 1228 alleviate this situation, the JSS contrib introduces the 1229 \code{SHARPSIGN-DOUBLE-QUOTE} (\code{\#"}) reader macro, which allows 1230 the the specification of the name of invoking function as the first 1231 element of the relevant s-expr which tends to be more congruent to how 1232 Lisp programmers seem to be wired to think. 1210 1233 1211 1234 While quite useful, we don't expect that the JSS contrib will be the … … 1230 1253 \url{http://svn.common-lisp.net/armedbear/trunk/abcl/contrib/jss/README.markdown} 1231 1254 1255 \section{jfli} 1256 \label{section:jfli} 1257 1258 The contrib contains a pure-Java version of JFLI. 1259 1232 1260 \section{asdf-install} 1233 1261 … … 1263 1291 on January 10, 2012. 1264 1292 1265 In December 2012, we werevised the implementation by adding (A)MOP1266 with the release of abcl-1.1.0 1293 In December 2012, we revised the implementation by adding (A)MOP 1294 with the release of abcl-1.1.0. 1267 1295 1268 1296 \appendix
Note: See TracChangeset
for help on using the changeset viewer.