[Gd-hackers] gtk interface: shorten identifiers, ... ?

Chris Page chris at chris-page.org
Mon Dec 4 01:34:20 CET 2006


On Nov 28, 2006, at 23:51 PM, Mike Austin wrote:

> Now define a generic function which dispatches on one argument, and  
> return the actual curried function you want to call:
>
> define method foo(window :: <window>)
>    return curry(window-foo, window);
> end method;
>
> window.foo returns the curried function you want to call, and
>
> window.foo(1, 2, 3);
>
> calls it.

Clever, but ugly, and likely inefficient to use by default. May be a  
good solution for some dynamic situations.

> The above is the same as window(foo)(1, 2, 3).

Minor correction: window.foo(1, 2, 3) is equivalent to foo(window)(1,  
2, 3)

And it's worth noting that they're not strictly identical, because  
the order of evaluation is different, since "window" and "foo" are  
referenced in different order.

As it happens, I'd rather lose this feature of Dylan and make it so  
that window.foo(1, 2, 3) is equivalent to foo(window, 1, 2, 3), which  
I think would be much more useful and widely applicable (no pun  
intended).

-- 
Chris Page - Super Happy Fun Engineer

  Do not taunt Super Happy Fun Engineer.





More information about the hackers mailing list