This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-25
Channels
- # admin-announcements (2)
- # beginners (36)
- # boot (37)
- # cider (65)
- # cljsrn (92)
- # clojars (3)
- # clojure (225)
- # clojure-austin (5)
- # clojure-belgium (2)
- # clojure-brasil (3)
- # clojure-china (1)
- # clojure-greece (2)
- # clojure-mexico (3)
- # clojure-news (2)
- # clojure-quebec (1)
- # clojure-russia (14)
- # clojure-spec (24)
- # clojure-uk (53)
- # clojurescript (34)
- # cursive (14)
- # datascript (9)
- # datomic (4)
- # defnpodcast (8)
- # devcards (30)
- # dirac (7)
- # editors (7)
- # emacs (1)
- # figwheel (1)
- # hoplon (85)
- # immutant (2)
- # incanter (1)
- # luminus (5)
- # off-topic (41)
- # om (18)
- # onyx (11)
- # perun (2)
- # re-frame (11)
- # reagent (9)
- # ring (3)
- # spacemacs (2)
- # spirituality-ethics (1)
- # test-check (19)
- # testing (12)
- # untangled (14)
- # yada (9)
hey guys, why I cannot type quotes on http://www.tryclj.com/ ?
@leo.ribeiro: double quotes work fine, "foo"
worked
if you're trying to use single quotes, you should know that single quotes are not used for string literals in clojure
@scriptor: it must be my computer, language, etc… when I try to type “ nothing happens.
@krchia what you want to do?
ah ok
let me check
(defn palindrome? [x] (= (str x) (apply str (reverse (str x)))))
@leo.ribeiro: yup, that’s my palindrome 😂
krchia: trying to solve the project here 😛
krchia: almost there but I need to leave now… (defn palindrome-hp ([min max] (if (> max min) (palindrome-hp min max max) nil)) ([min max cur] (if (palindrome? (* max cur)) (vector (list (* max cur) max cur) (palindrome-hp min (dec max))) (if (> (dec cur) 0) (recur min max (dec cur)) (recur min (dec max) (dec max))))))
need to adjust the (vector (list… and then pick the (max (first
and this one in case of you don’t need the pairs: (defn palindrome-hp ([min maxx] (when (> maxx min) ((comp last sort) (map #(palindrome-hp min % %) (range min maxx))))) ([min max cur] (if (palindrome? (* max cur)) (* max cur) (if (> (dec cur) 0) (recur min max (dec cur)) (recur min (dec max) (dec max))))))
and then, this is the pro solution 😛 http://www.leonardoborges.com/writings/2012/02/05/project-euler-problem-4-in-clojure/
https://www.youtube.com/watch?v=3uXXJ5UmLOw I haven't seen syntax used in this video at 32:06 f(* % %). What is that ?
@greenhorse: most likely a custom font for #(* % %)
which is an anonymous function squaring it's argument
@greenhorse: I guess it’s „pretty-lambda“ configure for clojure. Or it’s a fork thereof, https://github.com/yonkornilov/clojure-pretty-lambda.el
@greenhorse: actually this uses the 𝑓 symbol („mathematic italic small f“) instead of a small lambda: https://github.com/cemerick/.emacs.d#pretty-lambda-and-co
@ordnungswidrig: @greenhorse probably worth noting that this is just editor (emacs) configuration and has nothing to do with actual clojure syntax
Good point! And it messes up navigation commands in evil.
I don't think symbols and ligatures like these are a particularly good idea yet. They still break many things.
you can also do a (defmacro 𝑓 [bindings & body] `(fn bindings @body)) 😛
Hi. I know that there exist an extra channel for code reviews but mine is a very beginner code that's why I ask here. Can anyone please look through my code and can give me feedback about what I've done right and what wrong. Maybe you can recommend me what'll be the next steps for me to get further into clojure programming. I appreciate everyone's effort 🙂
@magoeke: this cond
expression should just be an or
expression of the 4 victory conditions
any examples on compojure routes which uses path parameters mixed with query parameters?