joker

Discuss all things joker, the Clojure interpreter/linter on top of Go. https://github.com/candid82/joker
gleisonsilva 2020-01-11T14:15:30.000900Z

Hello! Someone knows how to get the current time from OS using Joker?

gleisonsilva 2020-01-11T14:16:15.001500Z

(i mean... without calling a shell or another executable in OS...)

jcburley 2020-01-11T14:36:41.002200Z

See the joker.time namespace.

gleisonsilva 2020-01-11T14:38:35.003400Z

I've seen, but I couldn't figure out. When I call joker.time/now I get back a #object[Proc] that I couldn't use in any place...

gleisonsilva 2020-01-11T14:38:55.003900Z

I've tried call string, parse, etc on it, but uncessfully

jcburley 2020-01-11T14:47:52.004900Z

A Proc is just an internally compiled Fn. I.e. you call it.

gleisonsilva 2020-01-11T14:53:32.005200Z

wow

gleisonsilva 2020-01-11T14:53:34.005400Z

my bad

gleisonsilva 2020-01-11T14:53:38.005600Z

thank u

👍 1
jcburley 2020-01-11T15:00:16.006500Z

And it doesn't return just a String, but a Time object that you can further manipulate:

user=> (type (joker.time/now))
Time
user=> (joker.time/now)
2020-01-11 09:54:15.601988473 -0500 EST m=+9.694898411
user=> (let [cur (now)] (sleep (* second 3)) (println (sub (now) cur)))
3000091841
nil
user=> 

jcburley 2020-01-11T15:01:04.007200Z

(Forgot to show the (use 'joker.time) in there before the (let ....)

Candid 2020-01-11T22:31:07.007700Z

Joker v0.14.1 has been released: https://github.com/candid82/joker/releases/tag/v0.14.1

👍 5