Array model: Difference between revisions
Jump to navigation
Jump to search
Prototypes
Miraheze>Adám Brudzewsky (→Depth) |
Miraheze>Marshall (Prototypes) |
||
Line 40: | Line 40: | ||
The floating array model is a modification to the nested array model. It defines an array whose only element is a simple scalar to be identical to the scalar itself. In implementation terms, a simple scalar will "float" to the to of a stack of rank-0 arrays. Languages which do not make this identification are called "fixed". | The floating array model is a modification to the nested array model. It defines an array whose only element is a simple scalar to be identical to the scalar itself. In implementation terms, a simple scalar will "float" to the to of a stack of rank-0 arrays. Languages which do not make this identification are called "fixed". | ||
=== Array prototypes === | |||
''Main article: [[Array prototype]]'' | |||
An empty array may carry additional information to indicate what type its elements would be, if it had any. In a language with homogeneous arrays, this is typically just the type: character, numeric, or boxed. In a nested array language, the prototype may be quite complex, containing an entire nested structure. | |||
An array's prototype is used to determine the value of [[Fill element|fills]] when they are required by the language. | |||
== Array characteristics == | == Array characteristics == |