Fork me on GitHub
#beginners
<
2016-11-07
>
thedavidmeister06:11:31

if i have something in cljs like (defn foo …) and (defn bar [f] (f)) and I call (bar ‘foo)

thedavidmeister06:11:36

how do i actually make that work?

rauh07:11:53

@thedavidmeister Just pass in foo instead of 'foo, your symbols will get renamed anyways when doing advanced compilation with Closure Compiler

thedavidmeister07:11:28

@rauh but i also want to do something with 'foo

thedavidmeister07:11:41

and this is for testing, so it’s not using advanced compilation

thedavidmeister07:11:14

basically, if i have foo/bar i want to be able to have my function print "foo/bar" and also return (foo/bar)

rauh07:11:40

@thedavidmeister Then you want a macro that emits such code

thedavidmeister07:11:04

what would that look like?

rauh07:11:10

I'd still be called without quoting though: (your-macro foo)

gregnwosu11:11:21

i want to use

and
to check all values in a list a truthy, how do i do this?

sveri11:11:26

My first try would be (reduce and true l)

sveri11:11:11

@gregnwosu NP, Most probably there are more ways to do that, maybe even more idiomatic ones

gregnwosu11:11:17

well if i could uncurry the list into arguments i could just apply and

madstap13:11:45

@gregnwosu You can use every?, (every? identity [1 2 3])

dimovich13:11:14

hello friends!

dimovich13:11:45

when using sth like enlive for server side templating, what is a good CMS that goes well with it, for adding new info / data?

gregnwosu14:11:56

madstap thanks

dominicm15:11:00

@dimovich What kind of thing would you use in another language? I'm not sure I really understand the question.

rgm17:11:28

@dimovich are you talking about something like the Django auto admin interface or Administrate in Rails?

kauko18:11:51

@sveri doesn't work since and is a macro. Like madstap said, every? is probably what should be used here.

keatondunsford20:11:18

Do I need different project.clj files for my frontend and backend build processes? (Say in an Om-Next React Native app via Re-Natal) (kinda new to setting up my first big Clojure/ClojureScript project) Or am I able to separate those out somehow with different Lein builds via maps?

sveri20:11:50

@kauko Yea, I saw that later too, when I tried it. Was not aware that macros dont work in that spot. But (reduce (fn [acc elem] (and acc elem)) true l) does 🙂

kauko20:11:45

@keatondunsford you don't need separate files. I don't have any configs at hand I could look at though

kauko20:11:17

but maybe look at a template to help you get started? Luminus is good, and I think re-natal has a template.

keatondunsford20:11:13

Yeah Re-Natal has a template with re-natal init which is great. Just trying to wrap my head around all this. Total newbie:)

kauko20:11:54

iirc you can have :cljsbuilds

keatondunsford20:11:00

I’m trying to piece together an Om.Next/Untangled/Datomic app for mobile and how tf to deploy it. 😛

dimovich23:11:18

@dominicm I don't have another language. I'm faithful to Clojure 🙂...

dimovich23:11:33

@rgm I suppose... I'm just getting into web dev. Need to write a site... a simple restaurant site. The owner needs to be able to change some data in the food menu. Was wondering what was a good approach.

dimovich23:11:07

Having a simple txt file that he edits and uploads on the server, and then enlive picks it up... Or maybe there is some good CMS clojurians tend to use in these cases.