Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!news-server.csri.toronto.edu!torsqnt!jtsv16!blister!itcyyz!yrloc!hui
From: hui@yrloc.ipsa.reuter.COM (Roger Hui)
Subject: Re: Is hook really necessary?
Message-ID: <1991Jul5.034303.28680@yrloc.ipsa.reuter.COM>
Organization: Iverson Software Inc.
References: <ROCKWELL.91Jul3181219@socrates.umd.edu>
Date: Fri, 5 Jul 91 03:43:03 GMT

In article <ROCKWELL.91Jul3181219@socrates.umd.edu> rockwell@socrates.umd.edu (Raul Rockwell) writes:
>hook =. f g
>is semantically equivalent to
>Hook =. [ f g@]
>
>For the monadic case, it may be expressed simply as
>HOOK =. [ f g

We are aware that hook can be expressed easily in terms of
other primitives.  Moreover, considered in isolation, it is better
for hook to be defined as a conjunction (i.e. denoted by a symbol).
The current definition of hook permits any train of verbs to have
an interpretation.
 
>For the dyadic case, there is no significant difference between 
>   a (f g) b
>and
>   a  f g  b
>where a and b are nouns.
>
>Is the dyadic case of hook really useful?

A difference between a(f g)b and a f g b, is that the former
can be composed with other verbs while the latter can't.  
 
>                                                  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).

With a train of verbs, the rightmost three verbs resolves into a fork, 
resulting in a shorter train of verbs.  Whether or not hook exists 
does not change this fact.

-----------------------------------------------------------------
Roger Hui
Iverson Software Inc., 33 Major Street, Toronto, Ontario  M5S 2K9
(416) 925 6096

