rrr@hpdmd48.boi.hp.com (Rudi Rynders) (01/09/91)
OK, how DOES one catenate two m-rowed arrays in the "horizontal" direction in J? A pretty basic question , I admit. But why is it so hard to find? Anyone care to explain in detail the "OVER" and "BY" constructs?. Rudi Rynders (rrr@ hpdmd48.boi.hp.com)
sam@kalessin.jpl.nasa.gov (Sam Sirlin) (01/10/91)
In article <15160009@hpdmd48.boi.hp.com>, rrr@hpdmd48.boi.hp.com (Rudi Rynders) writes: |> OK, how DOES one catenate two m-rowed arrays in the "horizontal" direction in J? |> A pretty basic question , I admit. But why is it so hard to find? |> |> Anyone care to explain in detail the "OVER" and "BY" constructs?. |> |> Rudi Rynders (rrr@ hpdmd48.boi.hp.com) To catenate two arrays on their last axis, use under: a ,&.|: b This takes the transpose to start, catenates, then transposes the result (I think). It does seem to work at least for matrices. I suspect that with dyadic transpose one could catenate about arbitrary axes, albeit rather more cryptically than in traditional APL. And people used to say that APL was a write only language! As to over and by, my list (2.7) doesn't have those names, so I would have to consult other documentation. Did you send away to J for this? At least it gives mathematical details, which means you can eventually (using tests) figure them out. Consider it a puzzle. I've not been able to find a way to do the equivalent of reassignment: A[I] .is X in J. Is this really impossible? Doesn't this make it hard to do some things that FORTRASH even does easily (such as setting up similar arrays)? Or maybee I should compare to Matlab, the other ascii APL derivative. -- Sam Sirlin Jet Propulsion Laboratory sam@kalessin.jpl.nasa.gov
louk@tslwat.UUCP (Lou Kates) (01/10/91)
In article <1991Jan9.171347.19535@jato.jpl.nasa.gov> sam@kalessin.jpl.nasa.gov (Sam Sirlin) writes: #In article <15160009@hpdmd48.boi.hp.com>, rrr@hpdmd48.boi.hp.com (Rudi Rynders) writes: #|> OK, how DOES one catenate two m-rowed arrays in the "horizontal" direction in J? #|> A pretty basic question , I admit. But why is it so hard to find? #|> # #I've not been able to find a way to do the equivalent of reassignment: # # A[I] .is X # #in J. Is this really impossible? Doesn't this make it hard to do some things #that FORTRASH even does easily (such as setting up similar arrays)? Or # More generally, it would be nice for any APLer trying to learn J if there were a description of each APL expression in terms of the corresponding J expression. Lou Kates, Teleride Sage Ltd., louk%tslwat@watmath.waterloo.edu 416-596-1940 ext. 210