Newsgroups: comp.lang.apl
Path: watmath!ljdickey
From: ljdickey@watmath.waterloo.edu (L.J.Dickey)
Subject: Re: Is hook really necessary?
Message-ID: <1991Jul4.045226.5150@watmath.waterloo.edu>
Organization: University of Waterloo
References: <ROCKWELL.91Jul3181219@socrates.umd.edu>
Date: Thu, 4 Jul 1991 04:52:26 GMT
Lines: 51

In article <ROCKWELL.91Jul3181219@socrates.umd.edu>
	rockwell@socrates.umd.edu (Raul Rockwell) writes:

>Is the dyadic case of hook useful really useful?  If hook was removed
>from APL, it would eliminate the confusion currently possible when
>looking at a long train of functions.  (Further, there would by some
>syntactic protection against minor typos).

I like the hook in certain instances, and have found that it
comes up more often than I expected that it would.  Here is
the classic example, used in continued fractions.  Perhaps
others will present other examples.
   
   (+%) /\ 10#1
1 2 1.5 1.66667 1.6 1.625 1.61538 1.61905 1.61765 1.61818

Yes, I find the hook useful.

Something else that I find fascinating (useful?) is the adverb
called "fix" ( ".f" ).  It allows one to define their function
using several proverbs, and then fix the definition, as though
the proverbs had not been used.
   
Here is an example of what I am talking about.

   pr =. +%
   seq =. pr /\
   0 0$'  seq is defined in terms of pr'
   seq
+------+-+
|+--+-+|\|
||pr|/|| |
|+--+-+| |
+------+-+
   seq f.
+---------+-+
|+-----+-+|\|
||+-+-+|/|| |
|||+|%|| || |
||+-+-+| || |
|+-----+-+| |
+---------+-+
   seq =. seq f.
   seq 10#1
1 2 1.5 1.66667 1.6 1.625 1.61538 1.61905 1.61765 1.61818

-- 
Prof L.J. Dickey, Faculty of Mathematics, U of Waterloo, Canada N2L 3G1
internet:       ljdickey@watmath.UWaterloo.ca	BITNET/EARN:	ljdickey@watdcs
obsolescent?:	ljdickey@watmath.waterloo.edu
UUCP:		ljdickey@watmath.UUCP	..!uunet!watmath!ljdickey
