Fork me on GitHub
#clojure-uk
<
2018-01-10
>
thomas08:01:04

moin moin morning

Rachel Westmacott09:01:41

Random core function of the day:

-------------------------
clojure.core/comp
([] [f] [f g] [f g & fs])
  Takes a set of functions and returns a fn that is the composition
  of those fns.  The returned fn takes a variable number of args,
  applies the rightmost of fns to the args, the next
  fn (right-to-left) to the result, etc.

reborg09:01:29

it is back! šŸ™‚

thomas09:01:13

do we use a function to determine the random core function of the day... some like rnd-nth on a vector of the functions from the core file ?

Rachel Westmacott09:01:45

There might be a better way, but Iā€™m using:

(eval `(doc ~(-> 'clojure.core ns-publics keys rand-nth)))

thomas10:01:06

very clever... and shows the power of homoiconicity šŸ˜‰

yogidevbear10:01:57

@U0FR9C8RZ what does the ~ do?

Rachel Westmacott10:01:46

it unquotes the following form

Rachel Westmacott10:01:24

effectively we look up a random symbol, and then stick it into the (doc ...) form for evaluation

Rachel Westmacott10:01:49

because doc is a macro, itā€™s a bit of a pain, ie. you canā€™t just apply it to something

reborg09:01:13

comp trivia of the day: (comp) === identity function

dominicm09:01:24

Ooh, this is back, great.

yogidevbear09:01:47

Would comp then be the same thing as chaining functions together?

Rachel Westmacott09:01:20

How else might you chain them? Were you thinking with ->?

yogidevbear09:01:14

ĀÆ\(惄)/ĀÆ

yogidevbear09:01:07

I like that Clojure works for (source ->)

Rachel Westmacott09:01:06

The effect of comp is similar, yes. but you get a function rather than a form (as with ->)

Rachel Westmacott09:01:31

I always have to think carefully about the argument order when calling comp though

Rachel Westmacott09:01:36

Nice thing about comp is itā€™s pure functions, no macro magic involved.

maleghast09:01:00

morning EVERYONE! šŸ™‚

maleghast09:01:22

So, today, finally, I am back to a normal(ish) work scheduleā€¦ Did everyone have a nice Xmas / New Year?

maleghast10:01:14

Does anyone out there know of a mature / usable ClojureScript Library for building forms with drag and drop

maleghast10:01:44

(have done some Google-ing, I may not be asking the question properly)

thomas10:01:32

not sure @maleghast but I vaguely remember there was something with bootstrap and reagent.

maleghast10:01:43

Oooh šŸ™‚

guy10:01:54

I think there is re-forms? but i dont know about drag and drop

thomas10:01:12

that could be it.

maleghast10:01:21

@guy - I will have a look at re-forms, as it might be enough of a foundation for me to build on.

thomas10:01:22

but as said.... not sure.

guy10:01:32

:thumbsup:

guy10:01:46

I think thats it

guy10:01:54

it was a while ago when i used it though

maleghast10:01:00

I need to put together a UI to ā€œbuildā€ / create data schema, so that non-technical people can lay out the bones of a domain data type for a crop or a port or well, many kinds of things, so that on the back end that description can be processed into a Datomic Schema.

maleghast10:01:15

Looking nowā€¦

guy10:01:23

That UI sounds fun šŸ™‚

maleghast10:01:11

Yeah, I am kooking forward to it being done, to be honestā€¦

maleghast11:01:40

This ^^ is a great library, thanks chaps šŸ™‚ Iā€™ll be honest I am going to spend a little more time looking around for something that does ā€œexactlyā€ what I am looking for, but I am going to use reforms to build what I want if I canā€™t find it, and the next time I need to build a form to just be a form then itā€™s going to be my ā€œgotoā€ unless something better has come along in the meantimeā€¦

guy11:01:06

:thumbsup:

rickmoynihan11:01:00

looks like a nice libraryā€¦ shame itā€™s bootstrap 3 not 4 though

yogidevbear11:01:22

>shame it's bootstrap 3 not 4 though

maleghast12:01:31

I realise that is is (now) inappropriately named, but I am much more enamoured of SpectreCSS myself (thanks @dominicm)