Mirar @ Pike developers forum wrote:
(I think it's a bit ugly to have modules that change behaviour if you call an initializing function. It should either be initiated in create, or it should be a class, so you can instance it and have control over it.)
Mmm... could be a point.. but... well... ok, got to think about that. What it does is to expose some variables that it doesn't know the value of before it has been initialized, but the again, maybe the whole thing should be put into a class then...
x.y is read compile-time. You can't call something and expect the compiled constants to change value.
If you want to read it run-time, you can do x->y.
I've tried both x.y and x->y, the funny thing is that in hilfe only the dot-operator works. And now I think I just realized why: In hilfe each statement gets compiled when I type them, so the initialization has been done, so const-lookup works fine, but in my app, the whole thing gets compiled before the initfunction has been called. Most interesting.
Tricky business.. ok, new lesson: can't expose VARS from a .pmod (but I recall to have done it before, but it could be that I made it to call my init, then compile the code using it)
Thanks.
Btw, All this relates to my work on implementing a ncurses wrapper. The lib does work now, and I'm working in a module (set of modules) entirely in pike to simplify the curses life quite a bit :)
Any one interested may get what I have, otherwise it'll get relased on gotpike when I have it a bit more finished (i.e. stable ;)
//K