John Brock
[EMAIL PROTECTED]

On Fri, Feb 17, 2006 at 07:05:19PM -0500, Philip Ganchev wrote:
> ---------- Forwarded message ----------
> From: Axel Liljencrantz <[EMAIL PROTECTED]>
> Date: Feb 17, 2006 11:30 AM
> 
> Hmmm, did you intend for this mail to be on-list? If so, feel free to
> forward this reply to the list as well...

> On 2/9/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> > Allowing "foo |; bar" is bad because it complicates the rule for
> > ending statements: a statement ends at a newline or semicolon EXCEPT
> > if the preceding token is a pipe.
> >
> > A better option is to have an escape character (backslash), as
> > Netocrat suggested earlier:
> >
> > for h in (cat /etc/dupload.conf $HOME/.dupload.conf ^/dev/null \
> >         | awk -F "=" '/('\''fqdn'\''| *fqdn *=)/ {print $2}' \
> >         | cut -d"'" -f2 \
> >         | cut -d'"' -f2)
> >     set hosts $hosts $h
> > end
> >
> > In this way, semicolon (;) and newline mean the same thing, and
> > strange expressions like "foo |; bar" are avoided.  Axel originally
> > objected (and I replied):

> I dislike this because it is impossible to tell if a newline is
> escaped or if one is escaping a space character. Though I've thought
> about this for a bit and have come to the conclusion that this is an
> editor issue. An editor could, if it wanted to, differentiatte between
> the two, for example by highlighting the backslashed newline using a
> different background color.
> 
> I guess an otherwise rather sane syntax should not be punished because
> editors are stupid.

Personally I like "\" as a line continuation character.  It's syntax
that a lot of people are familiar and comfortable with.  So why
not just make it the rule that fish discards all whitespace at the
end of a line (unless you are inside a quote or something)?  Then
"\" as the last non-whitespace character in a line always means
line continuation, and you never have to worry that it might instead
be escaping a space character.  (Does leading whitespace ever matter
in fish?  Then why should trailing whitespace?)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to