This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-22
Channels
- # beginners (24)
- # boot (80)
- # braid-chat (11)
- # cider (89)
- # clara (11)
- # cljsfiddle (5)
- # cljsjs (9)
- # cljsrn (63)
- # clojure (114)
- # clojure-austin (1)
- # clojure-berlin (5)
- # clojure-brasil (4)
- # clojure-dusseldorf (5)
- # clojure-hamburg (17)
- # clojure-india (1)
- # clojure-new-zealand (3)
- # clojure-poland (1)
- # clojure-russia (91)
- # clojure-taiwan (1)
- # clojure-uk (54)
- # clojurebridge (3)
- # clojurescript (170)
- # core-matrix (1)
- # cursive (14)
- # datomic (8)
- # emacs (13)
- # hoplon (96)
- # immutant (20)
- # jobs (9)
- # jobs-rus (13)
- # kosmos (3)
- # off-topic (8)
- # om (111)
- # onyx (41)
- # parinfer (116)
- # pedestal (2)
- # proton (4)
- # re-frame (46)
- # reagent (7)
- # ring-swagger (24)
- # slack-help (2)
- # testing (1)
- # untangled (8)
is there a good beginners guide for regular expression you guys can recommend?
For generic (non-jvm flavoured) regex help I usually end up on http://www.regular-expressions.info/ - the quickstart page gives a pretty nice overview
awesome thanks!
@adamkowalski: i like this: http://regexone.com
What is the difference between apply and map? They seem very similiar
Map accepts a function and a sequence and runs the function on each item in the sequence. If you have an increment function inc
and run (map inc [1 2 3 4 5])
then inc will be called five times (once for each element in the list) and you will have returned a list of the numbers all incremented (i.e numbers 2-6)
Apply also accepts a function and a sequence, but instead it will run the function just once with all of the items of the sequence as arguments. (apply + [1 2 3 4 5])
becomes the same as (+ 1 2 3 4 5)
ah, ok, thank you! Perfect explanation
is some
the best function to use if i want to just want to know if at least 1 element in a sequence matches a predicate?
but... my intuition would be to use (not (not-any? xs))
, simply because any?
would be the function that i would be looking for
probably because of this: http://hackage.haskell.org/package/base-4.8.2.0/docs/Prelude.html#v:any
that's pretty understandable
we tend to look for solutions resembling ones we're already familiar with
yes, i would wish the FP community would just settle on what they call certain operations
Where would be the fun in that… it would make it far too easy to move between languages 😏
(but, yes, it does take a while to get your head around the vast array of functions in clojure.core
)
e.g., we have some
and some?
and we have every?
but not every
...
(and some
and every?
take a predicate and a collection whereas some?
just takes a value!)
And then you have cond->
and some->
😆
Eventually you just get used to it all (the same as folks eventually get used to Haskell’s Prelude).