On Mon, Nov 10, 2008 at 04:10:02PM +0000, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
ah, nice. what about type checking?
Not sure. I suspect the two identifiers would have their own types, so they wouldn't have to be identical. (But they'd have to be identical when it comes to runtime types.)
right, which is mostly my point regarding the wrapper being more difficult to create.
The wrapper function remains in the class, which means a lot less lugging around.
oh, of course. we need static/shared variables for that. how are those coming btw? :-)
hmm, if constant would take a type (constant function `-> = `[];) would that help the compiler to accept `[] as a constant expression?
No, that's not related. Pike always resolves the type of the value at compile time for constants, so the type of the constant itself would only be used to check that the value is compatible.
ah, ok, makes sense.
also, is that specific to `[] similar functions or does that problem exist with any function?
It exists with any function.
that means functions are generally not considered constant expressions? why not? i would have thought that it would be the other way around, functions are always constant. how could they be changed at runtime to point to another function?
greetings, martin.