---Hahn, Harvey wrote:
> This is my first version of a rather elementary level
> function, and so are there any huge holes for beginner use
> that I've forgotten to account for?
>
> I'm also thinking of the possibility of making the function
> dyadic, so that a left value of 0 (default, if no value
> given) makes the function operate as above, but a left value
> of 1 (or perhaps nonzero) adds a row of boxes above the
> current information with descriptors of the three pieces of
> information (such as "description", "shape", and "datatype").
>
> On the other hand, maybe this function already exists, buried
> somewhere in the J documentation.  If that's the case, I
> won't say that I guess I did this work for nothing, because
> I've learned a lot in the process!

I think of TABLE/MATRIX as being an array of rank 2, but not more. If I was 
using control words I'd be inclined use a select. case. statement, make 
TABLE/MATRIX 2=rank and have another name e.g. RANK <x> ARRAY or similar for 
2<rank.

You could reuse the stdlib.ijs verb "datatype" for the typval part of your verb.

NB. =========================================================
NB.*datatype v noun datatype
datatype=: 3 : 0
n=. 1 2 4 8 16 32 64 128 1024 2048 4096 8192 16384 32768 65536 131072
t=. '/boolean/literal/integer/floating/complex/boxed/extended/rational'
t=. t,'/sparse boolean/sparse literal/sparse integer/sparse floating'
t=. t,'/sparse complex/sparse boxed/symbol/unicode'
(n i. 3!:0 y) pick <;._1 t
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to