
27 Mar
2006
27 Mar
'06
11:04 a.m.
For example, take UNIX nice levels -20 to 19. You could have data ConstrainedInteger = CI {distToMax :: Natural, distToMin :: Natural} this would ensure only the 40 integers can be represented. Then you could have _something_ that defined what happened on overflow, whether it wraps, reflects, errors, truncates or whatever.
Doesn't Ada have constrained number types which have similar behaviour? -- burton samograd kruhft@gmail.com kruhft.blogspot.com www.myspace.com/kruhft metashell.blogspot.com