On Wed, Apr 15, 2009 at 4:09 AM, Steven Taylor <[email protected]> wrote:
> NB. a sequence of gerund, noun works
>
> a=.(+/%#)`+`%;12
> b=.>{.a
> c=.>}.a
I tried running this buy copying and pasting from your email
into a script window and then running, using the Window
Display option. Of course, this gave me value errors.
(So I changed all your =. to =:)
Here's another way of achieving the above:
a=: (+/%#)`+`% ,&< 12
b=: (+/%#)`+`%
c=: ,12
> NB. but noun, gerund doesn't
> a=.12;(+/%#)`+`%
> b=.>{.a
> c=.>}.a
> |domain error
>
> NB. oh okay, it's that last item of a boxed list must boxed
> for symmetry thing again.
Here's another way of achieving the above:
a=: (<12)`(+/%#)`+`%
b=: 12
>(+/%#)`+`-
In other words, your domain error was because you were
trying to unbox a list of gerunds and the contents of those
boxes was incompatible. The box for (+/%#) was itself
boxed data where the box for + was character data, and
you must put characters into boxes before they can go
into a list with other boxes.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm