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

Parsing of "anonymous" functions



I just noticed this:

torch% ()()()()()()()()
function function function function function function function function> 

Did we really mean for this to be possible or should the parser be pickier
about requiring an "ordinary" command structure as the first thing after
the empty parens?

The same doesn't quite work with the "function" keyword:

torch% function function function function function
function function function> print $funcstack
torch% functions
function () {
        function () {
                () {
                        print $funcstack
                }
        }
}

(However, you can't easily execute the function named "function" as the
keyword always takes precedence.)

Anyway, just an oddity it seemed interesting to point out.



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