|(require xiden/query)||package: xiden|
With no omissions, a query follows this form:
<provider> is, as expected, the name of the package’s provider. This may or may not be the author of the package. A domain name for a provider name is not required, but using one is helpful if your package appears across multiple services.
<package> is the name of the package.
Finally, <interval-bounds> can be "ee", "ie", "ei", or "ii". These characters control if <revision-min> or <revision-max> are interpreted as inclusive or exclusive interval boundaries. The first character controls <revision-min>. The second character controls <revision-max>. If the character is "i", then the boundary is inclusive of the defined revision. If "e", exclusive.
To omit a field, use consecutive colons, or leave fields off the end of the string. An omitted field is set to the empty string.
e.g. "example.com:htdp::8::ie", or "example.com:htdp".
When a field is set to the empty string, a fallback value may be used instead. This section does not define a standard for default values because those details are catalog-specific.
The empty string is equivalent to using only default values.
A parsed package query is an instance of parsed-package-query.
A well-formed package query is a parsed package query that uses strings for all fields.
Assume that a query Q is bound to a well-formed package query with no omissions. In that case you can construct an instance of parsed-package-query using (apply parsed-package-query (string-split Q ":")).
In the general case where fields may be omitted, any missing fields should be set to the empty string like so:
(define (parse-package-query s) (define user-defined (string-split s ":")) (define num-fields (length user-defined)) (apply parsed-package-query (build-list (procedure-arity parsed-package-query) (λ (i) (if (< i num-fields) (list-ref user-defined i) "")))))
variant : package-query-variant?
(make-exact-package-query provider name revision-number) → exact-package-query? provider : string? name : string? revision-number : revision-number?
(resolve-revision-interval query make-revision-number #:default-bounds default-bounds)
revision-number? revision-number? query : parsed-package-query? make-revision-number : (-> boolean? string? (or/c #f revision-number?)) default-bounds : "ii"
make-revision-number accepts two arguments.
If the first argument is #f, then the second argument is the same value bound to (parsed-package-query-revision-min query).
If the first argument is #t, then the second argument is the same value bound to (parsed-package-query-revision-max query).