Utils for parsing string values. Provides a thin Clojure wrapper around java native parsing functions such as java.lang.Float/parseFloat. Unlike the original java functions, these native-Clojure functions can be used as higher-order functions in maps, function arguments, etc. Each function also provides an optional default-value which will be returned if there is an exception during parsing.
Utils for parsing string values. Provides a thin Clojure wrapper around java native parsing functions such as java.lang.Float/parseFloat. Unlike the original java functions, these native-Clojure functions can be used as higher-order functions in maps, function arguments, etc. Each function also provides an optional default-value which will be returned if there is an exception during parsing.
(edn-parsible data)
Traverses a data structure to ensure it can be serialized with pr-str
and read via
clojure.tools.reader.edn/read-string. All non-parsible content is replaced
with ::non-parsible-object
.
Traverses a data structure to ensure it can be serialized with `pr-str` and read via clojure.tools.reader.edn/read-string. All non-parsible content is replaced with `::non-parsible-object`.
(parse-byte str-val & opts)
(parse-byte str-val )
(parse-byte str-val :default default-val )
A thin wrapper around java.lang.Byte/parseByte. Parses the string str-val into a byte. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-byte str-val ) (parse-byte str-val :default default-val ) A thin wrapper around java.lang.Byte/parseByte. Parses the string str-val into a byte. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-decimal str-val)
(parse-decimal opts str-val)
Inputs: ([str-val :- s/Str] [opts :- tsk/KeyMap str-val :- s/Str])
A thin wrapper around java.math/BigDecimal(String value). Parses the string str-val into a BigDecimal. An optional default value may be specified in the opts map; is present, it will be returned in the event of an exception.
Inputs: ([str-val :- s/Str] [opts :- tsk/KeyMap str-val :- s/Str]) A thin wrapper around java.math/BigDecimal(String value). Parses the string str-val into a BigDecimal. An optional default value may be specified in the opts map; is present, it will be returned in the event of an exception.
(parse-double str-val & opts)
(parse-double str-val
(parse-double str-val :default default-val )
A thin wrapper around java.lang.Double/parseDouble. Parses the string str-val into a double. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-double str-val (parse-double str-val :default default-val ) A thin wrapper around java.lang.Double/parseDouble. Parses the string str-val into a double. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-float str-val & opts)
(parse-float str-val
(parse-float str-val :default default-val )
A thin wrapper around java.lang.Float/parseFloat. Parses the string str-val into a float. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-float str-val (parse-float str-val :default default-val ) A thin wrapper around java.lang.Float/parseFloat. Parses the string str-val into a float. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-float G__136102)
(parse-float G__136106 G__136107)
Inputs: ([str-val :- s/Str] [str-val default-val]) Returns: s/Num
(parse-float str-val)
(parse-float str-val :default default-val )
A thin wrapper around js/parseFloat. Parses the string str-val into a float.
If the optional default-val is specified, it will be returned in the event of an
NaN.
Inputs: ([str-val :- s/Str] [str-val default-val]) Returns: s/Num (parse-float str-val) (parse-float str-val :default default-val ) A thin wrapper around js/parseFloat. Parses the string str-val into a float. If the optional default-val is specified, it will be returned in the event of an NaN.
(parse-int str-val & opts)
(parse-int str-val)
(parse-int str-val :default default-val )
A thin wrapper around java.lang.Integer/parseInt Parses the string str-val into a integer. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-int str-val) (parse-int str-val :default default-val ) A thin wrapper around java.lang.Integer/parseInt Parses the string str-val into a integer. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-int G__136089)
(parse-int G__136093 G__136094)
Inputs: ([str-val :- s/Str] [str-val default-val]) Returns: s/Int
(parse-int str-val)
(parse-int str-val :default default-val )
A thin wrapper around js/parseInt Parses the string str-val into a integer.
If the optional default-val is specified, it will be returned in the event of an
Nan.
Inputs: ([str-val :- s/Str] [str-val default-val]) Returns: s/Int (parse-int str-val) (parse-int str-val :default default-val ) A thin wrapper around js/parseInt Parses the string str-val into a integer. If the optional default-val is specified, it will be returned in the event of an Nan.
(parse-long str-val & opts)
(parse-long str-val)
(parse-long str-val :default default-val )
A thin wrapper around java.lang.Long/parseLong. Parses the string str-val into a long. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-long str-val) (parse-long str-val :default default-val ) A thin wrapper around java.lang.Long/parseLong. Parses the string str-val into a long. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-short str-val & opts)
(parse-short str-val)
(parse-short str-val :default default-val )
A thin wrapper around java.lang.Short/parseShort. Parses the string str-val into a short. If the optional default-val is specified, it will be returned in the event of an exception.
(parse-short str-val) (parse-short str-val :default default-val ) A thin wrapper around java.lang.Short/parseShort. Parses the string str-val into a short. If the optional default-val is specified, it will be returned in the event of an exception.
Nominal regex for signed/unsigned floating-point numbers (possibly in scientific notation)
Nominal regex for signed/unsigned floating-point numbers (possibly in scientific notation)
Nominal regex for signed/unsigned integers
Nominal regex for signed/unsigned integers
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close