Fork me on GitHub
#hoplon
<
2015-12-23
>
onetom01:12:05

@flyboarder: it worked indeed. very exciting! thanks!

onetom01:12:33

have the advanced compilation broke for u too with:

java.lang.NoSuchMethodError: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List;

flyboarder01:12:50

yep failed for me too

flyboarder04:12:21

does anyone have an example of using a multimethod to override one of the hoplon attributes?

micha04:12:48

you can do this, for example:

micha04:12:47

(defmethod do! :toggle
  [elem _ v]
  (do! elem :css {:color (if v "red" "blue")}))

micha04:12:57

that is an example

flyboarder04:12:17

what are the arguments which are passed to that?

micha04:12:23

it happens to call do! itself, but that's not required, it was just easy to make the example that way

micha04:12:32

the first arg is the element

micha04:12:49

the second is the attribute keyword (`:toggle` in the case of my example)

micha04:12:59

so i made it _ because it'll always be :toggle there

micha04:12:07

the 3rd arg is the attribute value

flyboarder04:12:57

thanks, ill play around with that 😛

flyboarder07:12:45

@micha: thanks! that helped remove the need for the routing hack simple_smile

onetom12:12:19

We just looked deeper and started to use protocols and records so we under stand how component and boot-system work. Still I think we should thank Hoplon for being able to defer learning about such things for a year, yet deliver working software (which is actually used in production by blood and flesh humans simple_smile

onetom12:12:18

It really successfully abstracted away a lot of ugly accidental complexity

levitanong19:12:16

Hi all! is there an idiomatic way of keeping track of indices within a loop-tpl?

micha19:12:00

@levitanong: sure, you can do this:

micha19:12:34

(loop-tpl [[i thing] (cell= (map-indexed list things))]
  ...

levitanong19:12:56

I can't believe I didn't think of that. Thanks, @micha!