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

Re: completion test suggestion



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.

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.

I guess I could live with this if we can't come up with anything better,
but I'd still like to try to come up with something better.



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