Re: [PATCH] fix/simplify is-at-least

Philippe Altherr <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAGdYchvrb-D9N6J=TzN36SCtFOSc8BexD1x9vEP0zd=Jk5WQXA@mail.gmail.com>
>
> > Removing the leading text in both arguments may be a good compromise to
> remain closer to the current version.
>
> Well, actually I did so in my first draft, but reconsidered that
> the simpler the better.
>
> Do we really need this? (patch against my previous patch: workers/54335).
>

Given that Zsh versions no longer have leading text for a very long time,
probably very few people, if any, would notice any change but dropping any
leading text may have an advantage, see below.


> +# Compatibility with older version:
> +# If a segment is of the form 'text123', remove the leading 'text'.
> * +# Segments like 'text123moretext' are not modified.*
>

I would have left the bolded part out. It leads to an implementation where
segments are always compared using integer sorting. Lexical sorting is only
used for any trailing text. That's easy to understand. Probably slightly
easier than your first version where segments are compared with lexical
sorting if one or both start with a non-digit character.

Philippe
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.