Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Reference to $_ during typeset



[Bringing this over from zsh-users]

On Jun 10,  8:12am, Sebastian Gniazdowski wrote:
} Subject: Re: Can $_ substitute $0 when nofunctionargzero
}
} It is little hard to understand. For example something works in following:
} 
} local var="I am $_"
} > I am local

That's a very strange definition of "works".

This began happening when local, typeset, et al. became keywords.  It
doesn't "work" in zsh prior to that, and it's probably a bug in this
case.  Zsh 5.0.3 (for example) shows the correct behavior:

torch% echo foo
foo
torch% local var="I am $_"
torch% print $var
I am foo

Whereas 5.1 is broken:

torch% echo foo
foo
torch% local var="I am $_"
torch% print $var
I am local

Probably this just shows how seldom $_ is used for anything at all.



Messages sorted by: Reverse Date, Date, Thread, Author