On 12/06/12 14:43, Tassilo Horn wrote:
"Jim - FooBar();"<jimpil1...@gmail.com>  writes:

If update-position is a protocol function just call it without the
dot. Just like a normal function. Then any reflection will go away
and no type hint is needed.
WHAT??? Seriously??? I'll try it...
OMG! You were right Meikel... I cannot believe this! I don't recall
reading about this anywhere...
I already demonstrated this is my very first reply. ;-)

Bye,
Tassilo


Yes, but I was under the impression that it made no difference whether you call it with the '.' or not...I was just calling with '.' just to show that there actually exists a java class underneath but i never expected that loosing the dot would erase reflection warnings! that's what I meant...

What's update-position?  Shouldn't that be (updatePosition p coords), as
you say IPieces have an updatePosition method?  And since you use that
for side effects (you don't use the return value), are your IPiece
implementors actually deftypes with :volatile-mutable or
:unsynchronized-mutable fields?

No, my IPiece implementors are records that hold a java.awt.Point object. This is indeed the only piece of mutable state in the whole namespace. (updatePosition p coords) will simply call 'setLocation()' on the Point of p. Are you saying that my defrecords should be deftypes? if yes, can you elaborate?

You see, it's still far from clear to me

better now? the project is on github in case you want to have a look -> Clondie24.core

any suggestions are welcome... I have to say I needed far less type-hints to get rid of reflection than I originally thought!

 Jim

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to