[Jprogramming] @: and capped fork
Raul Miller
rauldmiller at gmail.com
Mon Dec 3 19:21:34 UTC 2012
There are several ways of translating that javascript code into J, I
would have to know something about the larger context to know which of
them I would pick.
That said, one of the simplest would be:
do_something 'bee'
do_something 'see'
Another variation would be:
b_a_=: 'bee'
s_a_=: 'see'
do_something at do_a_&> nl_a_ 0
But obviously one of my questions would be: why do we even have an
object here, and does a different arrangement make sense?
--
Raul
On Mon, Dec 3, 2012 at 1:09 PM, Alex Giannakopoulos
<aegean at blueyonder.co.uk> wrote:
> On 3 December 2012 15:59, Raul Miller <rauldmiller at gmail.com> wrote:
>
>> That said, when I want to translate J into a language other people
>> understand, Javascript is usually my first choice.
>>
>
> Why does that not surprise me? :-)
>
>
> Incidentally, and if you have nothing better to do, how would you code this
> Javascript into J?
> a = new Object();
> a.b = "bee";
> a.c = "see";
> for (var prop in a)
> do_something(a[prop]) ;
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list