Fork me on GitHub

(ns myns
  (:require [ :only [sh]]))

(sh "ls" "-aul")
CompilerException java.lang.RuntimeException: Unable to resolve symbol: sh in this context Any idea why?


Changing :only to :refer does work but I don't see why :only is not working as described in the docs.


:only works with :use, not :require


@bronsa aha got it, thanks

Ali Ebadian08:11:53

This is great talk, I thought. so I thought some here would find as useful as I did


hello, good people. Is there some good online resource of "clojure cookbooking", like code snippers, examples of everyday tasks performed by idiomatic clojure... Coz one is to know clojure syntax, another thing is to learn actual libraries, and third - know how to bind them togeather... like classical REST api client/server impls, drawing something on screen, making network calls, making data transformations, sound, video and zillion of other nice cool things people do every day


As far as libraries are concerned, is a good one.


I am asking, coz myself not so long ago learned kotlin, and then soon become "expert" (local) on that, and I noticed, that new people try to write kotlin but using their own language idioms (usually Java), and from my point of view, their code look dirty and silly, which means - most likely my beginner clojure looks as silly


@olekss.janis Sounds that you're looking for sth like clojure cookbook:

👍 1

ahh really, and it's free 🙂 Niice downloaded THanks


Let's say I have a thread that starts with one post, and can take comments


I'd like to: store all the comments &


recursively render the parent->(comment->8<-comment)s


in hiccup


so I'm thinking for each comment level I can just create a new [:li ""] element...


I want to store my data not like a comment tree, but by reference. :post_id Xxxx, :parent_id Yyyy, :child_id Zzzz so there's flexibility in how I choose to render them


so my real question...


if I have an atom that looks like (atom { :posts [{:pid 555 :cid 777 :this_id 657} {:p 9 :c 8 :tid 7} {:p 12 :c 16 :d 82} {post 4 ...} { post 5} ...]} how can I functionally render the page component that holds a parent and all its child components?


>>>                                        (demonstration of nested comments,
>>>                                         or happy-lil portrait-orientation trees)


Anyone who’s interested in learning some clojure is welcome to join my stream of Advent of Code! It will be M-F @ 12:00 CST. I’ll be starting a day early with


works great! but how do i print out more intricately nested maps with multiple attributes and collections of children?


Now I want to recursively print something like this... well, make a list for html land..


how to shot web?

Eccentric J17:11:00

(defn webhook-api
  [{:keys [path-params]}]
  (if-let [id (str->int (get path-params :id))]
    (if-let [webhook (db/get-webhook {:id (Integer. id)})]
      {:body webhook}

Eccentric J17:11:06

Is there a better way to write that?


you could make a single function that takes path-params and returns either {:id ...} or nil and have only one if-let

Eccentric J17:11:20

Oooh that’s a great idea. Then I can reuse it in the other routes that require an id.


and in combination with some-> you can only look for the webhook if you have the id, etc