comp.lang.ada
 help / color / mirror / Atom feed
From: achrist@easystreet.com
Subject: Re: Neat and tidy solution to following problem?
Date: Tue, 07 May 2002 13:38:45 -0700
Date: 2002-05-07T13:38:45-07:00	[thread overview]
Message-ID: <3CD83B55.75FC2B01@easystreet.com> (raw)
In-Reply-To: rgVB8.2712$0h6.120157@newsfep1-win.server.ntli.net

"chris.danx" wrote:
> 
> I'm just wondering if there's a way to have something similar in Ada 
> 95 like have two items returned from a function but not have to 
> declare an explicit type.
> 

You would do this in Ada as a procedure (not a function) with multiple
in out parameters.  

I'd be interested to know how well recursion in Ada substitutes for 
looping (efficiency-wise).  Some of the functional languages are not
really high performance, and it would be interesting to see if you could
get about the same level of performance from the same style of coding 
using a procedural language.  In your example, for example, our spec 
might say that words are never very long (say more than 50 characters or 
so), so we wouldn't have to worry about problems with very deep
recursions.

However, Ada is a procedural language.  If you are using Ada, then 
presumably you are not allergic to procedural devices like looping
and in out parameters.  A recursive algorithm that eliminates but one
level of straightforward looping could be a puzzlement to an Ada reader.


Al



  parent reply	other threads:[~2002-05-07 20:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-07 18:24 Neat and tidy solution to following problem? chris.danx
2002-05-07 19:17 ` Preben Randhol
2002-05-07 20:21   ` chris.danx
2002-05-08  1:11     ` Jeffrey Carter
2002-05-08  8:16       ` Danx
2002-05-07 20:38 ` achrist [this message]
2002-05-07 20:56   ` chris.danx
2002-05-25 20:56     ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox