Weighted

is one entry of a weighted, comma-separated header list such as Accept, Accept-Encoding or Accept-Language: a lower-cased value — the media range, content coding or language range — and its quality q between 0.0 and 1.0.

copy

instantiate

(Fn [(Ref Weighted a)] Weighted)

copies a Weighted.

delete

instantiate

(Fn [Weighted] ())

deletes a Weighted. Should usually not be called manually.

init

instantiate

(Fn [String, Double] Weighted)

creates a Weighted.

parse-list

defn

(Fn [(Ref String a)] (Array Weighted))

                        (parse-list s)
                    

parses a weighted, comma-separated header list into its entries, in header order. Each entry's value is the lower-cased text before its first ;, and its q is the ;q= parameter, clamped to [0.0, 1.0] and defaulting to 1.0. Entries with an empty value are skipped.

prn

instantiate

(Fn [(Ref Weighted a)] String)

converts a Weighted to a string.

q

instantiate

(Fn [(Ref Weighted a)] (Ref Double a))

gets the q property of a Weighted.

set-q

instantiate

(Fn [Weighted, Double] Weighted)

sets the q property of a Weighted.

set-q!

instantiate

(Fn [(Ref Weighted a), Double] ())

sets the q property of a Weighted in place.

set-value

instantiate

(Fn [Weighted, String] Weighted)

sets the value property of a Weighted.

set-value!

instantiate

(Fn [(Ref Weighted a), String] ())

sets the value property of a Weighted in place.

str

instantiate

(Fn [(Ref Weighted a)] String)

converts a Weighted to a string.

update-q

instantiate

(Fn [Weighted, (Ref (Fn [Double] Double a) b)] Weighted)

updates the q property of a Weighted using a function f.

update-value

instantiate

(Fn [Weighted, (Ref (Fn [String] String a) b)] Weighted)

updates the value property of a Weighted using a function f.

value

instantiate

(Fn [(Ref Weighted a)] (Ref String a))

gets the value property of a Weighted.