Raul wrote:
>  Thus, getting back to the original {. 
>  it's not that the shape of the gerund --
>  the shape of the noun containing the 
>  atomic representation -- carries no 
>  information. It's that that shape 
>  information is independent of the 
>  underlying atomic representation.

Yes, this is a good rephrasal of the point I was trying to make about gerunds 
being "arrays of atomic representations"  

In particular, the original use case only cares about the a.r., not the shape 
of the noun carrying that a.r. .  Therefore, since the a.r. in this case is 
"singular" and not "listing" anything, we should not impose "vectorness" on it. 
 That could cause trouble later (because of the shape-prefix agreement rules, 
which are strict about vectors being lists of a fixed length, but more but 
allow scalars to propagate).  Of course, no trouble was caused in the original 
use case, which is why I only noted that it's best to develop  {.u`''  as a 
habit.

> Put differently, these are work-alikes:
>
>  1 :'{.u`'''''
>  1 :'5!:1<''u'''

I can't help to here again highlight the quirks.  

For one thing, J is pretty lenient about certain aspects of atomic 
representations.  When you asked for to produce the name of an entity, J would 
never produce a boxed scalar, even if that name were one letter long.  But in 
some contexts (like 5!:1 above), names are permitted to be boxed scalars. For 
that reason, though the results are the same, I like to say  5!:1<,'u' (tacking 
on a ravel) or 5!:1 {.;:'u' (which feels less like I'm managing a special case 
than the ravel approach).

For another thing, there are special rules about how the u and v are stacked in 
the context of an explicit operator.  There is a big difference between - 1 : 
('u=.+';' u`'''' ') and - 1 : ('f=.+';' f`'''' ')

-Dan



-----Original Message-----
From: programming-boun...@jsoftware.com 
[mailto:programming-boun...@jsoftware.com] On Behalf Of Raul Miller
Sent: Saturday, February 18, 2012 2:32 PM
To: Programming forum
Subject: Re: [Jprogramming] Verb display in function tables

Correction: 5!:1 not 5!:2

I need to test before hitting send...

-- 
Raul

On Sat, Feb 18, 2012 at 2:21 PM, Raul Miller <rauldmil...@gmail.com> wrote:
> That said, I should probably restate what I said about lists being the
> only documented form for using gerunds in primitives:
>
> Consider:
>
> � (2 2 $>:`-:`*:`])`:0&.> 2 4 6
> +---+----+----+
> |3 1| 5 2| 7 3|
> |4 2|16 4|36 6|
> +---+----+----+
> � (2 2 $>:`-:`*:`])`:0] 2 4 6
> 3 �5 �7
> 1 �2 �3
>
> 4 16 36
> 2 �4 �6
>
> This is perfectly reasonable behavior, �But the dictionary currently says:
>
> http://www.jsoftware.com/help/dictionary/d612.htm
>
> m `: 0 � � � � �Append � � � � �Appends the results of the individual verbs.
>
> In fact, the implementation is structure preserving. �The hypothetical
> "appends" happen in a way which would build the original frame
> structure of the verb arguments. �Thus, there are "zero appends" when
> the left side of `: is an atomic representation with an empty shape,
> and the shape of the left side of `: appears in the shape of the
> result:
>
> � $({.>:`'')`:0] 2 4 6
> 3
> � $(>:`'')`:0] 2 4 6
> 1 3
>
> Thus, getting back to the original {. -- it's not that the shape of
> the gerund -- the shape of the noun containing the atomic
> representation -- carries no information. �It's that that shape
> information is independent of the underlying atomic representation.
>
> Put differently, these are work-alikes:
>
> � 1 :'{.u`'''''
> � 1 :'5!:2<''u'''
>
> (or they seem to be -- I think they should be and I can't find any 
> exceptions).
>
> --
> Raul
>
>
>
>
>
> --
> Raul
>
> On Sat, Feb 18, 2012 at 2:06 PM, Raul Miller <rauldmil...@gmail.com> wrote:
>> Or, for something written by Ken Iverson rather than Roger Stokes:
>>
>> http://www.jsoftware.com/help/dictionary/d610.htm
>>
>> --
>> Raul
>>
>> On Sat, Feb 18, 2012 at 2:04 PM, Raul Miller <rauldmil...@gmail.com> wrote:
>>> Here's an example of a definition for gerund:
>>>
>>> http://www.jsoftware.com/docs/help701/learning/14.htm
>>>
>>> You might argue that the definition is informal -- like most of J --
>>> but I do not think it's fair to say that they are not defined
>>> anywhere.
>>>
>>> --
>>> Raul
>>>
>>> On Sat, Feb 18, 2012 at 1:10 PM, Dan Bron <j...@bron.us> wrote:
>>>> I'm not sure gerunds are defined anywhere.
>>>>
>>>> But if they were, the phrasing might be "arrays of atomic 
>>>> representations", where the "atomic representation" characteristic is the 
>>>> most salient, and "array" has the normal meaning (and perhaps the usual 
>>>> question of whether a scalar is an array?).
>>>>
>>>> We often (informally) think of gerunds as vectors, because we compose them 
>>>> with ` whose product is defined to be vector, and consume them with e.g. 
>>>> @. whose (left input) is most useful when vector. �But that's no reason to 
>>>> define gerunds as vectors, any more than to define selections as vectors, 
>>>> because we compose them with �, �, and consume them with e.g. { whose 
>>>> (left input) is frequently vector. Or saying 'string' is a string but 's' 
>>>> is not.
>>>>
>>>> Of course, in some contexts, 's' is not considered a string. �So perhaps 
>>>> you are suggesting that "gerunds are are arrays of atomic representations, 
>>>> where the shape of the array has meaning"? �If so, �this is an interesting 
>>>> digression, which I'm happy to discuss, but perhaps we should move it to a 
>>>> different thread.
>>>>
>>>> The original question was not concerned with gerunds, and I doubt having 
>>>> the atomic representation of �f@g �(vector or scalar) in the corner of the 
>>>> result table would be satisfying. What was wanted was the string 
>>>> representation (which is produced using 5!:5, which operates on scalars, 
>>>> so shape doesn't have meaning to it, and neither does atomic 
>>>> representation).
>>>>
>>>> Anyway, when present the promise of J to newcomers, we need to take care 
>>>> not obscure the pitfalls. �The literal Jenie (dJinni?) who delivers 
>>>> exactly what was asked for is rarely the hero of folklore.
>>>>
>>>> -Dan
>>>>
>>>> PS: �If we wish to continue the digression, it might be better to start 
>>>> with the links below, �better starting point would be wh
>>>>
>>>> �Here's a couple places where I've attempted to capture the meaning of 
>>>> "gerund"
>>>>
>>>> Sidebar in NuVoc definition of ` :
>>>> http://jsoftware.com/jwiki/Vocabulary/backtick#sidebar.3Agerunds
>>>>
>>>> As a necessary premise in the definition of a modifier utility:
>>>> www.jsoftware.com/jwiki/DanBron/Snippets/DOOG#definition
>>>>
>>>> Please excuse typos; composed on a handheld device.
>>>>
>>>> -----Original Message-----
>>>> From: Raul Miller <rauldmil...@gmail.com>
>>>> Sender: programming-boun...@jsoftware.com
>>>> Date: Sat, 18 Feb 2012 11:52:13
>>>> To: Programming forum<programming@jsoftware.com>
>>>> Reply-To: Programming forum <programming@jsoftware.com>
>>>> Subject: Re: [Jprogramming] Verb display in function tables
>>>>
>>>> Ok...
>>>>
>>>> ...except that gerunds are defined as vectors.
>>>>
>>>> Conceptually speaking, if it's a scalar, or a matrix, it's something
>>>> different. �It would still be gerund-like, in character (we can
>>>> trivially extract gerunds from it), but if we try using such things
>>>> with primitives that handle gerunds, we are getting into undocumented
>>>> territory.
>>>>
>>>> --
>>>> Raul
>>>>
>>>> On Sat, Feb 18, 2012 at 11:18 AM, Dan Bron <j...@bron.us> wrote:
>>>>> That makes sense.
>>>>>
>>>>> My personal impression was that the original vector-ness was an 
>>>>> (unintentional) side-effect of the method used to remove the trailing 
>>>>> atom (select-all-but-last as opposed to select-first).
>>>>>
>>>>> The proposed scalar should be a transparent replacement for the original 
>>>>> vector, whose shape wasn't serving a specific purpose (normally, in J, 
>>>>> shape carries meaning, and where it doesn't it is misleading: at best 
>>>>> superfluous, but often pernicious).

