Newsgroups: comp.lang.apl
Path: watmath!ljdickey
From: ljdickey@watmath.waterloo.edu (L. J. Dickey)
Subject: Re: 'Locatives' in J
Message-ID: <1992Mar30.102215.4967@watmath.waterloo.edu>
Organization: University of Waterloo
References: <92087.153511HAC041@DJUKFA11.BITNET>
Date: Mon, 30 Mar 1992 10:22:15 GMT
Lines: 50

In article <92087.153511HAC041@DJUKFA11.BITNET> HAC041@DJUKFA11.BITNET
	(Konrad Hinsen) writes:
>Has anyone grasped what 'locatives' (names containing an underbar)
>in J are good for? They are mentioned in chapter 18 of "An Introduction
>to J", but as far as I could find nowhere else in the J documentation.
>From the example given I got the impression that this might be a useful
>thing, but since the example doesn't work with J 4.1 I am not so sure
>about that.

Hi,

I have wondered about the use of the name "locative".  I guess it may be
that the use of an underbar helps the reader to "locate" the beginning
of something in a J name.

When writing for people who are just learning J one might write one
of these 3 lines:

   matrixdivide	  =. '' : %. 
   MatrixDivide	  =. '' : %. 
   matrix_divide  =. '' : %. 

In my opinion, the name in the third line is the nicest alternative.

I like the use of the underbar symobl "_" in names.
Some examples using J, Version 4.1, as illustrated below.

 + ---------------------------------------------------------------------
 | watmath: /tmp/ljdickey 238 %% J
 | J 4.1   Copyright (c) 1990-1992, Iverson Software Inc.  All Rights Reserved.
 |  
 |    less_than     =. '' : < 
 |    index_of      =. '' : i. 
 |    integers	    =. i. : ''
 |    
 |    List =. integers 8
 |    
 |    3 less_than List
 | 0 0 0 0 1 1 1 1
 |    
 |    List index_of 1+1
 | 2
 |    
 + ---------------------------------------------------------------------

-- 
Leroy J. Dickey, Faculty of Mathematics, U of Waterloo, Canada  N2L 3G1
Internet:      ljdickey@watmath.UWaterloo.ca
               ljdickey@watmath.waterloo.edu
UUCP:          ljdickey@watmath.UUCP
