datatype
3 : 0
n=. 1 2 4 8 16 32 64 128 1024 2048 4096 8192 16384 32768 65536 131072
262144
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/unicode4'
(n i. 3!:0 y) pick <;._1 t
)

None of t suggests a verb or function as a value.

Conclusion: no such value type exists.

If you're implementing a Scheme you'll probably want to tag all of your
values. procedure? then would just be a check against the tag.

On Thu, 2020-01-16 at 20:55 +0100, Raoul Schorer wrote:
> Hi,
> 
> I am translating scheme code that makes heavy use of delayed
> evaluation
> (thunks). In scheme, there is a predicate 'procedure?' that returns a
> boolean. I translated that into a check for a boxed string, which is
> the
> representation I use for delayed procedures, which I then 'force'
> using ".@>
> 
> 
>    1. Is there a better way than building a program string to get
> delayed
>    eval? I tried using (3: '(delayed_verb)"_'), but the interpreter
> seems to
>    greedily eval the whole thing with that pattern. The only working
> solution
>    I found was to convert everything to string.
>    2. Is there a general test similar to 'procedure?' in J?
> 
> 
> Thanks!
> Raoul
> -------------------------------------------------------------------
> ---
> 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