Subject: [clisp-list] clisp logical pathnames on unix

From: George Ferguson <[email-masked]>
Date: Tue May 7 08:58:01 2002

Hi clisp people. Great package. Very nice work.

I had a few problems using logical pathnames on my
solaris box, particularly when the
*PARSE-NAMESTRING-ANSI* feature was enabled (hey, we
have lots of old code that hits the spec, and don't
use PCs with "C:" filenames).

I am attaching a patch against v2.28 that does the
following:
(a) allows chars beyond A-Za-z0-9- in logical
pathnames (for example: "_")
(b) doesn't upcase components of logical pathnames
(c) doesn't downcase pathnames in the name of a
"preference for lowercase"
Don't know if these changes are something you'd want
to put into the main distribution, but there they are
anyway.

The patch also fixes one unbound variable problem in
the compiler that arose when I had :verbose NIL (or
something like that--you'll see from the patch).

Hope this might be useful to you in the future.

Speaking of which, I really need multithreading, with
exactly the special variable treatment spelled out in
multithread.txt. I'd be willing to help. If the
maintainers want to contact me, send email to this
account and I will send you my real address (sorry
spammers, not for you).

Thanks again,
George
-- 
[email-masked]

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

*** src/pathname.d.dist	Thu Feb 28 14:49:30 2002
--- src/pathname.d	Mon May  6 14:39:30 2002
***************
*** 1127,1135 ****
  local bool legal_logical_word_char (chart ch) {
    ch = up_case(ch);
    var cint c = as_cint(ch);
    if (((c >= 'A') && (c <= 'Z'))
        || ((c >= '0') && (c <= '9'))
!       || (c == '-'))
      return true;
    else
      return false;
--- 1127,1136 ----
  local bool legal_logical_word_char (chart ch) {
    ch = up_case(ch);
    var cint c = as_cint(ch);
+   # gf: Accept many more chars as valid in logical pathnames (eg '_')
    if (((c >= 'A') && (c <= 'Z'))
        || ((c >= '0') && (c <= '9'))
!       || (c == '-') || (c == '_') || (c == '+') || (c == '='))
      return true;
    else
      return false;
***************
*** 1577,1583 ****
      {
        var const chart* ptr1 = &TheSstring(STACK_2)->data[startz.index];
        var chart* ptr2 = &TheSstring(result)->data[0];
!       dotimespL(len,len, { *ptr2++ = up_case(*ptr1++); });
      }
      return result;
    }
--- 1578,1586 ----
      {
        var const chart* ptr1 = &TheSstring(STACK_2)->data[startz.index];
        var chart* ptr2 = &TheSstring(result)->data[0];
!       # gf: Don't upcase pathname elements
!       # dotimespL(len,len, { *ptr2++ = up_case(*ptr1++); });
!       dotimespL(len,len, { *ptr2++ = *ptr1++; });
      }
      return result;
    }
***************
*** 5443,5449 ****
  local object customary_case (object string) {
    if (!simple_string_p(string))
      return string;
!  #if defined(PATHNAME_UNIX) || defined(PATHNAME_OS2) || defined(PATHNAME_WIN32) || defined(PATHNAME_RISCOS)
    # operating system with preference for small letters
    return string_downcase(string);
   #endif
--- 5446,5453 ----
  local object customary_case (object string) {
    if (!simple_string_p(string))
      return string;
!  # gf: Don't downcase unix pathnames!
!  #if defined(PATHNAME_OS2) || defined(PATHNAME_WIN32) || defined(PATHNAME_RISCOS)
    # operating system with preference for small letters
    return string_downcase(string);
   #endif
*** src/compiler.lisp.dist	Fri Mar  1 00:01:49 2002
--- src/compiler.lisp	Fri May  3 16:17:01 2002
***************
*** 244,250 ****
  (defvar *compile-file-truename* nil) ; CLtL2 p. 680
  (defvar *compile-file-lineno1* nil)
  (defvar *compile-file-lineno2* nil)
! (defvar *c-listing-output*) ; Compiler-Listing-Stream or nil
  (defvar *c-error-output*) ; Compiler-Error-Stream
  ;; essentially
  ;; *c-error-output* = (make-broadcast-stream *error-output* *c-listing-output*)
--- 244,250 ----
  (defvar *compile-file-truename* nil) ; CLtL2 p. 680
  (defvar *compile-file-lineno1* nil)
  (defvar *compile-file-lineno2* nil)
! (defvar *c-listing-output* nil) ; Compiler-Listing-Stream or nil
  (defvar *c-error-output*) ; Compiler-Error-Stream
  ;; essentially
  ;; *c-error-output* = (make-broadcast-stream *error-output* *c-listing-output*)

---

From: Sam Steingold <[email-masked]>
Date: Wed May 8 10:20:03 2002

Hi George,

> * In message <[email-masked]>
> * On the subject of "[clisp-list] clisp logical pathnames on unix"
> * Sent on Tue, 7 May 2002 08:57:03 -0700 (PDT)
> * Honorable George Ferguson <[email-masked]> writes:
>
thanks.

> I am attaching a patch against v2.28 that does the following:

<http://www.lisp.org/HyperSpec/Body/sec_19-3-1.html>
19.3.1 Syntax of Logical Pathname Namestrings
...
word---one or more uppercase letters, digits, and hyphens
...

> (b) doesn't upcase components of logical pathnames

<http://www.lisp.org/HyperSpec/Body/sec_19-3-1-1-7.html>:
19.3.1.1.7 Lowercase Letters in a Logical Pathname Namestring
When parsing words and wildcard-words, lowercase letters are translated to uppercase.

> "preference for lowercase"

logical pathnames are "the lowest common denominator" across all
platforms on which CL and its predecessors have ever run.
thus all the conversions and limitations.

> something like that--you'll see from the patch).

could you please supply an exact test case?

> Speaking of which, I really need multithreading, with exactly the
> special variable treatment spelled out in multithread.txt. I'd be
> willing to help.

If you can and want to work on this, please go ahead.
subscribe to <clisp-devel> and ask questions, brag, and send patches
there.

> If the maintainers want to contact me, send email to this account and
> I will send you my real address (sorry spammers, not for you).

all these thicks inconvenience your interlocutors more than spammers.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.palestine-central.com/> <http://www.mideasttruth.com/>
Don't take life too seriously, you'll never get out of it alive!