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

Re: A way to untie -T vars?



On Tue, Jan 24, 2023 at 6:41 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Jan 24, 2023 at 8:45 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> >
> > > On 24/01/2023 16:42 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > > I don't think we're going to have any guarantied parameters. :-)
> > > Guaranteed, maybe.
> >
> > "Use of shell language by users voids guarantee".
>
> There are only 14 words containing "tied" in /usr/share/dict/words on
> my desktop, and a quick scan of words ending in "ty|tie" doesn't yield
> many that can be "tied", and none except "untied" seem likely to ever
> apply.

There is also "array", "scalar" and "left" in the code with a similar
assumption about the future keywords.

If I were writing this code, I would change it without computing
probabilities because it feels wrong to me. I've learned this specific
pitfall a long time ago and since then it jumps out at me when I see
it in someone's code. The fix is fairly simple and would make the code
more explicit, hence easier to understand. It'll be clear that we are
checking for "left" and not for any keyword that contains "left".
Right now I actually don't know what that line does and if there are
keywords that contain "left" but aren't equal to it.

Roman.




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