Newsgroups: comp.software-eng
Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!jtsv16!blister!itcyyz!yrloc!hui
From: hui@yrloc.ipsa.reuter.COM (Roger Hui)
Subject: Re: AvAaA: Try APL descendant "J"
Message-ID: <1991May20.015933.13216@yrloc.ipsa.reuter.COM>
Reply-To: hui@yrloc.ipsa.reuter.COM (Roger Hui)
Organization: Iverson Software Inc.
References: <16281.281f708f@levels.sait.edu.au> <WINDLEY.91May7111216@panther.ted.cs.uidaho.edu> <b54a1g.hvl@wang.com> <16309.282b0e06@levels.sait.edu.au> <b5ix83.i25@wang.com> <16348.2833a96e@levels.sait.edu.au>
Date: Mon, 20 May 91 01:59:33 GMT

Brenton Hoff writes:
 
> How close does J get to adjectives, e.g. "all positive elements of array"
> or "all diagonal elements"?  How would you go about implementing a binary
> tree, and how would you then operate on the "leaf nodes"?  How many
> primitives do you need to specify to implement "leaf nodes"?  How easy is
> it to change the implementation of an operation without changing the
> original program specification?
 
a) J does not currently exploit the idea of adjectives.  However,
I am not sure that adjectives are needed for the examples you cited:
 
"All positive elements of an array"
   0&<          Proposition indicating positive elements, or
   #~ 0&<@,     Verb to select the actual positive elements
 
"All diagonal elements"
   =@i.@#       Proposition indicating diagonal elements, or
   (<0 1)&|:    Verb to select the actual diagonal elements
 
b) Binary trees can be implemented using boxed arrays.  Operations on
leaves are usually recursive verbs.
 
c) Many verbs and adverbs are modelled in J itself, and the implementation
is quite close to the models in many instances.  The programming style in
the C implementation is very much an APL style.  The paper "APL\?", by Hui,
Iverson, McDonnell, and Whitney, in the APL 90 Conference Proceedings,
discusses this topic.

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

