zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org (Zsh hackers list)
Subject: Re: PATCH: bash-style substrings & subarrays
Date: Sat, 20 Nov 2010 22:34:01 -0800	[thread overview]
Message-ID: <101120223401.ZM6950@torch.brasslantern.com> (raw)
In-Reply-To: <20101120211528.0caf8697@pws-pc.ntlworld.com>

On Nov 20,  9:15pm, Peter Stephenson wrote:
} Subject: Re: PATCH: bash-style substrings & subarrays
}
} On Fri, 19 Nov 2010 10:01:45 -0800
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > On Nov 17,  4:54pm, Peter Stephenson wrote:
} > }
} > } This implements the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH} syntax.
} > 
} > I'm wondering whether :OFFSET:LENGTH shouldn't always use KSH_ARRAYS
} > semantics, or be a valid syntax only when KSH_ARRAYS is set?
} 
} I can see that if you interpret the word "OFFSET" literally it's
} different from a subscript and you might interpret it as starting
} from 0 in any case. I still think on balance consistency with normal
} subscripting is preferable.

I agree that consistency wth normal subscripting is preferable, but
subscripting behaves like a pair of offsets only when KSH_ARRAYS is
set (hence the second alternative I suggested).

However, I'm mostly indifferent.

} I don't think half-measures compatibility with other shells is
} particularly useful, in the end is probably more confusing when you
} find some things work the way you expect and some things don't.

I'm confused about how that relates to the foregoing, sorry ...?

Thanks for the additional patch.


  reply	other threads:[~2010-11-21  6:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 16:54 Peter Stephenson
2010-11-18 12:44 ` Peter Stephenson
2010-11-19 18:01 ` Bart Schaefer
2010-11-20 21:15   ` Peter Stephenson
2010-11-21  6:34     ` Bart Schaefer [this message]
2010-11-21 17:02       ` Peter Stephenson
2010-11-21 20:11         ` Bart Schaefer
2010-11-21 20:51           ` Greg Klanderman
2010-11-23 11:14         ` Peter Stephenson
2010-11-25 10:35           ` Peter Stephenson

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=101120223401.ZM6950@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@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).