On Thu, 15 May 2008 14:33:18 -0000, cschalkwijk coen.schalkwijk@rtl.nl wrote:
When defining (in a roxen modue) a function
private void Check(int time) { bla, bla, bla int newTime = time(1); more bla bla }
trying to call the function time(1) (to get the time) results in an error: Calling non function value. Renaming the method parameter to tme 'solves' the problem.
FAFAIK this is strange behaviour, or is it?
Greetings Coen
The only strange thing is that the call to 'time(1)' should issue a type violation message. Other than that, it is the same as the following C code:
#include <stdio.h> #include <time.h>
void bla(time_t(*time)(time_t*)) { printf("%d\n",time(0)); }
int main(int argc,char** argv) { bla(0); }
I really do prefer programming languages where arguments and local variables cannot override global identifiers. I want my PL to protect me from much mistakes.
Bernd