3 ms·
I wasn't thinking of callbacks, but rather of the generic plumbing for, e.g., GUI elements that contain other GUI elements. And I never suggested it was necess
by mgreenbe 17y ago
I wasn't thinking of callbacks, but rather of the generic plumbing for, e.g., GUI elements that contain other GUI elements. And I never suggested it was necessary, only useful: it's nice to have Button be a type, but it's also nice to have addToWindow take any Element. There are GUI systems that don't do this---the DOM, for example---but they have their own warts.
I don't follow the last two sentences.
- jganetsk 17y agoJust read the original post and think GUI callbacks, and you'll get what I was trying to convey. You can have addToWindow take any element, there just has to be a function called 'asElement' which will take your type and produce a relevent 'element' data structure. Further, you can use Haskell-style type classes or ML-style functors to make this easy and polymorphic.