Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe19.iad.POSTED!8ad76e89!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Call by Result References: <95e4uuF3cvU1@mid.individual.net> <8CtIp.4644$PA5.4578@newsfe01.iad> <4df5290c$0$49183$e4fe514c@news.xs4all.nl> <4df77a95$0$49041$e4fe514c@news.xs4all.nl> <_XPJp.2060$g12.487@newsfe20.iad> <6XRJp.10628$5v5.8742@newsfe11.iad> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 32 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Wed, 15 Jun 2011 21:52:41 UTC Organization: Public Usenet Newsgroup Access Date: Wed, 15 Jun 2011 18:52:40 -0300 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5326 On 11-06-15 09:50 AM, Andreas Leitgeb wrote: > Arved Sandstrom wrote: >> On 11-06-14 09:09 PM, Stefan Ram wrote: >>> null surely is a /reference value/, but it does not identify >>> a string value in the sense of the class String as a class >>> whose instances model string values. > > Yeah, Stefan, that's just how I see it. There's a distinction between > reference values and "values"/objects of the particular instance/class > type. > > Unless Scala also has a concept for Some(null) (I do *not* mean > Some(None), as that would then be two Option-layers), we can say > that Java's references are a stock "Option" wrapper for the actual > values. Any further Option layers in Java would not look that simple, > but require some explicit container-object, like a singleton-array or > a custom one-field class's instance. > You can do Some(null) in Scala; I mentioned that already in a previous post. That's an entirely expected behaviour of Option; as far as it's concerned 'null' is a valid value, just like any other, of the reference type that it contains. _You_ can consider Java references to be stock "Option" wrappers for actual values, sure. It won't hurt anyone if you do. I'm not going to myself, because unlike Option and Maybe, Java reference types are _not_ wrappers, and the way the language is, 'null' is a legitimate actual value *of* a reference type variable. There's no wrapping involved. We happen to ascribe various meanings to this special value, depending on usage and API, but it's still a value *of* a reference type variable. AHS