[Jprogramming] @: and capped fork
bob therriault
bobtherriault at mac.com
Mon Dec 3 19:52:19 UTC 2012
Alex,
I think I would point them towards first the 'Locales" lab and then the "Object Oriented Programming" lab. I think that these two labs would give object oriented people lots of information about how J can be used as an object oriented language.
Cheers, bob
On 2012-12-03, at 11:29 AM, Alex Giannakopoulos wrote:
> 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 <rauldmiller at 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 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
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list