Thomas van Noort committed Oct 07, 2010 1 2 ``````definition module _SystemEnum `````` Camil Staps committed Dec 11, 2019 3 4 5 6 7 8 9 10 11 12 13 14 ``````/** * The underlying functions for dotdot expressions. * * This module must be imported if dotdot expressions are used. * Then, the following constructs can be used: * * - `[from .. ]` -> `{{_from}} from` * - `[from .. to]` -> `{{_from_to}} from to` * - `[from, then .. ]` -> `{{_from_then}} from then` * - `[from, then .. to]` -> `{{_from_then_to}} from then to` */ `````` Thomas van Noort committed Oct 07, 2010 15 16 17 18 19 20 21 22 23 ``````// **************************************************************************************** // Concurrent Clean Standard Library Module Version 2.0 // Copyright 1998 University of Nijmegen // **************************************************************************************** from StdClass import class Enum (..), class IncDec (..), class Ord (..),<=,inc,dec from StdBool import not import StdInt,StdChar `````` Camil Staps committed Dec 11, 2019 24 25 26 27 28 29 30 ``````/** * Generate a list of all values from a starting point. * Instead of `_from x`, you can use `[x..]`. * * @param The starting point * @result [x, x + one, x + one + one, x + one + one + one, ...] */ `````` Thomas van Noort committed Oct 07, 2010 31 ``````_from :: a -> .[a] | IncDec , Ord a special a=Int; a=Char `````` Camil Staps committed Dec 11, 2019 32 33 34 35 36 37 38 39 40 `````` /** * Generate a list of all values from a starting point to an endpoint. * Instead of `_from_to x y`, you can use `[x..y]`. * * @param The starting point * @param The endpoint * @result [x, inc x, inc (inc x), inc (inc (inc x)), ..., E] where E <= y */ `````` Thomas van Noort committed Oct 07, 2010 41 ``````_from_to :: !a !a -> .[a] | Enum a special a=Int; a=Char `````` Camil Staps committed Dec 11, 2019 42 43 44 45 46 47 48 49 50 `````` /** * Generate a list of all values from a starting point with a certain interval. * Instead of `_from_then x y`, you can use `[x,y..]`. * * @param The starting point * @param The next point * @result [x, y, x + (y - x) + (y - x), ...] */ `````` Thomas van Noort committed Oct 07, 2010 51 ``````_from_then :: a a -> .[a] | Enum a special a=Int; a=Char `````` Camil Staps committed Dec 11, 2019 52 53 54 55 56 57 58 59 60 61 62 `````` /** * Generate a list of all values from a starting point to an endpoint with a * certain interval. * Instead of `_from_then_to x y z`, you can use `[x,y..z]`. * * @param The starting point * @param The next point * @param The endpoint * @result [x, y, x + (y - x) + (y - x), ..., E] where E <= z */ `````` Thomas van Noort committed Oct 07, 2010 63 ``_from_then_to :: !a !a !a -> .[a] | Enum a special a=Int; a=Char``