[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] Factor out a common pattern into a procedure.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH 1/1] Factor out a common pattern into a procedure. |
Date: |
Sun, 19 Oct 2014 11:39:09 +0200 |
User-agent: |
Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux) |
John Darrington <address@hidden> skribis:
> On Sat, Oct 18, 2014 at 10:03:42PM -0400, Ian Denhardt wrote:
Thanks, Ian, for working on it!
[...]
> +(define (version-take-api version-string)
> + "Return \"<major>.<minor>\", where major and minor are the major and
> +minor version numbers from version-string."
> + (string-join (take (string-split version-string #\.) 2) "."))
> +
> (define (version>? a b)
> "Return #t when A denotes a newer version than B."
> (eq? '> (version-compare a b)))
>
>
> It seems likely to me, that sometime we'll need the number of fields to be
> parameterised,
> instead of hard coded at 2 (for example lynx has a directory component with
> 3 fields in its URL)
>
> Also I don't understand the significnace of the name version-take-api What
> does API have to
> do with anything?
>
> How about something like (string-take-fields "1.22.3.04.5" 3) which would
> return "1.22.3"
Agreed. What ‘version-prefix’, with the optional argument defaulting
to 2?
> Possibly an optional argument specifying the separator might be useful too.
I think that’d be overkill.
Ludo’.
Re: [PATCH 1/1] Factor out a common pattern into a procedure., Mark H Weaver, 2014/10/19
Re: [PATCH 0/1] *** SUBJECT HERE ***, Ian Denhardt, 2014/10/18