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

Re: PATCH: anonymous functions, full patch



Bart Schaefer wrote:
> Seems a little odd, though, to call something a function when you can't
> pass any arguments to it.  I'm not going to have time to look today, but
> how difficult is this?
> 
>     function { print $@ } args go here

Shouldn't be too horrific, but will require parsing changes, which is
why I didn't puruse it.

> Two final remarks:  One: should this be considered a bug?
> 
> torch% torch% () ()
> function function> {                 
> function function> print oops
> function function> }
> zsh: parse error near `\n'
> 
> Once you've got the double empty parens there seems to be nowhere to go
> that doesn't end in a parse error.

Doesn't really surprise me.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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