Henry I am just clarifying here but not advocating one way or the other ….
This feature is part of q (or k) and is implemented as an extension of the
reshape function (which is # in q).
Here is a q sample,
q)args:("Code";33;"Name";"Iverson";"Age";34) /Comment: Here my
list might be of Key/Value pairs
q)args
"Code"
33
"Name"
"Iverson"
"Age"
34
q)0N 2#args
/Comment: q uses the NULL value (0N) to say “I know the list is in pairs, so
work out the rows" (hence here 3 x 2)
"Code" 33
"Name" "Iverson"
"Age” 34
The equivalent mechanism in APL or J is along these lines:
args=: 'Code';33;'Name';'Iverson';'Age';34
((($args)%2),2)$args /Comment: To save entering this
phrase in J, David is proposing to use the _ character to request it be
computed, so ( _ 2$args) would produce the same
┌────┬───────┐
│Code│33 │
├────┼───────┤
│Name│Iverson│
├────┼───────┤
│Age │34 │
└────┴───────┘
The feature was an enhancement of the shape function in q, mostly useful where
the list contained repeated groups.
I am not advocating or rejecting it, just pointing out it was a handy
convenience in limited cases.
…/Regards Rob
> On 21 Aug 2020, at 10:40 am, Henry Rich <[email protected]> wrote:
>
> I don't think it fits into the language where you want to put it.
>
> (x $ y) is to be used when you know what you want the shape to be. It sounds
> like you are guessing at it, and asking $ to make a plausible guess. I say
> that is a different function.
>
> The fact that you can handle only one infinity is a warning signal that the
> definition is incomplete.
>
> Henry Rich
>
> On 8/20/2020 8:33 PM, David Lambert wrote:
>> The proposal is for dyadic $ only.
>>
>> Processing experimental data which sometimes arrives in irregular chunks I
>> often end up with a vector.
>> q: # data
>> helps me figure out how to match data to the experiment. The proposal
>> solves the case where one of the inner shape atoms is unknown.
>>
>> If this is a sufficiently common situation, and Pascal shows interest, it
>> might be a worthwhile extension. On the other hand, the implementations
>> presented meet need, and I have these. It breaks only the unlikely programs
>> that depend on _ triggering an error. J need only check for infinity if x
>> is float, and I'd think the engine already tests the type of x.
>>
>> |On Tuesday, August 18, 2020, 07:51:03 p.m. EDT, Henry Rich
>> <[email protected]> wrote:
>> |This is a proposed change only to dyad and $ , is that right?
>> |What problem does this solve?
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm