Null object: Difference between revisions

m (→‎{{header|Tcl}}: Style corrections)
Line 318:
:"Well, they're out," she sighed.
:He smiled, "When I am out, I only charge seven dollars a pound."
 
That said, note that the usual way to indicate missing or invalid data, in J, is to have a parallel array which is a bit mask (which selects the desired or valid values). Or, as a logical equivalent: a list of indices which select the desired and/or valid values. Alternatively, you can have an array without the invalid values and a bit mask which demonstrates how the data would be populated on a larger array -- in other words instead of 3,4,null,5 you could have (3 4 5) and (1 1 0 1). And you can transform between some of these representations:
 
<lang j> 1 1 0 1#3 4 _ 5
3 4 5
I.1 1 0 1
0 1 3
0 1 3 { 3 4 _ 5
3 4 5
1 1 0 1 #inv 3 4 5
3 4 0 5
1 1 0 1 #!._ inv 3 4 5
3 4 _ 5</lang>
 
=={{header|Java}}==
6,962

edits