aboutsummaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-02-13 15:21:00 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-02-13 15:21:00 -0500
commitc4479e4bd61fb2c68fdac2637a20d6d99f7b9552 (patch)
treed6cc4335d64ad9d8be9e375f6e820cfcccd153df /environment.c
parent5be955904682300153af0abdfd6b711b9da2ac8f (diff)
Add Int:onward() iterator
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/environment.c b/environment.c
index 1427e9ec..1354999d 100644
--- a/environment.c
+++ b/environment.c
@@ -115,7 +115,6 @@ env_t *new_compilation_unit(CORD libname)
{"factorial", "Int$factorial", "func(x:Int -> Int)"},
{"format", "Int$format", "func(i:Int, digits=0 -> Text)"},
{"gcd", "Int$gcd", "func(x,y:Int -> Int)"},
- {"parse", "Int$parse", "func(text:Text -> Int?)"},
{"hex", "Int$hex", "func(i:Int, digits=0, uppercase=yes, prefix=yes -> Text)"},
{"is_prime", "Int$is_prime", "func(x:Int,reps=50 -> Bool)"},
{"left_shifted", "Int$left_shifted", "func(x,y:Int -> Int)"},
@@ -126,13 +125,15 @@ env_t *new_compilation_unit(CORD libname)
{"negative", "Int$negative", "func(x:Int -> Int)"},
{"next_prime", "Int$next_prime", "func(x:Int -> Int)"},
{"octal", "Int$octal", "func(i:Int, digits=0, prefix=yes -> Text)"},
+ {"onward", "Int$onward", "func(first:Int,step=1 -> func(->Int?))"},
+ {"parse", "Int$parse", "func(text:Text -> Int?)"},
{"plus", "Int$plus", "func(x,y:Int -> Int)"},
{"power", "Int$power", "func(base:Int,exponent:Int -> Int)"},
{"prev_prime", "Int$prev_prime", "func(x:Int -> Int)"},
{"right_shifted", "Int$right_shifted", "func(x,y:Int -> Int)"},
{"sqrt", "Int$sqrt", "func(x:Int -> Int?)"},
{"times", "Int$times", "func(x,y:Int -> Int)"},
- {"to", "Int$to", "func(from:Int,to:Int,step=none:Int -> func(->Int?))"},
+ {"to", "Int$to", "func(first:Int,last:Int,step=none:Int -> func(->Int?))"},
)},
{"Int64", Type(IntType, .bits=TYPE_IBITS64), "Int64_t", "Int64$info", TypedArray(ns_entry_t,
{"abs", "labs", "func(i:Int64 -> Int64)"},
@@ -148,7 +149,8 @@ env_t *new_compilation_unit(CORD libname)
{"modulo", "Int64$modulo", "func(x,y:Int64 -> Int64)"},
{"modulo1", "Int64$modulo1", "func(x,y:Int64 -> Int64)"},
{"octal", "Int64$octal", "func(i:Int64, digits=0, prefix=yes -> Text)"},
- {"to", "Int64$to", "func(from:Int64,to:Int64,step=none:Int64 -> func(->Int?))"},
+ {"onward", "Int64$onward", "func(first:Int64,step=Int64(1) -> func(->Int?))"},
+ {"to", "Int64$to", "func(first:Int64,last:Int64,step=none:Int64 -> func(->Int?))"},
{"unsigned_left_shifted", "Int64$unsigned_left_shifted", "func(x:Int64,y:Int64 -> Int64)"},
{"unsigned_right_shifted", "Int64$unsigned_right_shifted", "func(x:Int64,y:Int64 -> Int64)"},
{"wrapping_minus", "Int64$wrapping_minus", "func(x:Int64,y:Int64 -> Int64)"},
@@ -168,7 +170,8 @@ env_t *new_compilation_unit(CORD libname)
{"modulo", "Int32$modulo", "func(x,y:Int32 -> Int32)"},
{"modulo1", "Int32$modulo1", "func(x,y:Int32 -> Int32)"},
{"octal", "Int32$octal", "func(i:Int32, digits=0, prefix=yes -> Text)"},
- {"to", "Int32$to", "func(from:Int32,to:Int32,step=none:Int32 -> func(->Int?))"},
+ {"onward", "Int32$onward", "func(first:Int32,step=Int32(1) -> func(->Int?))"},
+ {"to", "Int32$to", "func(first:Int32,last:Int32,step=none:Int32 -> func(->Int?))"},
{"unsigned_left_shifted", "Int32$unsigned_left_shifted", "func(x:Int32,y:Int32 -> Int32)"},
{"unsigned_right_shifted", "Int32$unsigned_right_shifted", "func(x:Int32,y:Int32 -> Int32)"},
{"wrapping_minus", "Int32$wrapping_minus", "func(x:Int32,y:Int32 -> Int32)"},
@@ -188,7 +191,8 @@ env_t *new_compilation_unit(CORD libname)
{"modulo", "Int16$modulo", "func(x,y:Int16 -> Int16)"},
{"modulo1", "Int16$modulo1", "func(x,y:Int16 -> Int16)"},
{"octal", "Int16$octal", "func(i:Int16, digits=0, prefix=yes -> Text)"},
- {"to", "Int16$to", "func(from:Int16,to:Int16,step=none:Int16 -> func(->Int?))"},
+ {"onward", "Int16$onward", "func(first:Int16,step=Int16(1) -> func(->Int?))"},
+ {"to", "Int16$to", "func(first:Int16,last:Int16,step=none:Int16 -> func(->Int?))"},
{"unsigned_left_shifted", "Int16$unsigned_left_shifted", "func(x:Int16,y:Int16 -> Int16)"},
{"unsigned_right_shifted", "Int16$unsigned_right_shifted", "func(x:Int16,y:Int16 -> Int16)"},
{"wrapping_minus", "Int16$wrapping_minus", "func(x:Int16,y:Int16 -> Int16)"},
@@ -208,7 +212,8 @@ env_t *new_compilation_unit(CORD libname)
{"modulo", "Int8$modulo", "func(x,y:Int8 -> Int8)"},
{"modulo1", "Int8$modulo1", "func(x,y:Int8 -> Int8)"},
{"octal", "Int8$octal", "func(i:Int8, digits=0, prefix=yes -> Text)"},
- {"to", "Int8$to", "func(from:Int8,to:Int8,step=none:Int8 -> func(->Int?))"},
+ {"onward", "Int8$onward", "func(first:Int8,step=Int8(1) -> func(->Int?))"},
+ {"to", "Int8$to", "func(first:Int8,last:Int8,step=none:Int8 -> func(->Int?))"},
{"unsigned_left_shifted", "Int8$unsigned_left_shifted", "func(x:Int8,y:Int8 -> Int8)"},
{"unsigned_right_shifted", "Int8$unsigned_right_shifted", "func(x:Int8,y:Int8 -> Int8)"},
{"wrapping_minus", "Int8$wrapping_minus", "func(x:Int8,y:Int8 -> Int8)"},