Fork me on GitHub
#beginners
<
2016-06-13
>
whistlerbrk16:06:41

so if you intend to use defrecord you must use protocols as well, correct?

jeff.engebretsen16:06:21

You don’t have to. They’re separate mechanics.

jeff.engebretsen16:06:52

But it’s common be cause it gives the record behaviors.

whistlerbrk16:06:28

@jeff.engebretsen: but you can define ‘methods’ so to speak without a protocol?

jeff.engebretsen16:06:40

just what you get with maps.

jeff.engebretsen16:06:58

Maybe some others. I’m not sure what all records get.

plexus17:06:10

on ClojureScript you can use Object as a "pseudo-protocol" for adding arbitrary methods

jmayaalv19:06:12

@whistlerbrk: records create java classes behind the scenes so they are a bit more performant than maps

jmayaalv19:06:20

and if you want to provide polymorphic calls then you have protocols. with maps you can use multimethods (also less performant than protocols)