>>>>>
>>>>> �-Dan
>>>>>
>>>>>
>>>>> Please excuse typos; composed on a handheld device.
>>>>>
>>>>> -----Original Message-----
>>>>> From: Raul Miller <rauldmil...@gmail.com>
>>>>> Sender: programming-boun...@jsoftware.com
>>>>> Date: Sat, 18 Feb 2012 10:41:56
>>>>> To: Programming forum<programming@jsoftware.com>
>>>>> Reply-To: Programming forum <programming@jsoftware.com>
>>>>> Subject: Re: [Jprogramming] Verb display in function tables
>>>>>
>>>>> I often do that myself, but in this case, the original phrase was also
>>>>> generating a 1 element vector, so I decided that a 1-element vector
>>>>> was an appropriate result.
>>>>>
>>>>> --
>>>>> Raul
>>>>>
>>>>> On Sat, Feb 18, 2012 at 9:48 AM, Dan Bron <j...@bron.us> wrote:
>>>>>> Because in many contexts, a scalar is more convenient than a 1-element 
>>>>>> vector, I make a habit of tacking on a � {. �as in � {.u`'' �.
>>>>>>
>>>>>> -Dan
>>>>>>
>>>>>>
>>>>>> On Feb 18, 2012, at 9:32 AM, Raul Miller <rauldmil...@gmail.com> wrote:
>>>>>>
>>>>>>> I would use u`''
>>>>>>>
>>>>>>> � avg 1 :'u`'''''
>>>>>>> +---+
>>>>>>> |avg|
>>>>>>> +---+
>>>>>>> � avg
>>>>>>> |value error: avg
>>>>>>>
>>>>>>> --
>>>>>>> Raul
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Feb 17, 2012 at 1:57 PM, Edward Mokurai Cherlin
>>>>>>> <moku...@sugarlabs.org> wrote:
>>>>>>>> I had thought that I would not be able to get a program to show the
>>>>>>>> definition of a function given its name, but I found a kludge for the
>>>>>>>> purpose using tie. Now I would like to know whether somebody has a
>>>>>>>> direct solution. My application for this capability is a defined
>>>>>>>> adverb for producing function tables.
>>>>>>>>
>>>>>>>> � t=.1 :(':';'2 2$(>1 0#u`u);y;(,.x);x u/ y')
>>>>>>>> � l +t l=.i.5
>>>>>>>> +-----------+
>>>>>>>> �+�0 1 2 3 4�
>>>>>>>> +-+---------�
>>>>>>>> �0�0 1 2 3 4�
>>>>>>>> �1�1 2 3 4 5�
>>>>>>>> �2�2 3 4 5 6�
>>>>>>>> �3�3 4 5 6 7�
>>>>>>>> �4�4 5 6 7 8�
>>>>>>>> +-----------+
>>>>>>>>
>>>>>>>> The question then is whether somebody knows a less ugly way to display
>>>>>>>> the value of u in executing this adverb than >1 0#u`u or >0{u`u .
>>>>>>>>
>>>>>>>> --
>>>>>>>> Edward Mokurai (??/???????????????/????????????? ?) Cherlin
>>>>>>>> Silent Thunder is my name, and Children are my nation.
>>>>>>>> The Cosmos is my dwelling place, the Truth my destination.
>>>>>>>> http://wiki.sugarlabs.org/go/Replacing_Textbooks
>>>>>>>> ----------------------------------------------------------------------
>>>>>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>>>>> ----------------------------------------------------------------------
>>>>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>>>> ----------------------------------------------------------------------
>>>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>>> ----------------------------------------------------------------------
>>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>>> ----------------------------------------------------------------------
>>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to