I might suggest an adverb inplace, which takes a function, a noun left
argument, and a string right argument to modify the noun indicated by the
string to be equal to the dyadic application of the function. i.e.
3 +inplace 'a'  <--->  a=.a+3

   inplace=:1 :0
:
y=. x u ".y
)
   a=.5
   3 +inplace 'a'
8

Note that this cannot be done with 'x' or 'y' as input as they are locally
assigned to execute inplace. It is also bulkier and no faster than writing
out the sentence in question.

Marshall

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raul Miller
Sent: Friday, July 08, 2011 5:15 PM
To: Programming forum
Subject: Re: [Jprogramming] why doesnt the Copula(=. , =:) handle like a
Verb?

On Fri, Jul 8, 2011 at 5:03 PM, I wrote:
> serializeNoun=:3 :'5!:5<''y'''
...
> modify=:2 :0
>  (m,'=.',m,' ',5!:5<'v') ".@, serializeNoun@]
> )

serializeNoun already ignores its left argument, so that could have been:

serializeNoun=:3 :'5!:5<''y'''
modify=:2 :0
  (m,'=.',m,' ',5!:5<'v') ".@, serializeNoun
)

Or even:

modify=:2 :0
  (m,'=.',m,' ',5!:5<'v') ".@, 3 :'5!:5<''y'''
)

And, given the tradition of languages like C, where the += pattern is
supported with only a limited set of operations, perhaps it's fine that this
J conjunction only supports a limited class of verbs?

--
Raul
----------------------------------------------------------------------
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