Changeset 12617
- Timestamp:
- 04/15/10 14:54:55 (13 years ago)
- Location:
- trunk/abcl
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Pathname.java
r12614 r12617 75 75 namestring = null; 76 76 } 77 78 // ### %invalidate-namestring 79 private static final Primitive _INVALIDATE_NAMESTRING = new pf_invalidate_namestring(); 80 private static class pf_invalidate_namestring extends Primitive { 81 pf_invalidate_namestring() { 82 super("%invalidate-namestring", PACKAGE_EXT, false); 83 } 84 @Override 85 public LispObject execute(LispObject first) { 86 ((Pathname)coerceToPathname(first)).invalidateNamestring(); 87 return first; 88 } 89 } 77 90 78 91 protected Pathname() {} … … 1611 1624 private static class pf_pathname_jar_p extends Primitive { 1612 1625 pf_pathname_jar_p() { 1613 super("pathname-jar-p", PACKAGE_ SYS, true, "pathname",1626 super("pathname-jar-p", PACKAGE_EXT, true, "pathname", 1614 1627 "Predicate for whether PATHNAME references a JAR."); 1615 1628 } … … 1629 1642 private static class pf_pathname_url_p extends Primitive { 1630 1643 pf_pathname_url_p() { 1631 super("pathname-url-p", PACKAGE_ SYS, true, "pathname",1644 super("pathname-url-p", PACKAGE_EXT, true, "pathname", 1632 1645 "Predicate for whether PATHNAME references a URL."); 1633 1646 } -
trunk/abcl/src/org/armedbear/lisp/Symbol.java
r12607 r12617 2921 2921 public static final Symbol SLIME_OUTPUT_STREAM = 2922 2922 PACKAGE_EXT.addExternalSymbol("SLIME-OUTPUT-STREAM"); 2923 public static final Symbol JAR_PATHNAME = 2924 PACKAGE_EXT.addExternalSymbol("JAR-PATHNAME"); 2925 public static final Symbol URL_PATHNAME = 2926 PACKAGE_EXT.addExternalSymbol("URL-PATHNAME"); 2923 2927 2924 2928 // MOP. … … 3066 3070 public static final Symbol JAVA_STACK_FRAME = 3067 3071 PACKAGE_SYS.addInternalSymbol("JAVA-STACK-FRAME"); 3068 public static final Symbol JAR_PATHNAME =3069 PACKAGE_SYS.addExternalSymbol("JAR-PATHNAME");3070 public static final Symbol URL_PATHNAME =3071 PACKAGE_SYS.addExternalSymbol("URL-PATHNAME");3072 3072 3073 3073 // CDR6 -
trunk/abcl/src/org/armedbear/lisp/asdf-abcl.lisp
r12447 r12617 42 42 (c cl-source-file)) 43 43 (let ((files (output-files o c))) 44 (if (every #' sys:pathname-jar-p files)44 (if (every #'ext:pathname-jar-p files) 45 45 t 46 46 (call-next-method)))) -
trunk/abcl/src/org/armedbear/lisp/pathnames.lisp
r12607 r12617 434 434 :format-control "~S cannot be converted to a pathname." 435 435 :format-arguments (list thing))))) 436 437 438 ;;; Functions for dealing with URL Pathnames 439 440 (in-package :extensions) 441 442 (defun url-pathname-scheme (p) 443 (unless (pathname-url-p p) 444 (error "~A is not a URL pathname." p)) 445 (getf (pathname-host p) :scheme)) 446 447 (defun set-url-pathname-scheme (p v) 448 (unless (pathname-url-p p) 449 (error "~A is not a URL pathname." p)) 450 (let ((host (pathname-host p))) 451 (setf (getf host :scheme) v)) 452 (%invalidate-namestring p)) 453 454 (defsetf url-pathname-scheme set-url-pathname-scheme) 455 456 (defun url-pathname-authority (p) 457 (unless (pathname-url-p p) 458 (error "~A is not a URL pathname." p)) 459 (getf (pathname-host p) :authority)) 460 461 (defun set-url-pathname-authority (p v) 462 (unless (pathname-url-p p) 463 (error "~A is not a URL pathname." p)) 464 (let ((host (pathname-host p))) 465 (setf (getf host :authority) v)) 466 (%invalidate-namestring p)) 467 468 (defsetf url-pathname-authority set-url-pathname-authority) 469 470 (defun url-pathname-query (p) 471 (unless (pathname-url-p p) 472 (error "~A is not a URL pathname." p)) 473 (getf (pathname-host p) :query)) 474 475 (defun set-url-pathname-query (p v) 476 (unless (pathname-url-p p) 477 (error "~A is not a URL pathname." p)) 478 (let ((host (pathname-host p))) 479 (setf (getf host :query) v)) 480 (%invalidate-namestring p)) 481 482 (defsetf url-pathname-query set-url-pathname-query) 483 484 (defun url-pathname-fragment (p) 485 (unless (pathname-url-p p) 486 (error "~A is not a URL pathname." p)) 487 (getf (pathname-host p) :fragment)) 488 489 (defun set-url-pathname-fragment (p v) 490 (unless (pathname-url-p p) 491 (error "~A is not a URL pathname." p)) 492 (let ((host (pathname-host p))) 493 (setf (getf host :fragment) v)) 494 (%invalidate-namestring p)) 495 496 (defsetf url-pathname-query set-url-pathname-fragment) 497 498 (export '(url-pathname-scheme 499 url-pathname-authority 500 url-pathname-query 501 url-pathname-fragment) 502 'ext) -
trunk/abcl/test/lisp/abcl/jar-pathname.lisp
r12616 r12617 279 279 (d (first (pathname-device p)))) 280 280 (values 281 ( system:pathname-url-p d)281 (ext:pathname-url-p d) 282 282 (namestring d) 283 283 (pathname-directory p) (pathname-name p) (pathname-type p))) … … 292 292 (d1 (second d))) 293 293 (values 294 ( system:pathname-url-p d0)294 (ext:pathname-url-p d0) 295 295 (namestring d0) 296 296 (pathname-name d1) (pathname-type d1) -
trunk/abcl/test/lisp/abcl/url-pathname.lisp
r12616 r12617 30 30 "query=this" 31 31 "that-fragment") 32 33 (deftest url-pathname.3 34 (let* ((p (pathname 35 "http://example.org/a/b/foo.lisp?query=this#that-fragment"))) 36 (values 37 (ext:url-pathname-scheme p) 38 (ext:url-pathname-authority p) 39 (ext:url-pathname-query p) 40 (ext:url-pathname-fragment p))) 41 "http" 42 "example.org" 43 "query=this" 44 "that-fragment")
Note: See TracChangeset
for help on using the changeset viewer.