From 51f960533f2ddb0765a0ce7fbce069f9fcf2a1cd Mon Sep 17 00:00:00 2001 From: Mark Evenson Date: Wed, 1 May 2024 11:52:33 +0200 Subject: [PATCH] Start of an implementation of PATHNAME :CASE conventions TODO test, and memoize per a suitable PATHNAME predicate whether a given filesystem is case preserving. Hook this implementation up. Will resolve . --- src/org/armedbear/lisp/Pathname.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/org/armedbear/lisp/Pathname.java b/src/org/armedbear/lisp/Pathname.java index 639e37485..a9127d185 100644 --- a/src/org/armedbear/lisp/Pathname.java +++ b/src/org/armedbear/lisp/Pathname.java @@ -145,6 +145,17 @@ public Pathname setVersion(LispObject version) { return this; } + /** One of the keywords :LOCAL or :COMMON */ + protected LispObject _case = NIL; + public LispObject getCase() { + return _case; + } + + public Pathname setCase(LispObject _case) { + this._case = _case; + return this; + } + /** * The path component separator used by internally generated * path namestrings. @@ -462,7 +473,8 @@ public LispObject getParts() { new Cons("DIRECTORY", getDirectory()), new Cons("NAME", getName()), new Cons("TYPE", getType()), - new Cons("VERSION", getVersion())); + new Cons("VERSION", getVersion()), + new Cons("CASE", getCase())); return parts; } @@ -1100,6 +1112,7 @@ static final LispObject _makePathname(LispObject[] args) { LispObject name = NIL; LispObject type = NIL; LispObject version = NIL; + LispObject _case = NIL; Pathname defaults = null; boolean hostSupplied = false; boolean deviceSupplied = false; @@ -1107,6 +1120,7 @@ static final LispObject _makePathname(LispObject[] args) { boolean typeSupplied = false; boolean directorySupplied = false; boolean versionSupplied = false; + boolean _caseSupplied = false; for (int i = 0; i < args.length; i += 2) { LispObject key = args[i]; LispObject value = args[i + 1]; @@ -1163,7 +1177,10 @@ static final LispObject _makePathname(LispObject[] args) { } else if (key == Keyword.DEFAULTS) { defaults = coerceToPathname(value); } else if (key == Keyword.CASE) { - // Ignored. + Pathname.checkCaseArgument(value); // possible non-local exit + + _case = value; + _caseSupplied = true; } } if (defaults != null) {