zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-users" <zsh-users@sunsite.dk>
Subject: Re: ranges
Date: Thu, 02 Jun 2005 16:19:58 +0000	[thread overview]
Message-ID: <1050602161959.ZM12711@candle.brasslantern.com> (raw)
In-Reply-To: <200506021557.22069.cht@chello.at>

When discussing {N..M} and {X,Y} in comparison to <N-M> and (X|Y), the
most important thing to keep in mind is:

Brace expansions create new strings.  Patterns select existing strings.

For example, [[ 7 = {1..9} ]] is nonsense, but [[ 7 = <1-9> ]] works.

David's summary goes wrong as soon as "ls" becomes the example command,
because that egregiously translates all the strings into the namespace
of existing files.  Neither braces nor patterns inherently operate on
files. (*)  A better example would have used "print" or "echo".


(*  Some glob qualifiers operate on files, but that's independent of the
pattern part.  The seeming special case of slashes in globbing occurs
not because the patterns are matched differently, but because globbing
interprets a series of patterns separated by slashes, comparing each
pattern in the series to a different set of existing strings, each set
happening to consist of file names.)


      reply	other threads:[~2005-06-02 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-01 15:42 ranges zzapper
2005-06-01 16:28 ` ranges Christian Taylor
2005-06-02  7:02   ` ranges zzapper
2005-06-02 13:57     ` ranges Christian Taylor
2005-06-02 16:19       ` Bart Schaefer [this message]

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=1050602161959.ZM12711@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).