Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 24, 2004 example no longer working because of changed casting rules? | ||||
---|---|---|---|---|
| ||||
The first example does not compile any more on DMD090, I guess a side-effect of changing the casting rules. (To the bottom of the page: http://www.digitalmars.com/d/index.html ) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> For example: int function(char c) fp; // declare pointer to a function void test() { static int foo(char c) { return 6; } fp = foo; } is exactly equivalent to: int function(char c) fp; void test() { fp = function int(char c) { return 6;} ; } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< regards, roel |
May 24, 2004 Re: example no longer working because of changed casting rules? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roel Mathys | "Roel Mathys" <roel.mathys@yucom.be> wrote in message news:c8thde$96g$1@digitaldaemon.com... > The first example does not compile any more on DMD090, I guess a side-effect of changing the casting rules. > > (To the bottom of the page: http://www.digitalmars.com/d/index.html ) > > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > For example: > > int function(char c) fp; // declare pointer to a function > > void test() > { > static int foo(char c) { return 6; } > > fp = foo; this should be: fp = &foo; > } > > > is exactly equivalent to: > > int function(char c) fp; > > void test() > { > fp = function int(char c) { return 6;} ; > } > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > > regards, > roel |
May 25, 2004 Re: example no longer working because of changed casting rules? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | Ivan Senji wrote: > "Roel Mathys" <roel.mathys@yucom.be> wrote in message > news:c8thde$96g$1@digitaldaemon.com... > >>The first example does not compile any more on DMD090, I guess a >>side-effect of changing the casting rules. >> >>(To the bottom of the page: http://www.digitalmars.com/d/index.html ) >> >> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>For example: >> >>int function(char c) fp; // declare pointer to a function >> >>void test() >>{ >> static int foo(char c) { return 6; } >> >> fp = foo; > > > this should be: > fp = &foo; > > >>} >> >> >>is exactly equivalent to: >> >>int function(char c) fp; >> >>void test() >>{ >> fp = function int(char c) { return 6;} ; >>} >><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >> >>regards, >>roel > > > right, but the documentation on this page concerning Function Literals should be updated. http://www.digitalmars.com/d/expression.html roel |
May 25, 2004 Re: example no longer working because of changed casting rules? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roel Mathys | "Roel Mathys" <roel.mathys@yucom.be> wrote in message news:c8uk0h$2ddl$1@digitaldaemon.com... > right, but the documentation on this page concerning Function Literals should be updated. > > http://www.digitalmars.com/d/expression.html Done. Thanks |
Copyright © 1999-2021 by the D Language Foundation