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