From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: string range between 1 and 0.
Date: 19 Jul 1999 10:01:29 +0900 [thread overview]
Message-ID: <rsqbtd9v4eu.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: "Bart Schaefer"'s message of "Mon, 19 Jul 1999 00:02:59 +0000"
In article <990719000259.ZM8741@candle.brasslantern.com>,
"Bart Schaefer" <schaefer@candle.brasslantern.com> writes:
> This is a side-effect of ksh array compatibility, believe it or not.
Hm.
> So, given the choices
> (1) leave it as is
> (2) treat [n,0] as [n,-1]
> (3) treat [n,0] as an error
> my own preference is for (1).
I encount this problem with the code such as:
region="$buffer[pos1,pos2]"
I represent a region by pos1 and pos2.
To represent null region, I assign pos2 to pos1 - 1.
I think it's natural, but it's not works when pos1 is 1.
So, my preference is "treat [n,0] as null string if 0 < n".
However, it is no ploblem with the code such as:
local tmp=" $buffer"
region="$tmp[pos1 + 1, pos2 + 1]"
But, I think it's ugly.
Is there exists a more smart code?
# For example, is it representable with only variable expansion?
--
Tanaka Akira
next prev parent reply other threads:[~1999-07-19 1:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-18 4:14 Tanaka Akira
1999-07-19 0:02 ` Bart Schaefer
1999-07-19 1:01 ` Tanaka Akira [this message]
1999-07-19 5:04 ` Bart Schaefer
1999-07-19 19:10 ` Wayne Davison
1999-07-20 5:59 ` Tanaka Akira
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=rsqbtd9v4eu.fsf@crane.jaist.ac.jp \
--to=akr@jaist.ac.jp \
--cc=zsh-workers@sunsite.auc.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).