scsh-users
[Top] [All Lists]

Re: #<<A

To: Alan Bawden <Alan@LCS.MIT.EDU>
Subject: Re: #<<A
From: Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
Date: Mon, 08 Jul 2002 10:08:04 +0200
Cc: scsh-bugs@zurich.ai.mit.edu
Sender: gasbichl@informatik.uni-tuebingen.de
>>>>> "Alan" == Alan Bawden <Alan@LCS.MIT.EDU> writes:

Alan>   snowview:alan> scsh
Alan>   Welcome to scsh 0.6.0 (Chinese Democracy)

*Please* don't use 0.6.0 any more, it contains so many bugs...

Alan>   Type ,? for help.
>> #<<A

Alan>   Error: #<< here-string empty delimiter line
Alan>    #{Input-fdport #{Input-channel "standard input"}}
>> 

Alan> So a single character delimiter line is being treated as if it was 
empty...

Alan> Interestingly, an empty delimiter line is accepted, and works as you might
Alan> expect -- the string is terminated by an empty line -- which makes me
Alan> wonder what this error check thinks it is protecting me from.

I think, the code that reports the error is trying to protect you from
exactly this case. Unfortunately, it gets the counting wrong and
rejects the wrong case. The following patch fixes this, but will then
of course fail to accept an empty line as delimiter. Olin should say
whether he really wants this to happen as the documentation doesn't
preclude empty delimiter lines.



Index: here.scm
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/here.scm,v
retrieving revision 1.1
diff -u -c -r1.1 here.scm
*** here.scm    14 Sep 1999 13:32:02 -0000      1.1
--- here.scm    8 Jul 2002 07:58:48 -0000
***************
*** 94,101 ****
      (cond ((eof-object? delim)
           (reading-error port
                          "EOF while reading #<< here-string delimiter line."))
!         ((= 1 (string-length delim))
!          (reading-error port "#<< here-string empty delimiter line"))
  
          (else
           (let lp ((text '()))
--- 94,101 ----
      (cond ((eof-object? delim)
           (reading-error port
                          "EOF while reading #<< here-string delimiter line."))
!         ((= 0 (string-length delim))
!          (reading-error port "#<< here-string empty delimiter line"))
  
          (else
           (let lp ((text '()))


-- 
Martin

<Prev in Thread] Current Thread [Next in Thread>
  • #<<A, Alan Bawden
    • Re: #<<A, Martin Gasbichler <=