Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Reading completion manual
- X-seq: zsh-workers 5610
- From: Bruce Stephens <B.Stephens@xxxxxxxxx>
- To: ZSH workers mailing list <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Re: Reading completion manual
- Date: 02 Mar 1999 17:29:25 +0000
- In-reply-to: "Andrej Borsenkow"'s message of "Tue, 2 Mar 1999 20:20:12 +0300"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <000201be64d0$ee20e160$21c9ca95@xxxxxxxxxxxxxxx>
- Sender: B.Stephens@xxxxxxxxx
"Andrej Borsenkow" <borsenkow.msk@xxxxxx> writes:
> > I thought namespaces had been discussed before? What's the objection
> > to allowing "." in variable names, and regarding it as a component
> > delimiter in function/command names?
>
> I spoke about functions not variables. Variables names are limited to
> alphanumeric, so you can safely use ``.'' as delimiter. Function names can
> be arbitrary (am I wrong?)
I don't see that it matters (practically). "_" is a non-optimal
choice, since people already use it too much, but some other prefix
would be OK, and it could be "zle." or "compctl." or something (i.e.,
looking like namespaces).
> Hmm, this isn't a good idea; I
> > quite often use things like "cp $i $i.bak" and stuff.
>
> If I remember correctly, it should start with a dot. And of course, you can
> use braces as usual
>
> cp ${.myvars.i} ${.myvars.i}.bak
>
> But you are right, it can break some scripts
Ah, OK. That's less confusing than my notion of predeclaring
namespaces. In that case, functions could do the same---
".zle.path_files"---or whatever. That's not likely to conflict with
ordinary usage.
> > (So if you have a function foo.WRITE, then that gets called when you
> > try to write to foo. Something like that, anyway. A better interface
> > might be to copy the Perl tie ideas---allowing special associative
> > arrays and things as Bart suggested; you wouldn't need name spaces for
> > this, of course.)
> >
>
> May be, simply add ZSH emulation module to Perl :-))) But yes, what
> you've just described is my long cherished idea.
Yes, it's a natural extension to zsh-with-associative-arrays. But
it's orthogonal to variable namespaces.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author