Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Numeric version of ZSH_VERSION?



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