From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: CHR$(foo) => ${(#)foo}
Date: Tue, 01 Nov 2005 17:20:51 +0000 [thread overview]
Message-ID: <1051101172051.ZM19894@candle.brasslantern.com> (raw)
In-Reply-To: <200511011434.jA1EYf5B020570@news01.csr.com>
On Nov 1, 2:34pm, Peter Stephenson wrote:
}
} There are lots of ways of turning a number into a character, but few the
} other way round
Don't you mean "lots of ways of turning a character into a number"? What
you added is a way to turn a number into a character.
} This adds the (#) expansion flag to do that.
So we now have
${#x} Number of characters in x
$((#x)) Number of the first character in x
${(#)x} Character of the number in x
and the oddball
$((##x)) Number of the character 'x'
I suppose that means that
${(#)#x} Number of characters in the
character of the number in x (i.e., 1)
$((##${(#)${#x}})) Number of the character of
the number of characters in x
There doesn't seem to be a way to get the number of characters in the
number of the character of the number in x. Hmm.
next prev parent reply other threads:[~2005-11-01 17:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-01 14:34 Peter Stephenson
2005-11-01 14:53 ` Peter Stephenson
2005-11-01 17:20 ` Bart Schaefer [this message]
2005-11-01 17:46 ` Peter Stephenson
2005-11-01 18:17 ` Bart Schaefer
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=1051101172051.ZM19894@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@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).