February 05, 2003 Functions and Delegates | ||||
---|---|---|---|---|
| ||||
Just my 2 cents.
I think that function pointers and delegates should be interchangeble and use the same syntax.
int function( int ) foo;
int bar( int i )
{
}
foo = bar; // ok function address
class O
{
static int bar( int i )
{
}
int baz( int i )
{
}
}
O o = new O;
foo = O.bar; // ok function address
foo = O.baz; // error no object pointer
foo = o.baz; // ok encapsulates object pointer and method adress
This would make this a lot easier to understand and to implement signal/slot functionality in the language or in a library.
--
Marcelo Fontenele S Santos <msantos@pobox.com>
|
February 09, 2003 Re: Functions and Delegates | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marcelo Fontenele S Santos | I intend to revisit this issue, as many have requested this. -Walter |
Copyright © 1999-2021 by the D Language Foundation