Actually I think this already exists in the std lib somewhere.  It's called 
nountype, type, fulltype, or something.  

But it might use 3!:0 (in order to distinguish between different members of 
classes, like int vs float, ascii vs unicode, sparse vs dense, etc --- but 
these are definitely "external questions" -- in general, should not care about 
such distinctions; only Roger should, modulo performance questions and hw 
constraints).

-Dan
 
Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: [email protected]
Date: Wed, 21 Oct 2009 16:06:33 
To: J Programming<[email protected]>
Subject: Re: [Jprogramming] Noun type assessment

Something like (very untested, written on phone at trade show)

     nt=.(;:'num char sym box other') {~ (0;' ';(s:'');<a:) i. <@:{.@:(0 $ ,))

.... But the question is: why?  Your verbs should have defined domains (ie know 
and expect a certain type, or not care).  Unless you're doing some reflecting.

-Dan


Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: Tracy Harms <[email protected]>
Date: Wed, 21 Oct 2009 08:51:15 
To: Programming forum<[email protected]>
Subject: [Jprogramming] Noun type assessment

Off the top of my head, I don't know of a way other than 3!:0 by which
to determine whether I'm working with an array of numeric, literal, or
box atoms. My sense of "internal" vs "external" considerations has me
thinking that this quality is "inside" what J primaries naturally
involve, as opposed to implementation details that count as external
(and thus call for !: )

Is there a better way for me to distinguish among the major types of
atoms? If 3!:0 is the best way, is there an explanation as to why
examining atomic type is considered an external task, not a primary
one?

Thank you,

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