causes it to compile and run just fine. Clues please? This doesn't match the example on the Actors page.
Thanks!
vkuzkokovSat 28 Aug 2010
It's about how fan runs classes
Static main works pretty much like in java, otherwise:
Try to get default instance from defVal
Or create new one calling constructor make and no arguments.
What meant on Actors page is that you can use properly created instance in described manner. Not that it can be created with no args.
brianSat 28 Aug 2010
Yeah you just need to change your main routine to be static. Fantom actually allows your main to be instance based, but then you have to provide a no-arg public make constructor (which your example lacks).
yachris Sat 28 Aug 2010
Hello,
Compiles fine, but when I try to run it, I get:
Changing the
make
declaration to:causes it to compile and run just fine. Clues please? This doesn't match the example on the Actors page.
Thanks!
vkuzkokov Sat 28 Aug 2010
It's about how fan runs classes
main
works pretty much like in java, otherwise:defVal
make
and no arguments.What meant on Actors page is that you can use properly created instance in described manner. Not that it can be created with no args.
brian Sat 28 Aug 2010
Yeah you just need to change your
main
routine to be static. Fantom actually allows your main to be instance based, but then you have to provide a no-arg public make constructor (which your example lacks).