How do I make a PIKEVAR in a .cmod static? The following
PIKEVAR string digits flags ID_STATIC;
(derived from how you make PIKEFUNs statuc) does not work at all. Neither do the more intuitive attempts
PIKEVAR static string digits;
or
static PIKEVAR string digits;
So what is the correct incantation?
It's not currently supported (see precompile.pike line ~1306, where id_flags is hardcoded to 0 in the call to map_variable()). Feel free to fix...
/ Henrik Grubbström (Lysator)
Previous text:
2003-02-18 22:32: Subject: cmod
How do I make a PIKEVAR in a .cmod static? The following
PIKEVAR string digits flags ID_STATIC;
(derived from how you make PIKEFUNs statuc) does not work at all. Neither do the more intuitive attempts
PIKEVAR static string digits;
or
static PIKEVAR string digits;
So what is the correct incantation?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
It seems very difficult to fix, due to the structure of the code and the poor choice of syntax for "attributes". Basically, given an array like
({ /* 6 elements */ Parser.C.Token("mapping",0,1), Parser.C.Token("|",0,1), Parser.C.Token("void",0,1), Parser.C.Token("x",0,1), Parser.C.Token("flags",0,1), Parser.C.Token("z",0,1) })
the code has to divide this into type, variable name, and attributes _before_ parsing either the type or the attributes...
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-02-19 10:28: Subject: cmod
It's not currently supported (see precompile.pike line ~1306, where id_flags is hardcoded to 0 in the call to map_variable()). Feel free to fix...
/ Henrik Grubbström (Lysator)
I didn't say it would be easy...
/ Henrik Grubbström (Lysator)
Previous text:
2003-02-19 17:33: Subject: cmod
It seems very difficult to fix, due to the structure of the code and the poor choice of syntax for "attributes". Basically, given an array like
({ /* 6 elements */ Parser.C.Token("mapping",0,1), Parser.C.Token("|",0,1), Parser.C.Token("void",0,1), Parser.C.Token("x",0,1), Parser.C.Token("flags",0,1), Parser.C.Token("z",0,1) })
the code has to divide this into type, variable name, and attributes _before_ parsing either the type or the attributes...
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Hm, isn't this code in the PikeType constructor quite strange?
[...] if(sizeof(tok) == 1) { switch((string)t) { case "CTYPE": args=({ PikeType(PC.Token(merge(tok[1..]))), convert_ctype(tok[1..]) }); break; [...]
Since the block is guarded by the condition "sizeof(tok) == 1", isn't "tok[1..]" always the empty array?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-02-19 17:34: Subject: cmod
I didn't say it would be easy...
/ Henrik Grubbström (Lysator)
pike-devel@lists.lysator.liu.se