#1955 pointers

james Thu 12 Jul 2012

How do we create/use pointers in fantom???

andy Thu 12 Jul 2012

Fantom does not support C-style pointers.

james Thu 12 Jul 2012

thanks that's what we thought is there something instead??

SlimerDude Thu 12 Jul 2012

Does that not depend on what you want to do / achieve?

brian Thu 12 Jul 2012

Every variable (be it a parameter, field, or local variable) is a reference to an object. And that is pretty much what everything is. Fantom uses immutable types much more than Java, so often times you can't change any of the fields of an object. Instead you create a new instance and update what your variable references.

Under the covers there is an optimization for references to an Int, Float, or Bool. But that isn't really exposed like it in Java.

Login or Signup to reply.