Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!swrinde!pipex!uknet!newsfeed.ed.ac.uk!dcs.ed.ac.uk!scgk
From: scgk@dcs.ed.ac.uk (Simon Kinahan)
Subject: Re: Newbie on multiple return values
Message-ID: <scgk.794788208@dcs.ed.ac.uk>
Sender: cnews@dcs.ed.ac.uk (UseNet News Admin)
Organization: Department of Computer Science, Edinburgh University
References: <fritza-2702951657020001@ts2-ind-21.iquest.net>
Date: Thu, 9 Mar 1995 22:30:08 GMT
Lines: 26

In <fritza-2702951657020001@ts2-ind-21.iquest.net> fritza@iquest.net (Fritz Anderson) writes:

>Am I right in assuming that the following is the proper way to declare a
>method that returns two numbers?

>define method returns-two-numbers(just-some-arg :: <number>)
>      => (one-result :: <number>, another-result :: <number>);
>//  actual code, ending with
>      values(foo, bar)
>end method;

As someone who usually uses either standard ML or C/C++ I am
a little puzzled by this convention.

Would it not be simpler to have a tuple type
and pattern matching ? Or is the requisite
pattern matching difficult to add to Dylan ?

Is this use of values iherited from Lisp or what ?


-- 

Simon Kinahan            "Only in our dreams are we truly free,
scgk@dcs.ed.ac.uk         the rest of the time we need wages. "
scgk@tardis.ed.ac.uk               -- Terry Pratchett, Wyrd Sisters
