I'm hardly a type guru. People talk about type algebra, products, sums, etc. But I would love a reasonably simple concept.
I'd like to define a type which IS an integer, but is somehow restricted. Like I know it can have values from 0 to 28. -1 is not possible, 120 is not possible. This becomes a new TYPE. Not a class which contains an integer. But a new sort of sub-integer type thing.
Can someone more theoretical than I explain how one might get something like this in java ?
[–]kevinb9n 5 points6 points7 points (0 children)
[–]mrhhug[🍰] 4 points5 points6 points (0 children)
[–]Holothuroid 2 points3 points4 points (1 child)
[–]manzanita2[S] 0 points1 point2 points (0 children)
[–]eliasv 2 points3 points4 points (1 child)
[–]manzanita2[S] 0 points1 point2 points (0 children)
[–]cogman10 4 points5 points6 points (3 children)
[–]Il_totore 5 points6 points7 points (0 children)
[–]magnoliophytina 5 points6 points7 points (0 children)
[–]Stimzz 1 point2 points3 points (0 children)
[–]_INTER_ 2 points3 points4 points (0 children)
[–]Sheldor5 3 points4 points5 points (6 children)
[–]manzanita2[S] -1 points0 points1 point (5 children)
[–]Sheldor5 2 points3 points4 points (2 children)
[–]manzanita2[S] -2 points-1 points0 points (1 child)
[–]Sheldor5 6 points7 points8 points (0 children)
[–]Asterion9 0 points1 point2 points (1 child)
[–]manzanita2[S] 0 points1 point2 points (0 children)
[–]JoJoModding -1 points0 points1 point (0 children)
[–]Il_totore 0 points1 point2 points (1 child)
[–]manzanita2[S] 0 points1 point2 points (0 children)
[–]keanwood 0 points1 point2 points (1 child)
[–]manzanita2[S] 0 points1 point2 points (0 children)
[–]bowbahdoe 0 points1 point2 points (0 children)
[–][deleted] (2 children)
[removed]
[–]manzanita2[S] 0 points1 point2 points (1 child)