roxen.lists.pike.general

Subject Author Date
Global / static variables? Marcus Agehall (Roxen IS) @ Pi <6341[at]lyskom[dot]lysator[dot]liu[dot]se> 25-01-2009
This has been discussed on several occations and at some point I think
we will get a similar construct as the static modifier in C.

Today, you can emulate the whole thing by using a pmod to wrap your
classes. A pmod is, in many ways, a singleton class. So if you create
a .pmod file with the following:

int count;
class Counter {
	int local_var;

	void create() {
		count++;
	}
}

You will get a count of how many Counter objects you've created in the
count variable.