Am 27.07.2010 18:24, schrieb Hans-Peter Diettrich:
> I just had to chase an strange bug, in a local (nested) subroutine. When
> I made several functions (if_statement() ...) local subroutines of
> method statement(), they stopped to work properly :-(
> 
> After many tries I concluded, that every (recursive) invocation of the
> "statement" method was replaced by the "statement" result.
> 
> While it is possible to replace all occurences of "statement" by
> "statement()", it is not clear whether this is really the intended
> purpose of every occurence of "statement". This uncertainty prevents any
> automated refactoring of old style function code.
> 
> IMO we should have at least an option, that a function name can *not* be
> used for the function result any more, for the result we have the Result
> variable. Then we can safely distinguish between function calls (by
> function name) and results (by "Result"). If ever required, local
> functions still can refer to the result of some enclusing function, by
> e.g. qualified <function_name>.Result.
> 

I think for this purpose a hint is enough.
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to