Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news3 From: Michael Wojcik Newsgroups: comp.lang.java.programmer Subject: Re: Call by Result Date: Wed, 15 Jun 2011 21:33:15 -0400 Organization: Micro Focus Lines: 35 Message-ID: References: <95e4uuF3cvU1@mid.individual.net> <8CtIp.4644$PA5.4578@newsfe01.iad> <4df5290c$0$49183$e4fe514c@news.xs4all.nl> NNTP-Posting-Host: p756036fdad293b5fef71e61b21c5e4be25e18dbc5328896a.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5327 Andreas Leitgeb wrote: > Silvio wrote: >> Well, here is an example in Scala: >> [...] >> def getString(s : String) : Option[String] = >> { >> if (s.reverse == s) Some(s.toLowerCase) >> else None >> } >> [...] >> val t = getString(s) >> [...] >> t match >> { >> case Some(r) => println("Success, return value is: " + r) >> case None => println("Failure") >> } > > Ah, thanks. Yep, I've seen this concept once when playing with > OCaml (which mentions Haskell as one of its roots). Never got > warm with it, though. They both get it from ML, which AFAIK is the first programming language in that particular family. It introduced the type inference and matching features that you find in OCaml (which is the OO version of Caml, a ML dialect), Haskell, Scala, F# (which is basically OCaml adapted for .NET), etc. In the Verona of functional languages, the ML family are the Montagues to the LISP family's Capulets. Or something like that. -- Michael Wojcik Micro Focus Rhetoric & Writing, Michigan State University