zsh-workers
 help / color / mirror / code / Atom feed
* Re: Problems with the functions[] parameter
@ 2000-03-10  9:49 Sven Wischnowsky
  2000-03-10 12:03 ` Problems with the functions[] parameter (not; but other issues) Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-03-10  9:49 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> I think that wordcode storage of functions has messed up the function[]
> assoc from the parameter module.  The value of functions[something] no
> longer accurately reflects the current state of the function `something'
> and assigning to (or using vared on) functions[something] no longer
> changes the definition of `something'.

Seems to work fine for me both with read and mapped wordcode
files... could you give me an example?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Re: Problems with the functions[] parameter (not; but other issues)
  2000-03-10  9:49 Problems with the functions[] parameter Sven Wischnowsky
@ 2000-03-10 12:03 ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2000-03-10 12:03 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

On Mar 10, 10:49am, Sven Wischnowsky wrote:
} Subject: Re: Problems with the functions[] parameter
}
} Bart Schaefer wrote:
} 
} > I think that wordcode storage of functions has messed up the functions[]
} > assoc from the parameter module.  The value of functions[something] no
} > longer accurately reflects the current state of the function `something'
} 
} Seems to work fine for me both with read and mapped wordcode
} files... could you give me an example?

It's me being silly.  I just figured out that the function I was editing
(to change "autoload -XU" to "autoload -XUt") was being referenced inside
a $(...), so of course the autoload doesn't replace the actual definition
in the parent.

Which leads me to two observations ...

(1) autoloading the _call function (for example) is inefficient; it is
    never used except in $(...), which means it is reloaded every time.
    Would it be useful to use e.g.

    	#autoload +X

   at the top of such files?  To mean, "load this as soon as compinit
   sees it, don't wait for it to be executed via $fpath."  (But what
   would that mean for compdump?)

(2) Redirecting stderr of a function is a bit inconsistent with respect
    to xtrace.  Zsh presently works the same way bash does, which means
    the xtrace output of shell functions is *not* redirected along with
    their stderr.  This is not the same as e.g. `do'-loops and { ... }.

And (2) in turn leads me to notice a third thing:

In bash, redirecting the standard error of the `.' command redirects
the xtrace output from the commands in the sourced file.  This doesn't
presently happen in zsh, but I think the zsh behavior is more useful;
other opinions?  Is compatibility more important?  What does ksh do?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

* Problems with the functions[] parameter
@ 2000-03-09 18:06 Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2000-03-09 18:06 UTC (permalink / raw)
  To: zsh-workers

I think that wordcode storage of functions has messed up the function[]
assoc from the parameter module.  The value of functions[something] no
longer accurately reflects the current state of the function `something'
and assigning to (or using vared on) functions[something] no longer
changes the definition of `something'.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~2000-03-10 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-10  9:49 Problems with the functions[] parameter Sven Wischnowsky
2000-03-10 12:03 ` Problems with the functions[] parameter (not; but other issues) Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2000-03-09 18:06 Problems with the functions[] parameter Bart Schaefer

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).