Jun. 15th, 2009

juan_gandhi: (Default)
А то он как Уго Чавес: как начнёт выступать, так нефть дорожает а акции дешевеют. Хотелось бы знать прикуп.

scottrade

Jun. 15th, 2009 12:41 pm
juan_gandhi: (Default)
сломался в такой драматический момент. не знаю, простить на первый раз, или уже послать.
juan_gandhi: (Default)
1. This Saturday, reading Abadi and Cardelli's "A Theory of Objects", figured out that the idea of ad-hoc polymorphism that is probably the basis of OOP, is just due to the fact that the functor -> is contravariant. So that we can apply a (nominally) superclass method to an instance of subclass.

2. All those events and listeners in Java - how come nobody uses double dispatch there?! People write long sequences of switch cases; what are these switch cases if not a manual dispatch? Do it using the language: have a bunch of specific event subclasses and, in listener's eventHappened() call an event methods, something like event.hello(this);, and different kind of events will call the listener's process() with the right event type; actually, there's not even a need for having a separate eventHappened() and process(); the ubiquitous "event dispatcher" can just call event's hello() passing the listener. That would be it, no? Am I wrong? Is not it how Erlang does it?

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

August 2025

S M T W T F S
      12
3456789
10 11 12 13141516
171819 20212223
2425 26272829 30
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 31st, 2025 06:28 am
Powered by Dreamwidth Studios