Martin Nilsson (Coppermist) @ Pike (-) developers forum wrote:
Time Timestamp Date Interval TimeTZ Inet Range
Where are they in the name space?
They are created in __builtin: e.g. __builtin.Timestamp etc. They are made available in the root through a constant linking Timestamp to __builtin.Timestamp. It should allow you to write simple code like:
Timestamp my_new_timestamp = Timestamp();
Code quality request: no nested ?:-expressions. Functions like this ought to be a series of if-return statements.
protected int(0..1) `<(mixed that) { return intp(that) ? nsecs < [int]that * NANOSECONDS : floatp(that) ? nsecs < [float]that * NANOSECONDS : objectp(that) && nsecs < ([object]that)->nsecs && !zero_type(([object]that)->nsecs);
Code readability is relative. I actually find this code (if formatted pleasantly) easier to parse than multiple if() constructs.
But I'll change it, if it's easier for the majority to have if() constructs instead.