Node: Conversions, Next: , Previous: Predefined Subtypes, Up: Subtypes


Conversions from primitive C types to Lpp objects is done with the L constructor and back to primitive C types is done with the xL converter, where x designates a primitive C type.

Implicit constructors were avoided in Lpp for good reasons. One major reason is that it eliminated overloaded name conflicts with other C++ libraries. Another reason is that 0 as nil and 0 as integer is problematical. This may seem like a real inelegancy. For example the programmer has to specify list(L(55), L("string"), L(fun)) instead of simply list(55, "string", fun), but as it turns out this is not much of a problem in actual programming practice. Also, provided functions like listSEM("one", "two", "three", EM) for long homogeneous lists of like objects helps.

The name of the L constructor can be redefined per compilation unit, See Redefining Predefined Names.