digitalmars.D.bugs - calling function withouth ()
- "Ivan Senji" <ivan.senji public.srce.hr> Jul 25 2004
- "Ivan Senji" <ivan.senji public.srce.hr> Jul 25 2004
- "Vathix" <vathixSpamFix dprogramming.com> Jul 25 2004
- "Jarrett Billingsley" <kb3ctd2 yahoo.com> Jul 25 2004
- "Jarrett Billingsley" <kb3ctd2 yahoo.com> Jul 25 2004
<CODE>
import std.stdio;
int func()
{
writefln("HAHA");
return 0;
}
void main ()
{
func;
getch();
}
</CODE>
The function isn't actually called but this compiles and runs
but doesn't call func();
Jul 25 2004
Funny: :)
This calles the function:
<CODE>
import std.stdio;
int func()
{
writefln("HAHA");
return 0;
}
void main ()
{
func + 0;
getch();
}
</CODE>
Also for example this works:
-func; //calls the function.
So! We have partial global properties in D? :)
"Ivan Senji" <ivan.senji public.srce.hr> wrote in message
news:ce10fg$2jja$1 digitaldaemon.com...
<CODE>
import std.stdio;
int func()
{
writefln("HAHA");
return 0;
}
void main ()
{
func;
getch();
}
</CODE>
The function isn't actually called but this compiles and runs
but doesn't call func();
Jul 25 2004
"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:ce10l5$2jol$1 digitaldaemon.com...Funny: :) This calles the function: <CODE> import std.stdio; int func() { writefln("HAHA"); return 0; } void main () { func + 0; getch(); } </CODE> Also for example this works: -func; //calls the function. So! We have partial global properties in D? :)
The code had to be funny to make it laugh ;) I think there should be global properties.
Jul 25 2004
!!
we DO have global properties!!
import std.c.stdio;
import std.string;
int m_x;
int x(int y) { return m_x=y; }
int x() { return m_x; }
void main()
{
x=5;
printf("%d\n",x);
}
Jul 25 2004
sorry if my last post came across as angry or patronizing, i was happy and forgot to put in a " :) ". :)
Jul 25 2004









"Vathix" <vathixSpamFix dprogramming.com> 