Fork me on GitHub
#clojure-europe
<
2020-07-10
>
synthomat06:07:54

also: good morning!

genRaiy07:07:37

Don't know how to create ISeq from morning

otfrom08:07:29

nor do I little compiler. Nor do I

🤓 3
ordnungswidrig08:07:53

goood morniiiiiiiing

ordnungswidrig08:07:15

TIL https://excalidraw.com/ and I like it! “Sloppiness: cartoonist”

Ben Hammond08:07:50

(repeat (* 365 75) 'good-morning) ?

ordnungswidrig08:07:18

Leap years. sigh

Ben Hammond08:07:59

I just implicitly deducted those from expected lifespan Who's gonna know

ordnungswidrig08:07:29

75 is not thaaat optimistic.

ordnungswidrig08:07:41

Or do you plan to leave this channel when you’re going to retire?

Ben Hammond08:07:54

isn't it? I thought that was WAY optimistic

Ben Hammond08:07:04

I think pestilence-confiment may be messing with my outlook

Ben Hammond08:07:38

(not to mention That Brexit)

plexus08:07:44

No that seems about right, for people born in Belgium in 1983 (like me) the life expectancy is 73.8. I do plan to beat those odds. For kids born now it's 80+

plexus08:07:49

good morning!

ordnungswidrig09:07:08

@plexus everybody consideres himself above average 😛

ordnungswidrig09:07:02

Today I used babashka to create a Makefile based on output of a lein plugin. I need a shower now.

plexus09:07:25

How do we feel about something like this?

(defn ->s+t
  {:examples '[(->s+t "VSBPLATDTA" "PLPLAP") => :VSBPLATDTA.PLPLAP]}
  [schema table]
  (keyword (str (name schema) "." (name table))))

(defn split-segments
  {:examples '[(split-segments :VSBPLATDTA.PLPLAP) => ["VSBPLATDTA" "PLPLAP"]]}
  [kw-or-str]
  (str/split (name kw-or-str) #"\."))

😎 3
plexus09:07:04

tempted to just implement this in Kaocha and call it a thing now. Maybe we can even get cljdoc to pick it up.

plexus09:07:39

I've long considered implementing my own version of doctests (as in elixir, python, ...), but sticking code into strings in a homoiconic language seems wrong. The only benefit of the doctest approach is that it automatically shows up in docs.

borkdude10:07:49

That’s just the regular defn with metadata applied right?

borkdude10:07:54

Maybe :examples can be just a regular hashmap or a vector of tuples if order is important (which probably isn’t), which makes it trivial to parse and hook up to tests.

plexus10:07:44

yeah that's just regular metadata. Not sure parsing would be an issue, this is trivial to parse too

❤️ 3
borkdude10:07:53

What about examples that need apply with e.g. (range) or throw exceptions? My feeling is that you will be back to :test metadata for these cases and at least it’s supported by vanilla Clojure.test as well (forgive me my not using formatting and random capital letters, I’m on a mobile phone)

plexus11:07:40

You can put whatever form you like in there. Test metadata is near to useless in my opinion because it doesn't fail in a way that is actionable, you just get an assertion error. Unless you drag in Clojure.test in all your namespace so you can define proper assertions.

arnaud_bos15:07:23

Hey folks, @plexus's last sentence made me think. Would you care to comment on the following ClojureVerse topic? https://clojureverse.org/t/another-topic-on-inline-unit-tests-in-clojure/6209