I’m curious what is emitted for this version:
(defn print-foo [fb]
(let [f (case fb
:foo #'foo
:bar #'bar)]
(apply f [])))
based on there being `return` statements sprinkled throughout the body of the
switch... is `apply` special-cased to cause some sort of "function context" to
be in play while compiling the first argument?
Sean
> On Apr 2, 2015, at 6:58 PM, Mike Fikes <[email protected]> wrote:
>
> I haven’t looked into the root cause, but if it helps, here is the emitted JS:
>
> https://gist.github.com/mfikes/a6106afedd37b7e47138
>
> - Mike
>
>> On Apr 2, 2015, at 9:33 PM, Elliot Bulmer <[email protected]> wrote:
>>
>> I get this error when I try to define a case statement that is returning
>> function vars. See this gist for an example:
>>
>> https://gist.github.com/sonelliot/5beb9058460b49a7006a#file-unexpected-token-clj
>>
>> I like to return vars that get invoked rather than the entire function
>> implementation. This is useful because I can re-define a function later and
>> the changes are automatically picked up by callers.
>>
>> Am I misunderstanding something or is this a legitimate bug?
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.