Re: PIKE_MODULE_INIT/EXIT in a normal pgsql.pike file
"Martin Nilsson (Opera Mini - AFK!) @ Pike (-) importm?te f?r mailinglistan" <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
>
>*.pike is a class, and i need to instantiate it to get an object.
>*.pmod is an object, so when accessed it is always the same, aka a singleton,
>so whatever is in the pmod is globally accessible.
>
>the inside of both kind of objects is the same. whatever you can put in a
>*.pike object, can also go into a *.pmod.
>
I'll add that the question of static variables is mainly about scope
and namespace.
int f(int x)
{
static int s;
// code
}
can be implemented as
private int s;
int f(int x)
{
// code
}
where the only difference between this and a real implementation of
static is that the variable is accessible from the other functions in
the object.
With static properly deprecated in 8.0 we could introduce this in 8.1.