Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Numeric version of ZSH_VERSION?
- X-seq: zsh-workers 25577
- From: "Rocky Bernstein" <rocky.bernstein@xxxxxxxxx>
- To: "Richard Hartmann" <richih.mailinglist@xxxxxxxxx>
- Subject: Re: Numeric version of ZSH_VERSION?
- Date: Mon, 1 Sep 2008 09:06:31 -0400
- Cc: "Dan Nelson" <dnelson@xxxxxxxxxxxxxxx>, "Zsh hackers list" <zsh-workers@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=hBjem9c9FxBiQK7x9GVjXYd+cL3MDgnkfvwcj0Eu1oE=; b=WNU9ljzVjDA/LcndyKFtOS44dcLoOI3JtTQaRUmDg8J2x/vH+YgQvphqNqiCUQl5si mJVyu6wUjD+rFr7pgH6qY5kIPcP64Vgw4fWK21sv7yCxCAU5UMq1QiP+uUEuQePU/WSR AecBarJXaWSKD2oVo2MIyRXFztM4imh/P+IBs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=PPG8FFanDZvdKTODvqf5vTAZ1h6UrU5+QK041i67hq7OAqHFmrRpEsysjByDEGTZ9f UMeRMj0GdvKz96rHrDEhodxusGSvT87q6d2NuXZsJVsMLuCLr+NHJ6HTKDou/IA6pcXB im33koRhOrh1fV4ZIyAfe2nj4vmuZT8i4jh5c=
- In-reply-to: <2d460de70809010538xfac8eceqc37a177c0481869c@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210808301954x6fd72987i4bb0ea3665951de1@xxxxxxxxxxxxxx> <20080831031632.GI26653@xxxxxxxxxxxxxxxx> <2d460de70809010538xfac8eceqc37a177c0481869c@xxxxxxxxxxxxxx>
Yeah, I thought of that too. One can use ! is-at-least and booleans
for ranges. Or one can add as you say all of this into the is-at-least
package.
This kind of awkwardness would be more glaring in languages that
support numeric ranges (e.g. Perl, Python, Ruby).
My personal view is that is-at-least is a more complicated solution
to a problem which is more easily and naturally solved by adding a
numeric variable which just keeps increasing, e.g. 08100101 which
might be the first change of Sept 1, '08. (I just tried
using 08100101 in an arithmetic expression and the number seems not to
be too large.)
ksh recently added such a thing to .sh.version, so that in a string
context it prints a string while in a numeric context it prints a
number:
$ echo ${.sh.version}
Version M 93t 2008-08-25
$ printf "%d\n" .sh.version
20080825
(From which I gather David Korn and Glenn Fowler don't plan on more
than one release a day.)
On Mon, Sep 1, 2008 at 8:38 AM, Richard Hartmann
<richih.mailinglist@xxxxxxxxx> wrote:
> On Sun, Aug 31, 2008 at 05:16, Dan Nelson <dnelson@xxxxxxxxxxxxxxx> wrote:
>
>> The Misc/is-at-least function should do what you need:
>
> It lacks a is-at-max sibling _if_ you need to actually check on ranges.
> Why not just use revision numbers for this (unless ZSH falls into the
> git trap, at some point :p)?
>
>
> Richard
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author