I updated the page to version to J903, primarily by swapping the fold
arguments. New example demonstrates use case for halt upon
count---please don't deprecate. I also find the following strange:
Z: 0 NB. Z: recognized as dyad
|domain error
| Z:0
0 Z: 0 NB. Z: recognized only in fold context
|syntax error
| 0 Z:0
New example:
HaltFold <https://code.jsoftware.com/wiki/Vocabulary/fcap>(F:)
afterCOUNTcalls of Fold operanduor raise limit error.
u=: __&$: :(4 : 0)
echo COUNT
_2 Z: -.*COUNT=:COUNT-1
_3 Z: 5 NB. prevent runaway
y+1 return. NB. sample recurrence relation for Fold
)
]F:u 10 [ COUNT=:3
3
2
1
11 12
]F:u 10 [ COUNT=:666
666
665
664
663
662
|fold limit
| ]F:u 10[COUNT=:666
zcapco and fcap are a response to
Date: Mon, 28 Feb 2022 18:40:09 +0000
From: Richard Donovan<[email protected]>
To: J Programming<[email protected]>
Subject: [Jprogramming] Is a +/ operation interruptible
Message-ID:
<lo4p265mb5931b516e9a494a3fed65396bd...@lo4p265mb5931.gbrp265.prod.outlook.com>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm