Also, for the domain in question, we are not using > for anything but its rank.

Thus we could simplify:

   I =: ([: < [: /: [: ": ])"0

Also, since we are always using this as a monad, we could further simplify:


   I =: ([: < [: /: ":)"0

Though, personally, I find myself comfortable using @

   I =: <@/:@":"0

Or, going back to the original message, and applying @ to achieve what
the dictionary was talking about:

   <@([: /: ":)@>a,b

Or, using "0 to replace @>

   <@([: /: ":)"0 a,b

But if you are using trains in boxes, maybe it's better to state that
explicitly, and that could also get rid of any of the @ conjunctions:

   ([: /: ":) L:0 <"0 a,b

That said, when you replace a shorter expression with a longer one, I
think you should expect the longer one to lose some of the grace of
the original.

I hope this helps.

-- 
Raul

2011/10/27 Kip Murray <[email protected]>:
> About beauty, Marshall's third definition below can be written
>
>    I =: ([: < [: /: [: ": [: > ])"0
>
> The cap [: is an "identity element" in this context -- you can "ignore
> it right to left" to see a chain of verbs
>
> < /: ": > ]
>
> which are applied right to left.
>
> (The "0 means the chain is applied separately to each scalar in the
> argument.)
>
> Ken's invention of a new identity element at first meets the mental
> resistance 0 met when it was invented, then [: becomes a thing of
> beauty: [: f g means a chain of verbs f g which are applied right to
> left as in
>
> ([: f g) y is f g y and x ([: f g) y is f x g y
>
> Checking,
>
>    I 10123,32110
> +---------+---------+
> |1 0 2 3 4|4 2 3 1 0|
> +---------+---------+
>
>    < /: ": > ] 10123
> +---------+
> |1 0 2 3 4|
> +---------+
>    < /: ": > ] 32110
> +---------+
> |4 2 3 1 0|
> +---------+
>
> To see the beauty, learn to see the chain without the "identity element"
> [: and remember right to left application.  [: means "chain".
>
>
> On 10/26/2011 10:36 PM, Linda Alvord wrote:
>> I guess I learned APL when you essentially applied verbs from right to left.
>> When you use extensive use of @ you seem to loose some of the beauty of the
>> simplicity of understanding.
>>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Marshall Lochbaum
>> Sent: Wednesday, October 26, 2011 11:14 PM
>> To: Programming forum
>> Subject: Re: [Jprogramming] problem with under
>>
>> You can use&.: and simply make the verb rank 0 (which is the rank of>),
>> and then expand that to an expression using @: . However,&.>  is an idiom
>> that is really useful (it's the analogue of "_1 for arrays of boxes), so
>> your code will be shorter and clearer if you learn to use it.
>>
>> I =: ([:/:":)&.>
>> I =: ([:/:":)&.:>  "0
>> I =:<  @: ([:/:":) @:>  "0
>>
>> These give some equivalent forms for&.>  , using adverb trains:
>> &.>
>> (&.:>) ("0)
>> (<@:) (@:>) "0
>>
>> One helpful way to think about it is to consider arrays of boxes, where&.>
>> simply does the verb inside each box:
>>     <"0 i.10
>> --T-T-T-T-T-T-T-T-T-┐
>> │0│1│2│3│4│5│6│7│8│9│
>> L-+-+-+-+-+-+-+-+-+--
>>     >:&.>   <"0 i.10
>> --T-T-T-T-T-T-T-T-T--┐
>> │1│2│3│4│5│6│7│8│9│10│
>> L-+-+-+-+-+-+-+-+-+---
>>
>> Now when the argument is not boxed, open does nothing, but it has rank zero,
>> so it still only works on atoms. Thus one way to think of it is that each
>> atom of the argument is in its own virtual box before application, and then
>> evaluation goes as show above.
>>
>> Marshall
>>
>> 2011/10/26 Linda Alvord<[email protected]>
>>
>>> Somehow I didn't make my purpose very clear. I was trying to get a simple
>>> expression for  l  that didn't use&. And thought it should be possible
>>> from the definition in the dictionary.  Can anyone provide a tacit
>>> definition without&.    Thanks.    Linda
>>>
>>>
>>>      u&.v is u&.:v"({. v b. 0)
>>>
>>>      a=: 10123
>>>     b=: 32110
>>>     l=:([:/: ":)&.>
>>>     l a,
>>> ----------T---------┐
>>> │1 0 2 3 4│4 2 3 1 0│
>>> L---------+----------
>>>
>>>    m=:([:/:":)&.:>"({.>  b. 0)
>>>    m
>>> ([: /: ": )&.:>"({.>  b, 0)
>>>
>>>    m a,b
>>> ----------T---------┐
>>> │1 0 2 3 4│4 2 3 1 0│
>>> L---------+----------
>>>
>>> -----Original Message-----
>>> From: [email protected]
>>> [mailto:[email protected]] On Behalf Of Henry Rich
>>> Sent: Wednesday, October 26, 2011 9:28 PM
>>> To: Programming forum
>>> Subject: Re: [Jprogramming] problem with under
>>>
>>> Different people have different standards of acceptable rigor, I reckon.
>>>   To me, the context isn't enough to overcome the inaccuracy of the
>>> statement.
>>>
>>> FWIW, in my first post on this I had originally typed 'wrong' and
>>> replaced it with 'misleading', following much the train of thought you
>>> have offered.  I still think Ye Dic is wrong; but I'm dead certain it is
>>> misleading.
>>>
>>> I think the current language is a holdover from the days before&.: .
>>> Now I can say that
>>>
>>> u&.v is u&.:v"({. v b. 0)
>>>
>>> but back then there was no notation for that idea, and the Dictionary
>>> just came close and was content.  I think readers deserve better now.
>>>
>>> Henry Rich
>>>
>>> On 10/26/2011 9:09 PM, Raul Miller wrote:
>>>> On Wed, Oct 26, 2011 at 5:52 PM, Henry Rich<[email protected]>
>>>   wrote:
>>>>> I think it's fair to say the Dictionary is misleading because
>>>>>
>>>>> a. it contains a line that is not true;
>>>>
>>>> It's only "not true" when taken out of context -- you have to (a)
>>>> ignore preceding material, and then (b) generalize a remaining
>>>> statement and believe it covers the case treated by that preceding
>>>> material
>>>>
>>>> This is somewhat like saying that a dictionary is wrong for claiming
>>>> that "light" means "not weighing much" because someone who was not a
>>>> native speaker was confused because they needed to treat a context
>>>> having to do with illumination.
>>>>
>>>> It's only wrong if you overgeneralize.
>>>>
>>> ----------------------------------------------------------------------
>>> 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