Thanks Marshall and Raul, and yes, of course the question assumed that there /was/ a need for an object.
My guess is you'd get that asked a lot if people were arriving at J from OO languages, I'd hate to be the one making the case that you don't always need objects, even when I agree with that statement. On 3 December 2012 19:21, Raul Miller <rauldmil...@gmail.com> wrote: > 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@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 > <aeg...@blueyonder.co.uk> wrote: > > On 3 December 2012 15:59, Raul Miller <rauldmil...@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 > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm