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

About zsh-users 8489 (exception handling)



    Hi all :)

    In zsh-users 8489 Bart Schaeffer proposes using this syntax:

    { ${:?THROW} } 2>/dev/null

    instead of this one:

    { ${*ERROR*} } 2>/dev/null

    for generating the exception in "throw" function, since the
latter may become valid syntax in the future.

    Unfortunately, that doesn't work because ${:?...} *exits* from
the shell, so the valid syntax would be:

    ( ${:?THROW} ) 2>/dev/null

    For me, using a subshell just to generate the exception seems a
bit excessive. Is there any other way of generating an error (the
exception) without using a subshell and without using current invalid
syntax that could become valid in the future?

    Thanks a lot :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



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