I'm confused by what you're saying here - these are examples of passing a
map, not of passing varargs.
If you want to pass a map, you'll need a set up like:
(defmulti test-html :language);; :language here is a keyword being used
as a function of one arg (the map)
(defmethod test-html :html
Just lastly, I've seen people use the following structure of data
(def test-html {:language ::html :data "hello"})
and passing it as an argument to the mutlimethod, though not sure if it
would or could apply to my case but when I use it simply returns nil under
this condition
(transform test-html
Yes, multimethod handles varargs.
On Wednesday, January 11, 2017 at 4:37:12 PM UTC-6, david swift wrote:
>
> Ah seems the repl state was the cause, restarted and the ordering worked
> correctly though it still confuses me greatly! but I'll get there
> eventually (I hope). as for the extra ')' th
Ah seems the repl state was the cause, restarted and the ordering worked
correctly though it still confuses me greatly! but I'll get there
eventually (I hope). as for the extra ')' that was manually retyping into
forum error :)
Using nightcode editor's insta-repl for testing and seems it doesn
On Wednesday, January 11, 2017 at 4:23:28 PM UTC-6, david swift wrote:
>
> Been working on a tiny snippet of code related to multimethods (something
> I've never quite wrapped my head around) and when it comes to the
> dispatching of the function I'm confused by the order in which I've to pass
Been working on a tiny snippet of code related to multimethods (something
I've never quite wrapped my head around) and when it comes to the
dispatching of the function I'm confused by the order in which I've to pass
the arguments in as it seems to go against all common sense.
To show what I am