Combined with pattern matching and the orElse methods makes it very easy to use one variable that both stores the value and at the same time indicates whether it is valid or not. It's not two variables that could get out of sync.
I like the way Scala handles this with the Option class. None
indicates no value which is equivalent to your null sentinal
value but it is a value itself so it is always safe to use.
- Re: dereferencing null Sean Kelly
- Re: dereferencing null Martin Nowak
- Re: dereferencing null Sandeep Datta
- Re: dereferencing null Nathan M. Swan
- Re: dereferencing null Jesse Phillips
- Re: dereferencing null Nathan M. Swan
- Re: dereferencing null Jonathan M Davis
- Re: dereferencing null Nathan M. Swan
- Re: dereferencing null bearophile
- Re: dereferencing null - what about something like an che... dennis luehring
- Re: dereferencing null - what about something like a... David Eagen