The plists Module#
Property lists associate values with keys, but without the overhead of a
<table>. These are generally useful for a small number of keys or
where memory usage is a concern.
In memory, the plist is arranged with keys and values alternating in a single sequence:
#[key1:, 1, key2:, 2]
Conveniently, this is the same layout as a sequence of arguments when
#rest in conjuction with keyword arguments and
as can be seen in the example using
- get-property Generic function#
Return the value for an indicator, with a default should it not exist.
- keyword-sequence Generic function#
Returns a sequence containing the indicators in the plist.
- put-property! Statement Macro#
Modify the plist, adding indicator with the given value.
- remove-keywords Generic function#
Returns a copy of the plist with keywords removed.
- remove-property! Statement Macro#
Modify the plist, removing indicator, returning the old value, if any.
- value-sequence Generic function#
Returns a sequence containing the values in the plist.
- with-keywords-removed Statement Macro#
- Macro Call:
with-keywords-removed(var = plist, keywords) body end
Executes the body, with the keywords removed from plist and the modified plist available as var.
define sealed method make (class == <interval-stream>, #rest initargs, #key buffer, interval, direction, #all-keys) => (stream :: <interval-stream>) ignore(direction); let (start-bp, end-bp) = values(interval-start-bp(buffer | interval), interval-end-bp(buffer | interval)); let buffer = buffer | select (interval by instance?) <buffer> => interval; otherwise => bp-buffer(start-bp); end; with-keywords-removed (initargs = initargs, #[interval:]) apply(next-method, class, start-bp: start-bp, end-bp: end-bp, buffer: buffer, initargs) end end method make;
- See also: