Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!mach1!torn!utnut!utzoo!censor!geac!jtsv16!itcyyz!yrloc!rbe
From: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Subject: Re: Control Stuctures in APL 
Message-ID: <1993Apr15.202612.9278@yrloc.ipsa.reuter.COM>
Reply-To: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Organization: Snake Island Research Inc, Toronto
References: <1993Apr10.045751.26616@csus.edu> <734468246snz@apl.demon.co.uk> <russur.734741204@convex.convex.com>
Date: Thu, 15 Apr 93 20:26:12 GMT

In article <russur.734741204@convex.convex.com> russur@convex.com (Russ Urquhart) writes:
>In <734468246snz@apl.demon.co.uk> bowman@apl.demon.co.uk (Dick Bowman) writes:
>
>To make a comment that was made earlier .re looping structures and how they
>can be cast within APL. I recall back from my college days, and Dr. Howland if
>he's out there may want to help me on this :^), but a friend I had stated that
>ANY loop could be redesigned and thought of as a vectgor operation. It may
>take some doing, and may eventually end up less effiecient than a looping
>structure, but he felt that this was the case. I would be curious about
>everyones opinion on this? Is there an all encompassing algorithm for this?

I doubt this is true. Consider the following sorts of problems:

a. Dealing with inputs arriving in real time from an instrument.
   This requires a loop, if you want to process one input, do something,
   then the next, etc.

b. Count-controlled logic: This might be something like text strings
   where the length of each string is embedded as the first part of
   the string:
     4here2is1a4line2of2text
   This CAN be done without loops, but it ain't easy. Consider the
   case where the counts are all 4 byte text counts, as binary integers,
   and the text is arbitrary bitpatterns. 
   There is, I recall, a way to do this with a transitive closure of
   some sort, but it is NOT cheap, and may take LOTS of storage.

c. Relaxation algorithms such as those used in solving differential
   equations.

d. Compiler algorithms in which you keep applying transforms to a data
   structure until it stabilizes. 

Real Control Structure Are Needed in APL, for the solution of Real
Problems. Anyone who says it ain't so is not trying to solve anything
except toy problems.

Bob


Robert Bernecky      rbe@yrloc.ipsa.reuter.com  bernecky@itrchq.itrc.on.ca 
Snake Island Research Inc  (416) 368-6944   FAX: (416) 360-4694 
18 Fifth Street, Ward's Island
Toronto, Ontario M5J 2B9 
Canada
