get should accept any type the same way Clojure JVM does
Description
Environment
None
Attachments
1
0001-CLJS-493-get-should-accept-any-type.patch
05 Apr, 2013
Activity
David Nolen April 6, 2013 at 3:30 AM
David Nolen
April 6, 2013 at 3:30 AM

Michał Marczyk April 5, 2013 at 1:27 AM
Michał Marczyk
April 5, 2013 at 1:27 AM
Right, thanks.
David Nolen April 5, 2013 at 1:17 AM
David Nolen
April 5, 2013 at 1:17 AM
Thanks get is just extremely common and likely to appear in expression cases - where the CLJS compiler will emit a function. If these get too nested GClosure won't handle them and it's a pretty big perf hit.

Michał Marczyk April 5, 2013 at 1:14 AM
Michał Marczyk
April 5, 2013 at 1:14 AM
Sure, here's a new patch, with a default case provided for ILookup and the tests from the previous patch. Both macro and function unchanged, since with this change everything satisfies? ILookup
.
Out of curiosity, why the preference? Do you think this sort of expansion jumping in at the wrong place could pose problems for GClosure?
David Nolen April 5, 2013 at 12:57 AM
David Nolen
April 5, 2013 at 12:57 AM
I'd prefer that the macro not emit a conditional check. I think it's probably OK if we just provide a default case for ILookup. Thanks.
Completed
Details
Details
Assignee

Reporter
Priority

Created April 3, 2013 at 4:11 PM
Updated July 27, 2013 at 8:27 PM
Resolved July 27, 2013 at 8:27 PM
The following throws instead of returning nil: