Thank you for comments.
Jacob Sparre Andersen wrote:
> I think for loops on floating point types is a mistake,
> since the step size isn't constant.
Constancy is desirable here ?
What do you think about enumeration, whose representations are
specified as sparse ones ?
# type E is (A, B, C, D);
# for E use (A => 0, B => 10, C => 100, D => 1_000);
In other words, I consider that forloop iteration could be reviewed
from abstract viewpoint that "what is the next", 'Succ.
# And Floatings now have Succ.
That is my saying "orthogonal" mean.
> For fixed point types, where the step size can be constant,
> I consider it interesting (and something I might want to
> use). There is still a problem due to the possible
> difference between the requested and the actual resolution
> of fixed point types. Most readers of such code would
> probably expect the step size to be equal to the requested
> resolution and not to the somewhat more arbitrary actual
> resolution of the fixed point type.
'Succ for fixed is defined as,
"For a fixed point type, the function returns the result of adding small to the value of Arg."
So, your mention that "difference between the requested and the actual resolution"
would be of discussion domain for "what Small is".
When we need to match the requested and the actual, we can specify its
Small with representation clause, as you know.
Am I on wrong way ?
Regards,


Toshitaka KUMANO <[log in to unmask]>
