regression/wordn-array.sml
raw| 1 | (* Make sure that arrays of odd-size words work. *) |
| 2 | |
| 3 | functor F (W: WORD) = |
| 4 | struct |
| 5 | val v = Vector.tabulate (10, W.fromInt) |
| 6 | val () = print (concat [W.toString (Vector.sub (v, 9)), "\n"]) |
| 7 | end |
| 8 | |
| 9 | structure S = F (Word5) |
| 10 | structure S = F (Word7) |
| 11 | structure S = F (Word9) |
| 12 | structure S = F (Word14) |
| 13 | structure S = F (Word17) |
| 14 | structure S = F (Word22) |
| 15 | structure S = F (Word30) |