From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Idiom for booleans
Date: Fri, 12 Aug 2011 20:09:42 -0700 [thread overview]
Message-ID: <110812200942.ZM8287@torch.brasslantern.com> (raw)
In-Reply-To: <CAELbujo=KyJyzzo1vW+ydLVA=PddguguXkBr7yN3zvmOgmYFpQ@mail.gmail.com>
On Aug 12, 5:24pm, Micah Elliott wrote:
}
} % (( 0 ))
} ((: command not found
} % (( 1 )) # ok
This has to be something in your configuration. Try it with zsh -f ?
torch% (( 0 ))
torch% ((
math> ))
torch% (( 0 )) || echo nope
nope
torch%
This one I'm not sure is intentional:
torch% (( )) || echo oops
oops
torch%
} I'm trying to figure out if the $+ expansion, as in ${+param}, is
} worth making use of. What idiom do you use for it? I could see it as a
} boolean for testing flags.
Yes, that's a common usage.
next prev parent reply other threads:[~2011-08-13 3:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-13 0:24 Micah Elliott
2011-08-13 3:09 ` Bart Schaefer [this message]
2011-08-13 5:26 ` Micah Elliott
2011-08-15 1:11 ` Bart Schaefer
2011-08-15 8:28 ` Julien Nicoulaud
[not found] ` <CAELbujqBkE_zUG9M2+DS4mv=TxxKT=Rq4vH2fhXsbJ235B4nAA__26422.7002081045$1313213450$gmane$org@mail.gmail.com>
2011-08-13 10:37 ` Štěpán Němec
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=110812200942.ZM8287@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/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).