gerundYN=: 0 -...@e. 3 : ('y (5!:0)';'1')"0 :: 0:
gerundYN +`*
1
gerundYN <'0';i.5
1
gerundYN <i.5
0
gerundYN 5!:1 <'gerundYN'
1
See also http://www.jsoftware.com/help/dictionary/dx005.htm#1
----- Original Message -----
From: david alis <[email protected]>
Date: Thursday, April 8, 2010 22:24
Subject: [Jprogramming] how to test for a gerund
To: Programming forum <[email protected]>
> How do I test whether a variable X is a gerund?
>
> The only way I have found so far is to test it against @. (agenda).
>
> X=.+`-
> x...@.=
> +-----+--+-+
> |+-+-+|@.|=|
> ||+|-|| | |
> |+-+-+| | |
> +-----+--+-+
>
> X=.3`3
> x...@.=
> |domain error
> | x...@.=
>
> Is there a better way?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm