oh yeh! .. :(

i just tested ...
    ''`(*: %)
... has additional structure beyond just the boxed '*: %' part

hmm .. messing around ..

    F =. ^ %
    G =. %&.*:
    ]Varray =. <@(5!:5) F`G
┌───┬─────┐
│^ %│%&.*:│
└───┴─────┘

    (1{Varray) (128!:2)&> 2 3 5
0.5 0.333333333333 0.2

.. but is there any benefit to storing the actual atomic expression 
rather than the names? .. probably not.



.. but, as you say, it will work for names.  So
On 2011-08-16 16:20, Mark Niemiec wrote:
> mijj<[email protected]>  wrote:
>> after some checking ...
>>
>> even better...
>> using J's "apply" (128!:2)
>>     (*:`+:`-:) (128!:2)&>  (2 3 4)
>> NB. 4 6 2
>>
>> as a J version of:
>>     (`a`b`c)!(1 2 3)
>
> The fact that this happens to work is more by accident than by design.
> ` creates gerunds, while 128!:2 requires strings.
> Gerunds just happen to be boxed strings for simple primitives or for
> names, but this is not true for verbs in general.
>
>     (+/`+:`-:) (128!:2)&>  (2 3 4)
> |domain error
> |   (+/`+:`-:)    (128!:2)&>(2 3 4)
>
> Of course, if you know that all the verbs are primitives or names,
> this should work fine.
>
> -- Mark D. Niemiec<[email protected]>
> ----------------------------------------------------------------------
> 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