Changeset 12560
- Timestamp:
- 03/18/10 10:15:53 (13 years ago)
- Location:
- trunk/abcl/doc
- Files:
-
- 2 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/doc/design/pathnames/jar-pathnames.markdown
r12542 r12560 2 2 ============================ 3 3 4 Mark Evenson5 Created: 09 JAN 20106 Modified: 16 MAR 20104 Mark Evenson 5 Created: 09 JAN 2010 6 Modified: 16 MAR 2010 7 7 8 8 Notes towards sketching an implementation of "jar:" references to be 9 contained in PATHNAMEswithin ABCL.9 contained in Common Lisp `PATHNAMEs` within ABCL. 10 10 11 11 Goals 12 12 ----- 13 13 14 1. Use Common Lisp pathnames to refer to entries in a JARfile.14 1. Use Common Lisp pathnames to refer to entries in a jar file. 15 15 16 16 17 2. Use 'jar:' schema as documented in java.net.JarURLConnectionfor17 2. Use `'jar:'` schema as documented in [`java.net.JarURLConnection`][jarURLConnection] for 18 18 namestring representation. 19 19 20 An entry in a JAR file: 21 #p"jar:file:baz.jar!/foo" 20 An entry in a JAR file: 21 22 #p"jar:file:baz.jar!/foo" 22 23 23 A JAR file: 24 #p"jar:file:baz.jar!/" 25 26 A JAR file accessible via URL 27 #p"jar:http://example.org/abcl.jar!/" 28 29 An entry in a ABCL FASL in a URL accessible JAR file 30 #p"jar:jar:http://example.org/abcl.jar!/foo.abcl!/foo-1.cls" 31 32 3. MERGE-PATHNAMES working for JAR entries in the following use cases: 33 34 (merge-pathnames "foo-1.cls" "jar:jar:file:baz.jar!/foo.abcl!/foo._") 35 "jar:jar:file:baz.jar!/foo.abcl!/foo-1.cls" 36 37 (merge-pathnames "foo-1.cls" "jar:file:foo.abcl!/") 38 "jar:file:foo.abcl!/foo-1.cls" 39 40 4. TRUENAME and PROBE-FILE working with "jar:" 41 42 4.1 TRUENAME cannonicalizing the JAR reference. 24 A JAR file: 25 26 #p"jar:file:baz.jar!/" 27 28 A JAR file accessible via URL 29 30 #p"jar:http://example.org/abcl.jar!/" 31 32 An entry in a ABCL FASL in a URL accessible JAR file 33 34 #p"jar:jar:http://example.org/abcl.jar!/foo.abcl!/foo-1.cls" 35 36 [jarUrlConnection]: http://java.sun.com/javase/6/docs/api/java/net/JarURLConnection.html 37 38 3. `MERGE-PATHNAMES` working for jar entries in the following use cases: 39 40 (merge-pathnames "foo-1.cls" "jar:jar:file:baz.jar!/foo.abcl!/foo._") 41 ==> "jar:jar:file:baz.jar!/foo.abcl!/foo-1.cls" 42 43 (merge-pathnames "foo-1.cls" "jar:file:foo.abcl!/") 44 ==> "jar:file:foo.abcl!/foo-1.cls" 45 46 4. TRUENAME and PROBE-FILE working with "jar:" with TRUENAME 47 cannonicalizing the JAR reference. 43 48 44 49 5. DIRECTORY working within JAR files (and within JAR in JAR). … … 101 106 An incomplete BNF of the syntax of JAR PATHNAME would be: 102 107 103 JAR-PATHNAME ::= "jar:" URL "!/" [ ENTRY ]104 105 URL ::= <URL parsable via java.net.URL.URL()>106 | JAR-FILE-PATHNAME107 108 JAR-FILE-PATHNAME ::= "jar:" "file:" JAR-NAMESTRING "!/" [ ENTRY ]109 110 JAR-NAMESTRING ::= ABSOLUTE-FILE-NAMESTRING111 | RELATIVE-FILE-NAMESTRING112 113 ENTRY ::= [ DIRECTORY "/"]* FILE108 JAR-PATHNAME ::= "jar:" URL "!/" [ ENTRY ] 109 110 URL ::= <URL parsable via java.net.URL.URL()> 111 | JAR-FILE-PATHNAME 112 113 JAR-FILE-PATHNAME ::= "jar:" "file:" JAR-NAMESTRING "!/" [ ENTRY ] 114 115 JAR-NAMESTRING ::= ABSOLUTE-FILE-NAMESTRING 116 | RELATIVE-FILE-NAMESTRING 117 118 ENTRY ::= [ DIRECTORY "/"]* FILE 114 119 115 120 116 121 ### Notes 117 122 118 1. ABSOLUTE-FILE-NAMESTRING and RELATIVE-FILE-NAMESTRINGuse the123 1. `ABSOLUTE-FILE-NAMESTRING` and `RELATIVE-FILE-NAMESTRING` use the 119 124 local filesystem conventions, meaning that on Windows this could 120 contain '\' as the directory separator, while an ENTRYalways uses '/'125 contain '\' as the directory separator, while an `ENTRY` always uses '/' 121 126 to separate directories within the jar proper. 122 127 … … 125 130 --------- 126 131 127 // UC1 -- JAR 128 pathname: { 129 namestring: "jar:file:foo/baz.jar!/" 130 device: ( 131 pathname: { 132 device: "jar:file:" 133 directory: (:RELATIVE "foo") 134 name: "baz" 135 type: "jar" 136 } 137 ) 138 } 139 140 141 // UC2 -- JAR entry 142 pathname: { 143 namestring: "jar:file:baz.jar!/foo.abcl" 144 device: ( pathname: { 145 device: "jar:file:" 146 name: "baz" 147 type: "jar" 148 }) 149 name: "foo" 150 type: "abcl" 151 } 152 153 154 // UC3 -- JAR file in a JAR entry 155 pathname: { 156 namestring: "jar:jar:file:baz.jar!/foo.abcl!/" 157 device: ( 158 pathname: { 159 name: "baz" 160 type: "jar" 161 } 162 pathname: { 132 // UC1 -- JAR 133 pathname: { 134 namestring: "jar:file:foo/baz.jar!/" 135 device: ( 136 pathname: { 137 device: "jar:file:" 138 directory: (:RELATIVE "foo") 139 name: "baz" 140 type: "jar" 141 } 142 ) 143 } 144 145 146 // UC2 -- JAR entry 147 pathname: { 148 namestring: "jar:file:baz.jar!/foo.abcl" 149 device: ( pathname: { 150 device: "jar:file:" 151 name: "baz" 152 type: "jar" 153 }) 163 154 name: "foo" 164 155 type: "abcl" 165 } 166 ) 167 } 168 169 // UC4 -- JAR entry in a JAR entry with directories 170 pathname: { 171 namestring: "jar:jar:file:a/baz.jar!/b/c/foo.abcl!/this/that/foo-20.cls" 172 device: ( 173 pathname { 174 directory: (:RELATIVE "a") 175 name: "bar" 176 type: "jar" 177 } 178 pathname { 179 directory: (:RELATIVE "b" "c") 180 name: "foo" 181 type: "abcl" 182 } 183 ) 184 directory: (:RELATIVE "this" "that") 185 name: "foo-20" 186 type: "cls" 187 } 188 189 // UC5 -- JAR Entry in a JAR Entry 190 pathname: { 191 namestring: "jar:jar:file:a/foo/baz.jar!/c/d/foo.abcl!/a/b/bar-1.cls" 192 device: ( 193 pathname: { 194 directory: (:RELATIVE "a" "foo") 195 name: "baz" 196 type: "jar" 197 } 198 pathname: { 199 directory: (:RELATIVE "c" "d") 200 name: "foo" 201 type: "abcl" 202 } 203 ) 204 directory: (:ABSOLUTE "a" "b") 205 name: "bar-1" 206 type: "cls" 207 } 208 209 // UC6 -- JAR entry in a http: accessible JAR file 210 pathname: { 211 namestring: "jar:http://example.org/abcl.jar!/org/armedbear/lisp/Version.class", 212 device: ( 213 "http://example.org/abcl.jar" 214 pathname: { 215 directory: (:RELATIVE "org" "armedbear" "lisp") 216 name: "Version" 217 type: "class" 218 } 219 } 220 221 // UC7 -- JAR Entry in a JAR Entry in a URL accessible JAR FILE 222 pathname: { 223 namestring "jar:jar:http://example.org/abcl.jar!/foo.abcl!/foo-1.cls" 224 device: ( 225 "http://example.org/abcl.jar" 226 pathname: { 156 } 157 158 159 // UC3 -- JAR file in a JAR entry 160 pathname: { 161 namestring: "jar:jar:file:baz.jar!/foo.abcl!/" 162 device: ( 163 pathname: { 164 name: "baz" 165 type: "jar" 166 } 167 pathname: { 168 name: "foo" 169 type: "abcl" 170 } 171 ) 172 } 173 174 // UC4 -- JAR entry in a JAR entry with directories 175 pathname: { 176 namestring: "jar:jar:file:a/baz.jar!/b/c/foo.abcl!/this/that/foo-20.cls" 177 device: ( 178 pathname { 179 directory: (:RELATIVE "a") 180 name: "bar" 181 type: "jar" 182 } 183 pathname { 184 directory: (:RELATIVE "b" "c") 185 name: "foo" 186 type: "abcl" 187 } 188 ) 189 directory: (:RELATIVE "this" "that") 190 name: "foo-20" 191 type: "cls" 192 } 193 194 // UC5 -- JAR Entry in a JAR Entry 195 pathname: { 196 namestring: "jar:jar:file:a/foo/baz.jar!/c/d/foo.abcl!/a/b/bar-1.cls" 197 device: ( 198 pathname: { 199 directory: (:RELATIVE "a" "foo") 200 name: "baz" 201 type: "jar" 202 } 203 pathname: { 204 directory: (:RELATIVE "c" "d") 205 name: "foo" 206 type: "abcl" 207 } 208 ) 209 directory: (:ABSOLUTE "a" "b") 210 name: "bar-1" 211 type: "cls" 212 } 213 214 // UC6 -- JAR entry in a http: accessible JAR file 215 pathname: { 216 namestring: "jar:http://example.org/abcl.jar!/org/armedbear/lisp/Version.class", 217 device: ( 218 "http://example.org/abcl.jar" 219 pathname: { 220 directory: (:RELATIVE "org" "armedbear" "lisp") 221 name: "Version" 222 type: "class" 223 } 224 } 225 226 // UC7 -- JAR Entry in a JAR Entry in a URL accessible JAR FILE 227 pathname: { 228 namestring "jar:jar:http://example.org/abcl.jar!/foo.abcl!/foo-1.cls" 229 device: ( 230 "http://example.org/abcl.jar" 231 pathname: { 232 name: "foo" 233 type: "abcl" 234 } 235 ) 236 name: "foo-1" 237 type: "cls" 238 } 239 240 // UC8 -- JAR in an absolute directory 241 242 pathame: { 243 namestring: "jar:file:/a/b/foo.jar!/" 244 device: ( 245 pathname: { 246 directory: (:ABSOLUTE "a" "b") 247 name: "foo" 248 type: "jar" 249 } 250 ) 251 } 252 253 // UC9 -- JAR in an relative directory with entry 254 pathname: { 255 namestring: "jar:file:a/b/foo.jar!/c/d/foo.lisp" 256 device: ( 257 directory: (:RELATIVE "a" "b") 258 name: "foo" 259 type: "jar" 260 ) 261 directory: (:ABSOLUTE "c" "d") 227 262 name: "foo" 228 type: "abcl" 229 } 230 ) 231 name: "foo-1" 232 type: "cls" 233 } 234 235 // UC8 -- JAR in an absolute directory 236 237 pathame: { 238 namestring: "jar:file:/a/b/foo.jar!/" 239 device: ( 240 pathname: { 241 directory: (:ABSOLUTE "a" "b") 242 name: "foo" 243 type: "jar" 244 } 245 ) 246 } 247 248 // UC9 -- JAR in an relative directory with entry 249 pathname: { 250 namestring: "jar:file:a/b/foo.jar!/c/d/foo.lisp" 251 device: ( 252 directory: (:RELATIVE "a" "b") 253 name: "foo" 254 type: "jar" 255 ) 256 directory: (:ABSOLUTE "c" "d") 257 name: "foo" 258 type: "lisp 259 } 263 type: "lisp 264 } 260 265 261 266 … … 268 273 269 274 In the analysis of the desire to treat jar pathnames as valid 270 locations for LOAD, we determined that we needed a "double" pathname275 locations for `LOAD`, we determined that we needed a "double" pathname 271 276 so we could refer to the components of a packed FASL in jar. At first 272 277 we thought we could support such a syntax by having the device 273 278 pathname's device refer to the inner jar. But with in this use of 274 PATHNAMEs linked by the DEVICEfield, we found the problem that UNC275 path support uses the DEVICEfield so JARs located on UNC mounts can't276 be referenced. via '\\' .277 278 i.e.jar:jar:file:\\server\share\a\b\foo.jar!/this\that!/foo.java279 `PATHNAME`s linked by the `DEVICE` field, we found the problem that UNC 280 path support uses the `DEVICE` field so JARs located on UNC mounts can't 281 be referenced. via '\\', i.e. 282 283 jar:jar:file:\\server\share\a\b\foo.jar!/this\that!/foo.java 279 284 280 285 would not have a valid representation. 281 286 282 So instead of having DEVICE point to a PATHNAME, we decided that the283 DEVICE shall be a list of PATHNAMES, so we would have:284 285 pathname: {286 namestring: "jar:jar:file:\\server\share\foo.jar!/foo.abcl!/"287 device: (288 pathname: {289 host: "server"290 device: "share"291 name: "foo"292 type: "jar"293 }294 pathname: {295 name: "foo"296 type: "abcl"297 }298 }299 300 Although there is a fair amount of special logic inside Pathname.java301 itself in the resulting implementation, the logic in Load.javaseems302 to have been considerably simplified. 303 287 So instead of having `DEVICE` point to a `PATHNAME`, we decided that the 288 `DEVICE` shall be a list of `PATHNAME`, so we would have: 289 290 pathname: { 291 namestring: "jar:jar:file:\\server\share\foo.jar!/foo.abcl!/" 292 device: ( 293 pathname: { 294 host: "server" 295 device: "share" 296 name: "foo" 297 type: "jar" 298 } 299 pathname: { 300 name: "foo" 301 type: "abcl" 302 } 303 } 304 305 Although there is a fair amount of special logic inside `Pathname.java` 306 itself in the resulting implementation, the logic in `Load.java` seems 307 to have been considerably simplified. 308 -
trunk/abcl/doc/slime.markdown
r12556 r12560 2 2 ===== 3 3 4 Author: Mark Evenson5 Created: 16-MAR-20106 Modified: 16-MAR-20104 Author: Mark Evenson 5 Created: 16-MAR-2010 6 Modified: 18-MAR-2010 7 7 8 8 SLIME is divided conceptually in two parts: the "swank" server process … … 25 25 One first locates the SLIME directory on the filesystem. In the code 26 26 that follows, the SLIME top level directory is assumed to be 27 "~/work/slime", so adjust this value to your local value as you see27 `"~/work/slime"`, so adjust this value to your local value as you see 28 28 fit. 29 29 … … 31 31 adding code something like the following to "~/.emacs": 32 32 33 :::common-lisp 33 34 (add-to-list 'load-path "~/work/slime") 34 35 (setq slime-lisp-implementations … … 40 41 41 42 One further need to customize the setting of 42 SLIME-LISP-IMPLEMENTATIONSto the location(s) of the Lisp(s) you wish to43 `SLIME-LISP-IMPLEMENTATIONS` to the location(s) of the Lisp(s) you wish to 43 44 invoke via SLIME. The value is list of lists of the form 44 45 … … 46 47 47 48 where SYMBOL is a mnemonic for the Lisp implementation, and the string 48 "/path/to/lisp"is the absolute path of the Lisp implementation that49 `"/path/to/lisp"` is the absolute path of the Lisp implementation that 49 50 SLIME will associate with this symbol. In the example above, I have 50 51 defined three implementations, the main abcl implementation, a version 51 52 that corresponds to the latest version from SVN invoked by 52 "~/work/abcl.svn/abcl", and a version of SBCL.53 `"~/work/abcl.svn/abcl"`, and a version of SBCL. 53 54 54 To start SLIME one simply issues M-x slimefrom Emacs. This will55 To start SLIME one simply issues `M-x slime` from Emacs. This will 55 56 start the first entry in the SLIME-LISP-IMPLEMENTATIONS list. If you 56 wish to start a subsequent Lisp, prefix the invocation via M-u 57 (i.e. M-u M-x slime). This will present an interactive chooser over 58 all symbols contained in SLIME-LISP-IMPLEMENTATIONS. 57 wish to start a subsequent Lisp, prefix the Emacs invocation with a 58 negative argument (i.e. `C-- M-x slime`). This will present an 59 interactive chooser over all symbols contained in 60 `SLIME-LISP-IMPLEMENTATIONS`. 59 61 60 62 After you invoke SLIME, you'll see a buffer open up named 61 *inferior-lisp*where the Lisp image is started up, the required swank63 `*inferior-lisp*` where the Lisp image is started up, the required swank 62 64 code is complied and then loaded, finally, you'll see the "flying 63 letters" resolving itself to a "CL-USER>"prompt with an inspiration65 letters" resolving itself to a `"CL-USER>"` prompt with an inspiration 64 66 message in the minibuffer. Your initiation to SLIME has begun... 65 67 … … 72 74 point to the top directory of the server process. 73 75 74 ` 76 :::commmon-lisp 75 77 (defvar *slime-directory* #p"~/work/slime/") ;; Don't forget trailing slash 76 78 (load (merge-pathnames "swank-loader.lisp" *slime-directory*) :verbose t) … … 78 80 (swank:start-server "/tmp/swank.port") ;; remove if you don't want 79 81 ;; swank to start listening for connections. 80 ` 82 81 83 When this code finishes executing, an integer representing the port on 82 which the server starts will be written to '/tmp/swank.port'and also83 returned as the result of evaluating SWANK:START-SERVER. One may84 connect to this port via issuing M-x slime-connectin Emacs.84 which the server starts will be written to `'/tmp/swank.port'` and also 85 returned as the result of evaluating `SWANK:START-SERVER`. One may 86 connect to this port via issuing `M-x slime-connect` in Emacs. 85 87 86 88
Note: See TracChangeset
for help on using the changeset viewer.