[Jprogramming] Pattern Matching

Arie Groeneveld bradypus at xs4all.nl
Tue Nov 6 03:01:12 HKT 2007


Dan Bron schreef:
>
> 	   	   2 5 (0 1 0 E. (E.~ #/)~) dat
> 	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
>
but, index is one too low:

   I. 2 5 (0 1 0 E. (E.~ #/)~) dat
16

   I.5=dat
8 9 10 17 18

and it goes wrong at the boundaries,
so you could do something awful like:

   2 5 ([:I.[(0 1 0 E.(E.~#/)~)_,_,~]) dat
17

   1 4 ([:I.[(0 1 0 E.(E.~#/)~)_,_,~]) dat
25 28
   1 0 ([:I.[(0 1 0 E.(E.~#/)~)_,_,~]) dat
0 26


=@@i



More information about the Programming mailing list