zsh-workers
 help / color / mirror / code / Atom feed
* compinit as function?
@ 1999-04-14 12:23 Andrej Borsenkow
  1999-04-14 12:38 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Borsenkow @ 1999-04-14 12:23 UTC (permalink / raw)
  To: ZSH workers mailing list

Is there any real reason, why compinit cannot be a function?

The only problem as far as I can see is, that it defines several global
AA's - and current typeset's will make them local.

One workaround is to use

: ${(AA)hash:=}

(it is ugly, but it works)

Another possibility is to add the global flag to typeset: typeset -g. Can it
be useful in other cases?

Having compinit as function will allow to simply drop the whole stuff in
auoloaded fpath - and don't worry about path to compinit anymore. Of course,
then some other standard path to dump file is needed.

/andrej


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: compinit as function?
  1999-04-14 12:23 compinit as function? Andrej Borsenkow
@ 1999-04-14 12:38 ` Peter Stephenson
  1999-04-14 13:13   ` Andrej Borsenkow
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 1999-04-14 12:38 UTC (permalink / raw)
  To: ZSH workers mailing list

"Andrej Borsenkow" wrote:
> Is there any real reason, why compinit cannot be a function?

One reason is that it wastes memory, since it's quite large and you only
use it once.

> Another possibility is to add the global flag to typeset: typeset -g. Can it
> be useful in other cases?

I've been thinking about this.  It should be easy to add.


$testhash is just what it's name suggests.  It was added because there's
currently no other way of checking that special associative arrays work
properly (in particular being restored after `testhash=... cmd').  It will
eventually disappear.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: compinit as function?
  1999-04-14 12:38 ` Peter Stephenson
@ 1999-04-14 13:13   ` Andrej Borsenkow
  0 siblings, 0 replies; 3+ messages in thread
From: Andrej Borsenkow @ 1999-04-14 13:13 UTC (permalink / raw)
  To: Peter Stephenson, ZSH workers mailing list

> "Andrej Borsenkow" wrote:
> > Is there any real reason, why compinit cannot be a function?
>
> One reason is that it wastes memory, since it's quite large and you only
> use it once.
>

It is not as large. The main part are defines for compdef and compconf :-)
And may be more options to compinit can be useful in future ... compinit
rehash to reread new fpath as example? If Zsh will ever be able to execute
functions on access to variables ...

/andrej


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-04-14 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-14 12:23 compinit as function? Andrej Borsenkow
1999-04-14 12:38 ` Peter Stephenson
1999-04-14 13:13   ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).