Jump to content
  • Advertisement
  • entries
  • comments
  • views

Tangent: Statics

Sign in to follow this  


Had a little extra time tonight to work on static methods and variables, and now they work:

public class foo{
public string bar = "moo.";

public static int baz = 6;
public static genFoo(string initValue) => foo {
local foo rtn = new foo;

rtn.bar = initValue;

public static main()=>void{
local foo Foo = new foo;

Foo = foo.genFoo("bleat.");

print Foo.bar; // bleat.

print foo.baz; // 6

This turned out to be one of those things that looks simple and should be simple, but is just a pain to implement. Even though it's 'working' now, I'm marginally afraid to do anything more complex than the example code. I can practically hear the bugs crawling about in the hackery used to get it working.

That leaves 'this' methods and generics (and the inevitable debuggery from this mess) in this batch of cleanup. Far too much. I must continue the focus on making little hard examples work. One tiny step at a time.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!