Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Newsgroups: comp.lang.java.programmer From: Andreas Leitgeb Subject: Re: Call by Result References: <95e4uuF3cvU1@mid.individual.net> <8CtIp.4644$PA5.4578@newsfe01.iad> Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: Date: 12 Jun 2011 16:29:04 GMT Lines: 19 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1307896144 tunews.univie.ac.at 5640 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5244 Arved Sandstrom wrote: >>> however, for two reasons. It's still the use of a return value for >>> operation status, and although that's defensible, there's nothing OO >>> about it - it's pure imperative programming. And were we to still pursue >>> that approach, unfortunately Java has no elegant means for supporting >>> it, unlike Haskell Maybe or Scala Option. >> Not sure, what feature you're principially talking of. Is it some kind of >> syntactic sugar to further simplify code like this: >> BoolStr bs = getString(); >> boolean b=bs.bool; String s=bs.str; > > In effect Maybe and Option > are wrapper types just like BoolStr in your example; it's simply that > Scala and Haskell have better language support for dealing with > datatypes of that sort. Yeah, I hoped you'd give a short example of use in Haskell/Scala, to show what a language could make even simpler about that.