2009-06-15

juan_gandhi: (Default)
2009-06-15 09:47 am

нет ли где расписания речей товарища Обамы

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

scottrade

сломался в такой драматический момент. не знаю, простить на первый раз, или уже послать.
juan_gandhi: (Default)
2009-06-15 11:17 pm

a couple of short notes

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?