Event handling

Frank Benoit keinfarbton at googlemail.com
Sun Apr 13 12:29:54 PDT 2008


Bjoern schrieb:
> Is such a hack really nessesary ? ( ... Sorry ... )
> 
> I mean A look at old school Smalltalk's  message handling should teach 
> us that "code blocks" // in our D case : closures // enable us to find a
> smarter solution. So I vote for spending  a reasonable amount of time to 
> figure out either a good/better D-ish solution or give a smalltalk like 
> solution a try.
> 
> Just my unholy opinion / the current DWT event handling is a bit clumbsy.
> ->
> Well, Closures are a D2 feature . and implementing code blocks using 
> closures is not very smart .. THough I'm  conviced that a closure based 
> solution is worth thinking twice...
> 
> OT ---------------------------------------
> D blocks : Pseudo code
> ------------------------------------------
> for_each = function (list, block)
> {
> for (i = 0; i < list.sizeof(); ++i)
> block(list[i])
> }
> 
> list = #(12, 34, 56) // tuple
> for_each(list)
> { |x| Print(x) }
> 
> =>  12
> 34
> 56

I don't get what your example shall illustrate.
Can you explain a bit more verbose?








More information about the Digitalmars-d-dwt mailing list