zsh-users
 help / color / mirror / code / Atom feed
From: DervishD <zsh@dervishd.net>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: About zsh-users 8489 (exception handling)
Date: Wed, 28 Sep 2005 01:47:26 +0200	[thread overview]
Message-ID: <20050927234726.GC988@DervishD> (raw)

    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...


             reply	other threads:[~2005-09-27 23:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-27 23:47 DervishD [this message]
2005-09-28  2:42 ` Bart Schaefer
2005-09-28  8:43   ` DervishD
2005-09-28 15:18     ` Bart Schaefer
2005-09-29 10:31       ` DervishD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050927234726.GC988@DervishD \
    --to=zsh@dervishd.net \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).