Liking cljdoc? Tell your friends :D

cli-matic.platform

clj

Platform-specific functions for the JVM.

If running on ClojureScript, we can have a different file for JS.

BTW, in this NS, we avoid using Spec / Orchestra.

DO NOT define macros in this namespace - see cli-matic.platform-macros

## Platform-specific functions for the JVM.

If running on ClojureScript, we can have a different file for JS.

BTW, in this NS, we avoid using Spec / Orchestra.

**DO NOT** define macros in this namespace - see [[cli-matic.platform-macros]]

cljs

Platform-specific functions for ClojureScript.

At the moment, we only support Planck.

BTW, in this NS, we avoid using Spec / Orchestra.

## Platform-specific functions for ClojureScript.

At the moment, we only support Planck.

BTW, in this NS, we avoid using Spec / Orchestra.

raw docstring

add-shutdown-hookclj/s≠

(add-shutdown-hook fnToCallOnShutdown)
clj

Add a shutdown hook. If nil, simply ignores it.

The shutdown hook is run in a new thread.

Add a shutdown hook. If `nil`, simply ignores it.

The shutdown hook is run in a new thread.

cljs

Add a shutdown hook.

Does not work (?) on CLJS and we will throw an exception.

It might be conceivable that in JS-land, we save this locally in this namespace and then call it on exit-script.

Add a shutdown hook.

Does not work (?) on CLJS and we will throw an exception.

It might be conceivable that in JS-land, we save this locally in this namespace
and then call it on `exit-script`.

source (clj)source (cljs)raw docstring

asDateclj/s

(asDate s)

Converts a string in format yyyy-mm-dd to a Date object; if conversion fails, returns nil.

Converts a string in format yyyy-mm-dd to a
Date object; if conversion
fails, returns nil.
source (clj)source (cljs)raw docstring

exit-scriptclj/s≠

(exit-script retval)
clj

Terminates execution with a return value.

Terminates execution with a return value.
cljs

Terminates execution with a return value.

Please note that in Planck, return codes seem to be 8-bit unsigned ints.

Terminates execution with a return value.

Please note that in Planck, return codes seem to be 8-bit unsigned ints.
source (clj)source (cljs)raw docstring

isDeferredValue?clj/s≠

clj
(isDeferredValue? v)
cljs
(isDeferredValue? _)

Is this a deferred value for this platform?

Is this a deferred value for this platform?
source (clj)source (cljs)raw docstring

parseEdnclj/s≠

(parseEdn edn-in)
clj

Decodes EDN through clojure.edn.

 Decodes EDN through clojure.edn.      
cljs

This is actually a piece of ClojureScript, though it lives in a different NS.

See https://cljs.github.io/api/cljs.reader/read-string

This is actually a piece of ClojureScript, though it lives in a different NS.

See https://cljs.github.io/api/cljs.reader/read-string
source (clj)source (cljs)raw docstring

parseFloatclj/s

(parseFloat s)

Converts a string to a float.

Converts a string to a float.
source (clj)source (cljs)raw docstring

parseIntclj/s

(parseInt s)

Converts a string to an integer.

Converts a string to an integer. 
source (clj)source (cljs)raw docstring

printErrorclj/s≠

(printError o)
clj

On ClojureScript, STDERR is not err but it's platform dependent. On JVM, standard approach.

On ClojureScript, STDERR is not *err* but it's platform dependent.
On JVM, standard approach.
cljs

On ClojureScript, STDERR is not err but it's platform dependent.

Thanks @mfikes for the tip! (issue #111)

On ClojureScript, STDERR is not *err* but it's platform dependent.

Thanks @mfikes for the tip!  (issue #111)
source (clj)source (cljs)raw docstring

read-envclj/s

(read-env var)

Reads an environment variable. If undefined, returns nil.

Reads an environment variable.
If undefined, returns nil.
source (clj)source (cljs)raw docstring

slurp-fileclj/s≠

(slurp-file f)
clj

No slurping in JavaScript. So we have to move this to platform.

No slurping in JavaScript. So we have to move this to
platform.
cljs

Luckily, Planck implements slurp for us.

No slurping in Node-land.

See https://github.com/pkpkpk/cljs-node-io

Luckily, Planck implements slurp for us.

No slurping in Node-land.

See https://github.com/pkpkpk/cljs-node-io

source (clj)source (cljs)raw docstring

waitForDeferredValueclj/s≠

clj
(waitForDeferredValue v)

Given that value is a deferred value for this platform, block termination until it's realized.

On the JVM, we support:

  • promises
  • futures
  • core.async channels (if they exist)
Given that value is a deferred  value for this platform,
block termination until it's realized.

On the JVM, we support:

- promises
- futures
- core.async channels (if they exist)

cljs
(waitForDeferredValue x)

Given that value is a deferred value for this platform, block termination until it's realized.

On JS, we support:

  • nothing yet...
Given that value is a deferred  value for this platform,
block termination until it's realized.

On JS, we support:

- nothing yet...

source (clj)source (cljs)raw docstring

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

× close