Liking cljdoc? Tell your friends :D
Clojure only.

finagle-clojure.options

Functions for working with scala.Option objects.

Functions for working with `scala.Option` objects.
raw docstring

empty?clj

(empty? o)

Does Option o have a value? Returns true if so, false otherwise.

Arguments:

  • o: an Option

Returns:

true if v is None, false otherwise

Does Option `o` have a value? Returns true if so, false otherwise.

*Arguments*:

  * `o`: an Option

*Returns*:

  true if `v` is None, false otherwise
sourceraw docstring

getclj

(get o)

Returns the value wrapped by o. Although the Scala implementation throws a Predef.NoSuchElementException if called on an empty Option, Clojure generally avoids throwing on empty gets, instead preferring to return nil. This function adopts the Clojure behavior, choosing to treat this effectively as a call to getOrNull.

Arguments:

  • o: an Option

Returns:

the Option's value if non-empty, nil otherwise

Returns the value wrapped by `o`.
Although the Scala implementation throws a `Predef.NoSuchElementException` if called
on an empty Option, Clojure generally avoids throwing on empty gets, instead preferring to return nil.
This function adopts the Clojure behavior, choosing to treat this effectively as a call to `getOrNull`.

*Arguments*:

  * `o`: an Option

*Returns*:

  the Option's value if non-empty, nil otherwise
sourceraw docstring

optionclj

(option)
(option v)

Returns an Option with the given value v.

Arguments:

  • v: the value that the new Option should be defined with.

Returns:

Some(v) if v is present and non-null, None otherwise

Returns an Option with the given value `v`.

*Arguments*:

  * `v`: the value that the new Option should be defined with.

*Returns*:

  `Some(v)` if `v` is present and non-null, `None` otherwise
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close