Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: wrapper functions in modules
- X-seq: zsh-workers 4818
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxxxxxxx
- Subject: Re: wrapper functions in modules
- Date: Wed, 16 Dec 1998 01:50:48 -0800
- In-reply-to: <199812160805.JAA00604@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- References: <199812160805.JAA00604@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Dec 16, 9:05am, Sven Wischnowsky wrote:
} Subject: Re: wrapper functions in modules
}
} Bart Schaefer wrote:
}
} > On Dec 15, 1:03pm, Sven Wischnowsky wrote:
} > }
} > } Bart Schaefer wrote:
} > } > Is the new first parameter of doshfunc() needed any longer?
} > }
} > } [For those who don't want to look at the code: the argument is the
} > } name of the function to be executed.]
} > }
} > } I added the argument since modules may be interested in it
} >
} > Hm. I'm not sure that modules *ought* to be interested in it, but...
}
} I wouldn't resist to remove this or to use a global variable for it.
A parameter is almost always better than a global, for things that get
stacked and restored like this.
} > One thing a wrapper function might legitimately be interested in is the
} > context in which it was called.
}
} Yes, that would be good to have. Using a global integer variable or an
} argument and a couple of constants?
Here a global makes more sense, since it only changes once as you enter
(say) the completion code and remains constant all the way down the
shell function call chain.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author