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

Re: completion test suggestion



Bart Schaefer wrote:

> Sven Wischnowsky writes:
>  > In mathematical environments you can use expressions like
>  > `foo(x,y)'.
> 
> The problem that I have with this is that I don't know whether the value
> of the function is its exit status or its standard output.  To behave
> like a unix tool (say, `expr`) you'd want to capture its output and use
> that; but if it's a shell function it'd be much easier to capture its
> exit status (no fork/read required).  But then the truth/falsehood of
> zero/nonzero exit status is reversed in math context, which is really
> confusing.

I thought about using the return value or the value of a parameter,
the function sets (`REPLY'?). But we needn't allow shell functions
here (or add this later). If we have only builtin (in the base or in
modules) functions this isn't a problem.

> The other difficulty is that you have to call the function twice (or
> call two different functions) to produce the start and end values of a
> range, if what you want is some slice of $words.

Compared to a parameter expansion in a subscript this would still be
faster, I think (if that is the problem you mean).


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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