On Tue, Sep 20, 2011 at 12:08:27AM +0300, Philip Ganchev wrote:
> On Mon, Sep 19, 2011 at 6:06 PM, Robert Shinka <k...@unknownlayer.net> wrote:
> > <snip>
> > I'm only proposing changing the semantics of "$var", while $var would be
> > unchanged, so the common case of (echo $var) would format as usual,
> > separated with spaces, but (echo "$var") would print the original
> > string, including any embedded newlines.
> >
> > eg.,
> >> set var (echo 1\n2\n3)
> >> echo $var     # echo '1' '2' '3'
> > 1 2 3
> >> echo "$var"   # echo '1\n2\n3'
> > 1
> > 2
> > 3
> >
> > Is there a compelling reason not to make this change?
> 
> Oh, I see. The only argument against that I can see is that it is an
> extra syntax rule to remember.

It doesn't seem like an extra rule to me, given that what "$var"
currently does is counterintuitive.

> This would solve Jan's use case by first setting a variable, as you
> show above. But maybe it would be logical if process substitution has
> a symmetric syntax:
> 
> echo (echo 1\n2\n3)
> 1 2 3
> echo "(echo 1\n2\n3)"
> 1
> 2
> 3
> 
> Regards,
> Philip

I'd be willing to endorse that, as it does fill another hole in fish's
string-handling capabilities, and should make some tasks a lot easier.
The only question that remains then would be whether to allow escaping
parentheses inside strings to prevent evaluation, or simply require the
use of '' rather than "" where it's not desired.

There is one significant downside, however: a little breakage with user
scripts is likely, but updating them should be very simple.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to