typed-objects-es7 icon indicating copy to clipboard operation
typed-objects-es7 copied to clipboard

Invoking a type object with no parameters should *always* yield an instance of that type

Open nikomatsakis opened this issue 11 years ago • 1 comments

I'm not sure what we do now for a call like uint8(), but I think it should yield 0. This basically means that we can say that for all type objects T, calling T() yields an instance of that type, calling T(exemplar) yields an instance of that type with data taken from exemplar.

nikomatsakis avatar Mar 14 '14 18:03 nikomatsakis

The one form that is not applicable across all type objects is T(buffer, offset), though one can write T.Array(buffer, offset, 1) (or whatever) to create an array of length one.

nikomatsakis avatar Mar 14 '14 18:03 nikomatsakis