Martin -
Good to see you back once in a while :)
Have been brooding over this for quite some time.
Using (1:) seems like cheating, but ... (as you pointed out) there
are benefits.
I'm still puzzled by the use of (]) and ([) at the same time for the
same argument (I remember Raul giving me some treatment on that
subject some years ago).
Anyway, I think this thread has produced enough information to enable
me to put some example on the wiki ... (will hopefully get around to
it next weekend).
Thanks for the discussion, and all the best.
-M
At 2018-08-07 18:00, you wrote:
Hi Martin!
> (+:^:(]`(%~))) 5
>32
> (+:^:(]`*)) 5
>32
The good old Constant function 1: will give you the benefits of
less circumlocution, better results for non-positive arguments,
and coverage of array arguments:
+:^:(]`1:) (,: -) 0 1 2 5
1 2 4 32
1 0.5 0.25 0.03125
A nice puzzle, BTW. I was only capable to get to
(+:@]^:[ 1:) 5
32
on my own, ignorant of the gerund option.
Martin (the other one)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm