Utilties for defining vertically partitioned Pail structures.
Utilties for defining vertically partitioned Pail structures.
(make-partition* partitioner object)
Calls the underlying protocol implementation. This can be used as a mocking point to unit test
implementations of make-partition
that compose other partitioners.
Calls the underlying protocol implementation. This can be used as a mocking point to unit test implementations of `make-partition` that compose other partitioners.
(null-partitioner)
Returns a NullPartitioner.
Returns a NullPartitioner.
(valid-partition? partitioner dirs)
Validates whether the directories specify a valid vertical partition.
Validates whether the directories specify a valid vertical partition.
(validate* partitioner dirs)
Calls the underlying protocol implementation. This can be used as a mocking point to unit test
implementations of validate
that compose other partitioners.
Calls the underlying protocol implementation. This can be used as a mocking point to unit test implementations of `validate` that compose other partitioners.
(vertical-partition partitioner object)
Returns the vertical partitions for an object as a list of strings.
Returns the vertical partitions for an object as a list of strings.
A protocol for vertically partitioning a PailStructure. Partitioners can be composed to build complex vertical partitioning schemes out of individual partitioners.
A protocol for vertically partitioning a PailStructure. Partitioners can be composed to build complex vertical partitioning schemes out of individual partitioners.
(make-partition this object)
Determines the vertical partition for an object. make-partition
should return a list of objects
specifying the partition. It is not make-partition
's responsibility to convert the objects to
strings. Their toString
method will be called to form a valid vertical partition.
Determines the vertical partition for an object. `make-partition` should return a list of objects specifying the partition. It is not `make-partition`'s responsibility to convert the objects to strings. Their `toString` method will be called to form a valid vertical partition.
(validate this dirs)
Validates whether the directories form a valid vertical partition. validate
should consume as
many items from dirs
as it needs in order to validate its partitioning scheme. It should
return a boolean indicating whether its partition is valid and the rest of dirs
that were not
used for validation. The remaining dirs
can be checked by a higher-level partitioner that will
know what partitioning scheme comes next.
For example, to validate that a partition is one of "foo" or "bar", a partitioner would
check the first item in dirs
and return the tail:
(validate [this dirs]
[(#{"foo" "bar"} (first dirs)) ; validate first directory is "foo" or "bar"
(rest dirs)]) ; return remaining directories
Validates whether the directories form a valid vertical partition. `validate` should consume as many items from `dirs` as it needs in order to validate its partitioning scheme. It should return a boolean indicating whether its partition is valid and the rest of `dirs` that were not used for validation. The remaining `dirs` can be checked by a higher-level partitioner that will know what partitioning scheme comes next. For example, to validate that a partition is one of "foo" or "bar", a partitioner would check the first item in `dirs` and return the tail: (validate [this dirs] [(#{"foo" "bar"} (first dirs)) ; validate first directory is "foo" or "bar" (rest dirs)]) ; return remaining directories
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close