So, let's do this:

scalarX=: 1
listY=: i.7
rank2tableZ=: i.4 5

Now let's define:

function=:1 :0
:
  x;m;<y
)

Example use:
   scalarX rank2tableZ function listY

This produces a list of three boxes with the indicated values. Not
very useful, actually, but it should hint that particular calling
convention exists. (Need to read up on explicit definitions and
adverbs, though, if you want the details.)

That said, there's nothing prohibited about first combining them into
a list and passing them into a different function.

That said, if you're looking for Mathematica or Clojure, these are not
the right forums.

Thanks,

-- 
Raul


On Sun, Nov 19, 2017 at 4:01 PM, Andrew Dabrowski <[email protected]> wrote:
> Thank /you/ for /your/ comments.
>
> I'll look through the repos, thanks for the link.
>
> Could one say J's intention is the following? Be a great array processing
> language, and since utility functions for arrays are naturally binary or
> ternary at worst therefore the built-in verbs provide a great basis for
> array hacking while the programmer can focus on higher level tasks by
> defining higher arity functions explicitly.
>
> I still think J puts unnecessary hurdles in the way of defining higher arity
> functions.  In the link you sent me I see
>
> pdfcircle=: 3 : 0
> 'v e c p'=. y
> p=. citemize p
>
> where I presume citemize is a utility function for extracting lists from
> some container.  Suppose p had rank 2 or higher, would citemize have to be
> called again?  Where can I look up citemize anyway?  I have no idea how to
> find it from the NuVoc page.
>
> If the arguments to a function are to be a scalar x, a list y, and a rank 2
> table z, each has to be boxed before passing them to function, right?
> Coming from languages like Mathematica and Clojure that support
> destructuring, this is a turn-off, but I can see that once you get used to
> it it's not that big a deal.
>
>
> On 11/19/2017 02:45 PM, chris burke wrote:
>>
>>
>> This issue of tacit vs explicit comes up from time to time, and I'll
>> repeat
>> an earlier comment that tacit is over-emphasized in the J forums. In
>> production systems, most programs are explicit, while tacit is used where
>> appropriate, rather than used because of a desire to look cool.
>> Essentially, J gives you the choice and programmers just pick what suits
>> the problem.
>>
>> Browse through the J repos to see this. For example, in the recent addon
>> script,
>>
>> http://jsoftware.com/websvn/wsvn/public/trunk/graphics/pdfdraw/source/base/draw.ijs
>> , all definitions are explicit. Note that the first takes a right argument
>> with 4 values, so "arity" hardly matters.
>>
>>
>>
>
> ----------------------------------------------------------------------
> 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