Phillip Lord writes:
> Mikera writes:
>
>> On Wednesday, 11 December 2013 14:50:36 UTC, Phillip Lord wrote:
>> Macros that generate type hints can get pretty ugly.
>
> Yes, I notice that!
>
>> I ran into the same problem with vectorz-clj
>>
>> The following pattern ended up working for me: the
Mikera writes:
> On Wednesday, 11 December 2013 14:50:36 UTC, Phillip Lord wrote:
> Macros that generate type hints can get pretty ugly.
Yes, I notice that!
> I ran into the same problem with vectorz-clj
>
> The following pattern ended up working for me: the trick to to create a
> local symbo
On Wednesday, 11 December 2013 14:50:36 UTC, Phillip Lord wrote:
>
> Mikera > writes:
>
> > On Wednesday, 11 December 2013 13:37:24 UTC, Philipp Meier wrote:
> >> Implementing a clojure protocol will give you fast dispatch on the
> first
> >> argument's type.
> >>
> >
> > Very true... it's a
Mikera writes:
> On Wednesday, 11 December 2013 13:37:24 UTC, Philipp Meier wrote:
>> Implementing a clojure protocol will give you fast dispatch on the first
>> argument's type.
>>
>
> Very true... it's a tradeoff:
> - protocols allow open extension (which doesn't appear to be needed here?)
>
On Wednesday, 11 December 2013 13:37:24 UTC, Philipp Meier wrote:
>
> Hi,
>
> Am Mittwoch, 11. Dezember 2013 14:27:01 UTC+1 schrieb Mikera:
>>
>> You can't really avoid the instance checks: the underlying mechanic is
>> that the JVM needs to figure out somehow at runtime which overloaded method
>
Hi,
Am Mittwoch, 11. Dezember 2013 14:27:01 UTC+1 schrieb Mikera:
>
> You can't really avoid the instance checks: the underlying mechanic is
> that the JVM needs to figure out somehow at runtime which overloaded method
> version to call, since all it knows at compile time is that it has an
> ar
You can't really avoid the instance checks: the underlying mechanic is that
the JVM needs to figure out somehow at runtime which overloaded method
version to call, since all it knows at compile time is that it has an
arbitrary Object.
instance? is the simplest way to do this. There are some fa
On Tue, Dec 10, 2013 at 4:25 AM, Phillip Lord
wrote:
> (defn ^IRI iri
> [name]
> (cond
>(instance? String name)
>(IRI/create ^String name)
>(instance? java.net.URL name)
>(IRI/create ^java.net.URL name)
>(instance? java.io.File name)
>(IRI/create ^java.io.File name)))
>