diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:26:28 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-10-09 13:26:28 -0400 |
| commit | 074cf22ad462eafe963e4a749b2b74cab51211a1 (patch) | |
| tree | e1d7f938f2d949cc5dcf67ca648f200663e36562 /environment.c | |
| parent | 47fca946065508cff4151a32b3008c161983fd9d (diff) | |
Change function syntax from `func(args)->ret` to `func(args -> ret)`
Diffstat (limited to 'environment.c')
| -rw-r--r-- | environment.c | 386 |
1 files changed, 193 insertions, 193 deletions
diff --git a/environment.c b/environment.c index f6e45574..96bc51f6 100644 --- a/environment.c +++ b/environment.c @@ -88,130 +88,130 @@ env_t *new_compilation_unit(CORD libname) {"Void", Type(VoidType), "Void_t", "Void$info", {}}, {"Memory", Type(MemoryType), "Memory_t", "Memory$info", {}}, {"Bool", Type(BoolType), "Bool_t", "Bool$info", TypedArray(ns_entry_t, - {"from_text", "Bool$from_text", "func(text:Text)->Bool?"}, - {"random", "Bool$random", "func(p=0.5)->Bool"}, + {"from_text", "Bool$from_text", "func(text:Text -> Bool?)"}, + {"random", "Bool$random", "func(p=0.5 -> Bool)"}, )}, {"Byte", Type(ByteType), "Byte_t", "Byte$info", TypedArray(ns_entry_t, {"max", "Byte$max", "Byte"}, {"min", "Byte$min", "Byte"}, - {"random", "Byte$random", "func(min=Byte.min, max=Byte.max)->Byte"}, + {"random", "Byte$random", "func(min=Byte.min, max=Byte.max -> Byte)"}, )}, {"Int", Type(BigIntType), "Int_t", "Int$info", TypedArray(ns_entry_t, - {"abs", "Int$abs", "func(x:Int)->Int"}, - {"bit_and", "Int$bit_and", "func(x,y:Int)->Int"}, - {"bit_or", "Int$bit_or", "func(x,y:Int)->Int"}, - {"bit_xor", "Int$bit_xor", "func(x,y:Int)->Int"}, - {"clamped", "Int$clamped", "func(x,low,high:Int)->Int"}, - {"divided_by", "Int$divided_by", "func(x,y:Int)->Int"}, - {"format", "Int$format", "func(i:Int, digits=0)->Text"}, - {"from_text", "Int$from_text", "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"}, - {"minus", "Int$minus", "func(x,y:Int)->Int"}, - {"modulo", "Int$modulo", "func(x,y:Int)->Int"}, - {"modulo1", "Int$modulo1", "func(x,y:Int)->Int"}, - {"negated", "Int$negated", "func(x:Int)->Int"}, - {"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"}, - {"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"}, - {"random", "Int$random", "func(min,max: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)->Range"}, + {"abs", "Int$abs", "func(x:Int -> Int)"}, + {"bit_and", "Int$bit_and", "func(x,y:Int -> Int)"}, + {"bit_or", "Int$bit_or", "func(x,y:Int -> Int)"}, + {"bit_xor", "Int$bit_xor", "func(x,y:Int -> Int)"}, + {"clamped", "Int$clamped", "func(x,low,high:Int -> Int)"}, + {"divided_by", "Int$divided_by", "func(x,y:Int -> Int)"}, + {"format", "Int$format", "func(i:Int, digits=0 -> Text)"}, + {"from_text", "Int$from_text", "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)"}, + {"minus", "Int$minus", "func(x,y:Int -> Int)"}, + {"modulo", "Int$modulo", "func(x,y:Int -> Int)"}, + {"modulo1", "Int$modulo1", "func(x,y:Int -> Int)"}, + {"negated", "Int$negated", "func(x:Int -> Int)"}, + {"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)"}, + {"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)"}, + {"random", "Int$random", "func(min,max: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 -> Range)"}, )}, {"Int64", Type(IntType, .bits=TYPE_IBITS64), "Int64_t", "Int64$info", TypedArray(ns_entry_t, - {"abs", "labs", "func(i:Int64)->Int64"}, - {"bits", "Int64$bits", "func(x:Int64)->[Bool]"}, - {"clamped", "Int64$clamped", "func(x,low,high:Int64)->Int64"}, - {"divided_by", "Int64$divided_by", "func(x,y:Int64)->Int64"}, - {"format", "Int64$format", "func(i:Int64, digits=0)->Text"}, - {"from_text", "Int64$from_text", "func(text:Text)->Int64?"}, - {"hex", "Int64$hex", "func(i:Int64, digits=0, uppercase=yes, prefix=yes)->Text"}, + {"abs", "labs", "func(i:Int64 -> Int64)"}, + {"bits", "Int64$bits", "func(x:Int64 -> [Bool])"}, + {"clamped", "Int64$clamped", "func(x,low,high:Int64 -> Int64)"}, + {"divided_by", "Int64$divided_by", "func(x,y:Int64 -> Int64)"}, + {"format", "Int64$format", "func(i:Int64, digits=0 -> Text)"}, + {"from_text", "Int64$from_text", "func(text:Text -> Int64?)"}, + {"hex", "Int64$hex", "func(i:Int64, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int64$max", "Int64"}, {"min", "Int64$min", "Int64"}, - {"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)->Range"}, + {"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 -> Range)"}, // Must be defined after min/max: - {"random", "Int64$random", "func(min=Int64.min, max=Int64.max)->Int64"}, + {"random", "Int64$random", "func(min=Int64.min, max=Int64.max -> Int64)"}, )}, {"Int32", Type(IntType, .bits=TYPE_IBITS32), "Int32_t", "Int32$info", TypedArray(ns_entry_t, - {"abs", "abs", "func(i:Int32)->Int32"}, - {"bits", "Int32$bits", "func(x:Int32)->[Bool]"}, - {"clamped", "Int32$clamped", "func(x,low,high:Int32)->Int32"}, - {"divided_by", "Int32$divided_by", "func(x,y:Int32)->Int32"}, - {"format", "Int32$format", "func(i:Int32, digits=0)->Text"}, - {"from_text", "Int32$from_text", "func(text:Text)->Int32?"}, - {"hex", "Int32$hex", "func(i:Int32, digits=0, uppercase=yes, prefix=yes)->Text"}, + {"abs", "abs", "func(i:Int32 -> Int32)"}, + {"bits", "Int32$bits", "func(x:Int32 -> [Bool])"}, + {"clamped", "Int32$clamped", "func(x,low,high:Int32 -> Int32)"}, + {"divided_by", "Int32$divided_by", "func(x,y:Int32 -> Int32)"}, + {"format", "Int32$format", "func(i:Int32, digits=0 -> Text)"}, + {"from_text", "Int32$from_text", "func(text:Text -> Int32?)"}, + {"hex", "Int32$hex", "func(i:Int32, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int32$max", "Int32"}, {"min", "Int32$min", "Int32"}, - {"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)->Range"}, + {"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 -> Range)"}, // Must be defined after min/max: - {"random", "Int32$random", "func(min=Int32.min, max=Int32.max)->Int32"}, + {"random", "Int32$random", "func(min=Int32.min, max=Int32.max -> Int32)"}, )}, {"Int16", Type(IntType, .bits=TYPE_IBITS16), "Int16_t", "Int16$info", TypedArray(ns_entry_t, - {"abs", "abs", "func(i:Int16)->Int16"}, - {"bits", "Int16$bits", "func(x:Int16)->[Bool]"}, - {"clamped", "Int16$clamped", "func(x,low,high:Int16)->Int16"}, - {"divided_by", "Int16$divided_by", "func(x,y:Int16)->Int16"}, - {"format", "Int16$format", "func(i:Int16, digits=0)->Text"}, - {"from_text", "Int16$from_text", "func(text:Text)->Int16?"}, - {"hex", "Int16$hex", "func(i:Int16, digits=0, uppercase=yes, prefix=yes)->Text"}, + {"abs", "abs", "func(i:Int16 -> Int16)"}, + {"bits", "Int16$bits", "func(x:Int16 -> [Bool])"}, + {"clamped", "Int16$clamped", "func(x,low,high:Int16 -> Int16)"}, + {"divided_by", "Int16$divided_by", "func(x,y:Int16 -> Int16)"}, + {"format", "Int16$format", "func(i:Int16, digits=0 -> Text)"}, + {"from_text", "Int16$from_text", "func(text:Text -> Int16?)"}, + {"hex", "Int16$hex", "func(i:Int16, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int16$max", "Int16"}, {"min", "Int16$min", "Int16"}, - {"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)->Range"}, + {"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 -> Range)"}, // Must be defined after min/max: - {"random", "Int16$random", "func(min=Int16.min, max=Int16.max)->Int16"}, + {"random", "Int16$random", "func(min=Int16.min, max=Int16.max -> Int16)"}, )}, {"Int8", Type(IntType, .bits=TYPE_IBITS8), "Int8_t", "Int8$info", TypedArray(ns_entry_t, - {"abs", "abs", "func(i:Int8)->Int8"}, - {"bits", "Int8$bits", "func(x:Int8)->[Bool]"}, - {"clamped", "Int8$clamped", "func(x,low,high:Int8)->Int8"}, - {"divided_by", "Int8$divided_by", "func(x,y:Int8)->Int8"}, - {"format", "Int8$format", "func(i:Int8, digits=0)->Text"}, - {"from_text", "Int8$from_text", "func(text:Text)->Int8?"}, - {"hex", "Int8$hex", "func(i:Int8, digits=0, uppercase=yes, prefix=yes)->Text"}, + {"abs", "abs", "func(i:Int8 -> Int8)"}, + {"bits", "Int8$bits", "func(x:Int8 -> [Bool])"}, + {"clamped", "Int8$clamped", "func(x,low,high:Int8 -> Int8)"}, + {"divided_by", "Int8$divided_by", "func(x,y:Int8 -> Int8)"}, + {"format", "Int8$format", "func(i:Int8, digits=0 -> Text)"}, + {"from_text", "Int8$from_text", "func(text:Text -> Int8?)"}, + {"hex", "Int8$hex", "func(i:Int8, digits=0, uppercase=yes, prefix=yes -> Text)"}, {"max", "Int8$max", "Int8"}, {"min", "Int8$min", "Int8"}, - {"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)->Range"}, + {"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 -> Range)"}, // Must be defined after min/max: - {"random", "Int8$random", "func(min=Int8.min, max=Int8.max)->Int8"}, + {"random", "Int8$random", "func(min=Int8.min, max=Int8.max -> Int8)"}, )}, #define C(name) {#name, "M_"#name, "Num"} -#define F(name) {#name, #name, "func(n:Num)->Num"} -#define F2(name) {#name, #name, "func(x,y:Num)->Num"} +#define F(name) {#name, #name, "func(n:Num -> Num)"} +#define F2(name) {#name, #name, "func(x,y:Num -> Num)"} {"Num", Type(NumType, .bits=TYPE_NBITS64), "Num_t", "Num$info", TypedArray(ns_entry_t, - {"near", "Num$near", "func(x,y:Num, ratio=1e-9, min_epsilon=1e-9)->Bool"}, - {"clamped", "Num$clamped", "func(x,low,high:Num)->Num"}, - {"format", "Num$format", "func(n:Num, precision=0)->Text"}, - {"scientific", "Num$scientific", "func(n:Num, precision=0)->Text"}, - {"nan", "Num$nan", "func(tag=\"\")->Num"}, - {"isinf", "Num$isinf", "func(n:Num)->Bool"}, - {"isfinite", "Num$isfinite", "func(n:Num)->Bool"}, - {"isnan", "Num$isnan", "func(n:Num)->Bool"}, + {"near", "Num$near", "func(x,y:Num, ratio=1e-9, min_epsilon=1e-9 -> Bool)"}, + {"clamped", "Num$clamped", "func(x,low,high:Num -> Num)"}, + {"format", "Num$format", "func(n:Num, precision=0 -> Text)"}, + {"scientific", "Num$scientific", "func(n:Num,precision=0 -> Text)"}, + {"nan", "Num$nan", "func(tag=\"\" -> Num)"}, + {"isinf", "Num$isinf", "func(n:Num -> Bool)"}, + {"isfinite", "Num$isfinite", "func(n:Num -> Bool)"}, + {"isnan", "Num$isnan", "func(n:Num -> Bool)"}, C(2_SQRTPI), C(E), C(PI_2), C(2_PI), C(1_PI), C(LN10), C(LN2), C(LOG2E), C(PI), C(PI_4), C(SQRT2), C(SQRT1_2), {"INF", "(Num_t)(INFINITY)", "Num"}, {"TAU", "(Num_t)(2.*M_PI)", "Num"}, - {"random", "Num$random", "func()->Num"}, - {"mix", "Num$mix", "func(amount,x,y:Num)->Num"}, - {"from_text", "Num$from_text", "func(text:Text)->Num?"}, - {"abs", "fabs", "func(n:Num)->Num"}, + {"random", "Num$random", "func(->Num)"}, + {"mix", "Num$mix", "func(amount,x,y:Num -> Num)"}, + {"from_text", "Num$from_text", "func(text:Text -> Num?)"}, + {"abs", "fabs", "func(n:Num -> Num)"}, F(acos), F(acosh), F(asin), F(asinh), F(atan), F(atanh), F(cbrt), F(ceil), F(cos), F(cosh), F(erf), F(erfc), F(exp), F(exp2), F(expm1), F(floor), F(j0), F(j1), F(log), F(log10), F(log1p), F(log2), F(logb), F(rint), F(round), F(significand), F(sin), F(sinh), F(sqrt), @@ -222,25 +222,25 @@ env_t *new_compilation_unit(CORD libname) #undef F #undef C #define C(name) {#name, "(Num32_t)(M_"#name")", "Num32"} -#define F(name) {#name, #name"f", "func(n:Num32)->Num32"} -#define F2(name) {#name, #name"f", "func(x,y:Num32)->Num32"} +#define F(name) {#name, #name"f", "func(n:Num32 -> Num32)"} +#define F2(name) {#name, #name"f", "func(x,y:Num32 -> Num32)"} {"Num32", Type(NumType, .bits=TYPE_NBITS32), "Num32_t", "Num32$info", TypedArray(ns_entry_t, - {"near", "Num32$near", "func(x,y:Num32, ratio=1e-9f32, min_epsilon=1e-9f32)->Bool"}, - {"clamped", "Num32$clamped", "func(x,low,high:Num32)->Num32"}, - {"format", "Num32$format", "func(n:Num32, precision=0)->Text"}, - {"scientific", "Num32$scientific", "func(n:Num32, precision=0)->Text"}, - {"nan", "Num32$nan", "func(tag=\"\")->Num32"}, - {"isinf", "Num32$isinf", "func(n:Num32)->Bool"}, - {"isfinite", "Num32$isfinite", "func(n:Num32)->Bool"}, - {"isnan", "Num32$isnan", "func(n:Num32)->Bool"}, + {"near", "Num32$near", "func(x,y:Num32, ratio=1e-9f32, min_epsilon=1e-9f32 -> Bool)"}, + {"clamped", "Num32$clamped", "func(x,low,high:Num32 -> Num32)"}, + {"format", "Num32$format", "func(n:Num32, precision=0 -> Text)"}, + {"scientific", "Num32$scientific", "func(n:Num32, precision=0 -> Text)"}, + {"nan", "Num32$nan", "func(tag=\"\" -> Num32)"}, + {"isinf", "Num32$isinf", "func(n:Num32 -> Bool)"}, + {"isfinite", "Num32$isfinite", "func(n:Num32 -> Bool)"}, + {"isnan", "Num32$isnan", "func(n:Num32 -> Bool)"}, C(2_SQRTPI), C(E), C(PI_2), C(2_PI), C(1_PI), C(LN10), C(LN2), C(LOG2E), C(PI), C(PI_4), C(SQRT2), C(SQRT1_2), {"INF", "(Num32_t)(INFINITY)", "Num32"}, {"TAU", "(Num32_t)(2.f*M_PI)", "Num32"}, - {"random", "Num32$random", "func()->Num32"}, - {"mix", "Num32$mix", "func(amount,x,y:Num32)->Num32"}, - {"from_text", "Num32$from_text", "func(text:Text)->Num32?"}, - {"abs", "fabsf", "func(n:Num32)->Num32"}, + {"random", "Num32$random", "func(->Num32)"}, + {"mix", "Num32$mix", "func(amount,x,y:Num32 -> Num32)"}, + {"from_text", "Num32$from_text", "func(text:Text -> Num32?)"}, + {"abs", "fabsf", "func(n:Num32 -> Num32)"}, F(acos), F(acosh), F(asin), F(asinh), F(atan), F(atanh), F(cbrt), F(ceil), F(cos), F(cosh), F(erf), F(erfc), F(exp), F(exp2), F(expm1), F(floor), F(j0), F(j1), F(log), F(log10), F(log1p), F(log2), F(logb), F(rint), F(round), F(significand), F(sin), F(sinh), F(sqrt), @@ -248,122 +248,122 @@ env_t *new_compilation_unit(CORD libname) F2(atan2), F2(copysign), F2(fdim), F2(hypot), F2(nextafter), F2(pow), F2(remainder), )}, {"CString", Type(CStringType), "char*", "CString$info", TypedArray(ns_entry_t, - {"as_text", "CString$as_text_simple", "func(str:CString)->Text"}, + {"as_text", "CString$as_text_simple", "func(str:CString -> Text)"}, )}, #undef F2 #undef F #undef C {"Range", RANGE_TYPE, "Range_t", "Range", TypedArray(ns_entry_t, - {"reversed", "Range$reversed", "func(range:Range)->Range"}, - {"by", "Range$by", "func(range:Range, step:Int)->Range"}, + {"reversed", "Range$reversed", "func(range:Range -> Range)"}, + {"by", "Range$by", "func(range:Range, step:Int -> Range)"}, )}, {"Pattern", Type(TextType, .lang="Pattern", .env=namespace_env(env, "Pattern")), "Pattern_t", "Pattern$info", TypedArray(ns_entry_t, - {"escape_int", "Int$value_as_text", "func(i:Int)->Pattern"}, - {"escape_text", "Pattern$escape_text", "func(text:Text)->Pattern"}, + {"escape_int", "Int$value_as_text", "func(i:Int -> Pattern)"}, + {"escape_text", "Pattern$escape_text", "func(text:Text -> Pattern)"}, )}, {"DateTime", Type(DateTimeType), "DateTime_t", "DateTime", TypedArray(ns_entry_t, // Used as a default for functions below: - {"now", "DateTime$now", "func()->DateTime"}, - - {"after", "DateTime$after", "func(dt:DateTime,seconds,minutes,hours=0.0,days,weeks,months,years=0,timezone=!Text)->DateTime"}, - {"date", "DateTime$date", "func(dt:DateTime,timezone=!Text)->Text"}, - {"format", "DateTime$format", "func(dt:DateTime,format=\"%Y-%m-%dT%H:%M:%S%z\",timezone=!Text)->Text"}, - {"from_unix_timestamp", "DateTime$from_unix_timestamp", "func(timestamp:Int64)->DateTime"}, - {"get", "DateTime$get", "func(dt:DateTime,year,month,day,hour,minute,second,nanosecond,weekday=!&Int, timezone=!Text)"}, - {"get_local_timezone", "DateTime$get_local_timezone", "func()->Text"}, - {"hours_till", "DateTime$hours_till", "func(now,then:DateTime)->Num"}, - {"minutes_till", "DateTime$minutes_till", "func(now,then:DateTime)->Num"}, - {"new", "DateTime$new", "func(year,month,day:Int,hour,minute=0,second=0.0,timezone=!Text)->DateTime"}, - {"parse", "DateTime$parse", "func(text:Text, format=\"%Y-%m-%dT%H:%M:%S%z\")->DateTime?"}, - {"relative", "DateTime$relative", "func(dt:DateTime,relative_to=DateTime.now(),timezone=!Text)->Text"}, - {"seconds_till", "DateTime$seconds_till", "func(now:DateTime,then:DateTime)->Num"}, + {"now", "DateTime$now", "func(->DateTime)"}, + + {"after", "DateTime$after", "func(dt:DateTime,seconds,minutes,hours=0.0,days,weeks,months,years=0,timezone=!Text -> DateTime)"}, + {"date", "DateTime$date", "func(dt:DateTime,timezone=!Text -> Text)"}, + {"format", "DateTime$format", "func(dt:DateTime,format=\"%Y-%m-%dT%H:%M:%S%z\",timezone=!Text -> Text)"}, + {"from_unix_timestamp", "DateTime$from_unix_timestamp", "func(timestamp:Int64 -> DateTime)"}, + {"get", "DateTime$get", "func(dt:DateTime,year,month,day,hour,minute,second,nanosecond,weekday=!&Int,timezone=!Text)"}, + {"get_local_timezone", "DateTime$get_local_timezone", "func(->Text)"}, + {"hours_till", "DateTime$hours_till", "func(now,then:DateTime -> Num)"}, + {"minutes_till", "DateTime$minutes_till", "func(now,then:DateTime -> Num)"}, + {"new", "DateTime$new", "func(year,month,day:Int,hour,minute=0,second=0.0,timezone=!Text -> DateTime)"}, + {"parse", "DateTime$parse", "func(text:Text, format=\"%Y-%m-%dT%H:%M:%S%z\" -> DateTime?)"}, + {"relative", "DateTime$relative", "func(dt:DateTime,relative_to=DateTime.now(),timezone=!Text -> Text)"}, + {"seconds_till", "DateTime$seconds_till", "func(now:DateTime,then:DateTime -> Num)"}, {"set_local_timezone", "DateTime$set_local_timezone", "func(timezone=!Text)"}, - {"time", "DateTime$time", "func(dt:DateTime,seconds=no,am_pm=yes,timezone=!Text)->Text"}, - {"unix_timestamp", "DateTime$unix_timestamp", "func(dt:DateTime)->Int64"}, + {"time", "DateTime$time", "func(dt:DateTime,seconds=no,am_pm=yes,timezone=!Text -> Text)"}, + {"unix_timestamp", "DateTime$unix_timestamp", "func(dt:DateTime -> Int64)"}, )}, {"Path", Type(TextType, .lang="Path", .env=namespace_env(env, "Path")), "Text_t", "Text$info", TypedArray(ns_entry_t, {"append", "Path$append", "func(path:Path, text:Text, permissions=0o644[32])"}, {"append_bytes", "Path$append_bytes", "func(path:Path, bytes:[Byte], permissions=0o644[32])"}, - {"base_name", "Path$base_name", "func(path:Path)->Text"}, - {"by_line", "Path$by_line", "func(path:Path)->(func()->Text?)?"}, - {"children", "Path$children", "func(path:Path, include_hidden=no)->[Path]"}, + {"base_name", "Path$base_name", "func(path:Path -> Text)"}, + {"by_line", "Path$by_line", "func(path:Path -> func(->Text?)?)"}, + {"children", "Path$children", "func(path:Path, include_hidden=no -> [Path])"}, {"create_directory", "Path$create_directory", "func(path:Path, permissions=0o755[32])"}, - {"escape_int", "Int$value_as_text", "func(i:Int)->Path"}, - {"escape_path", "Path$escape_path", "func(path:Path)->Path"}, - {"escape_text", "Path$escape_text", "func(text:Text)->Path"}, - {"exists", "Path$exists", "func(path:Path)->Bool"}, - {"extension", "Path$extension", "func(path:Path, full=yes)->Text"}, - {"files", "Path$children", "func(path:Path, include_hidden=no)->[Path]"}, - {"is_directory", "Path$is_directory", "func(path:Path, follow_symlinks=yes)->Bool"}, - {"is_file", "Path$is_file", "func(path:Path, follow_symlinks=yes)->Bool"}, - {"is_pipe", "Path$is_pipe", "func(path:Path, follow_symlinks=yes)->Bool"}, - {"is_socket", "Path$is_socket", "func(path:Path, follow_symlinks=yes)->Bool"}, - {"is_symlink", "Path$is_symlink", "func(path:Path)->Bool"}, - {"parent", "Path$parent", "func(path:Path)->Path"}, - {"read", "Path$read", "func(path:Path)->Text?"}, - {"read_bytes", "Path$read_bytes", "func(path:Path)->[Byte]?"}, - {"relative", "Path$relative", "func(path:Path, relative_to=(./))->Path"}, + {"escape_int", "Int$value_as_text", "func(i:Int -> Path)"}, + {"escape_path", "Path$escape_path", "func(path:Path -> Path)"}, + {"escape_text", "Path$escape_text", "func(text:Text -> Path)"}, + {"exists", "Path$exists", "func(path:Path -> Bool)"}, + {"extension", "Path$extension", "func(path:Path, full=yes -> Text)"}, + {"files", "Path$children", "func(path:Path, include_hidden=no -> [Path])"}, + {"is_directory", "Path$is_directory", "func(path:Path, follow_symlinks=yes -> Bool)"}, + {"is_file", "Path$is_file", "func(path:Path, follow_symlinks=yes -> Bool)"}, + {"is_pipe", "Path$is_pipe", "func(path:Path, follow_symlinks=yes -> Bool)"}, + {"is_socket", "Path$is_socket", "func(path:Path, follow_symlinks=yes -> Bool)"}, + {"is_symlink", "Path$is_symlink", "func(path:Path -> Bool)"}, + {"parent", "Path$parent", "func(path:Path -> Path)"}, + {"read", "Path$read", "func(path:Path -> Text?)"}, + {"read_bytes", "Path$read_bytes", "func(path:Path -> [Byte]?)"}, + {"relative", "Path$relative", "func(path:Path, relative_to=(./) -> Path)"}, {"remove", "Path$remove", "func(path:Path, ignore_missing=no)"}, - {"resolved", "Path$resolved", "func(path:Path, relative_to=(./))->Path"}, - {"subdirectories", "Path$children", "func(path:Path, include_hidden=no)->[Path]"}, - {"unique_directory", "Path$unique_directory", "func(path:Path)->Path"}, + {"resolved", "Path$resolved", "func(path:Path, relative_to=(./) -> Path)"}, + {"subdirectories", "Path$children", "func(path:Path, include_hidden=no -> [Path])"}, + {"unique_directory", "Path$unique_directory", "func(path:Path -> Path)"}, {"write", "Path$write", "func(path:Path, text:Text, permissions=0o644[32])"}, {"write_bytes", "Path$write_bytes", "func(path:Path, bytes:[Byte], permissions=0o644[32])"}, - {"write_unique", "Path$write_unique", "func(path:Path, text:Text)->Path"}, - {"write_unique_bytes", "Path$write_unique_bytes", "func(path:Path, bytes:[Byte])->Path"}, + {"write_unique", "Path$write_unique", "func(path:Path, text:Text -> Path)"}, + {"write_unique_bytes", "Path$write_unique_bytes", "func(path:Path, bytes:[Byte] -> Path)"}, - {"modified", "Path$modified", "func(path:Path, follow_symlinks=yes)->DateTime?"}, - {"accessed", "Path$accessed", "func(path:Path, follow_symlinks=yes)->DateTime?"}, - {"changed", "Path$changed", "func(path:Path, follow_symlinks=yes)->DateTime?"}, + {"modified", "Path$modified", "func(path:Path, follow_symlinks=yes -> DateTime?)"}, + {"accessed", "Path$accessed", "func(path:Path, follow_symlinks=yes -> DateTime?)"}, + {"changed", "Path$changed", "func(path:Path, follow_symlinks=yes -> DateTime?)"}, // Text methods: - {"ends_with", "Text$ends_with", "func(path:Path, suffix:Text)->Bool"}, - {"has", "Text$has", "func(path:Path, pattern:Pattern)->Bool"}, - {"matches", "Text$matches", "func(path:Path, pattern:Pattern)->[Text]?"}, - {"replace", "Text$replace", "func(path:Path, pattern:Pattern, replacement:Text, backref=$/\\/, recursive=yes)->Path"}, - {"replace_all", "Text$replace_all", "func(path:Path, replacements:{Pattern:Text}, backref=$/\\/, recursive=yes)->Path"}, - {"starts_with", "Text$starts_with", "func(path:Path, prefix:Text)->Bool"}, + {"ends_with", "Text$ends_with", "func(path:Path, suffix:Text -> Bool)"}, + {"has", "Text$has", "func(path:Path, pattern:Pattern -> Bool)"}, + {"matches", "Text$matches", "func(path:Path, pattern:Pattern -> [Text]?)"}, + {"replace", "Text$replace", "func(path:Path, pattern:Pattern, replacement:Text, backref=$/\\/, recursive=yes -> Path)"}, + {"replace_all", "Text$replace_all", "func(path:Path, replacements:{Pattern:Text}, backref=$/\\/, recursive=yes -> Path)"}, + {"starts_with", "Text$starts_with", "func(path:Path, prefix:Text -> Bool)"}, )}, {"Shell", Type(TextType, .lang="Shell", .env=namespace_env(env, "Shell")), "Shell_t", "Shell$info", TypedArray(ns_entry_t, - {"by_line", "Shell$by_line", "func(command:Shell)->(func()->Text?)?"}, - {"escape_int", "Int$value_as_text", "func(i:Int)->Shell"}, - {"escape_text", "Shell$escape_text", "func(text:Text)->Shell"}, - {"escape_text_array", "Shell$escape_text_array", "func(texts:[Text])->Shell"}, - {"run_bytes", "Shell$run", "func(command:Shell)->[Byte]?"}, - {"run", "Shell$run", "func(command:Shell)->Text?"}, + {"by_line", "Shell$by_line", "func(command:Shell -> func(->Text?)?)"}, + {"escape_int", "Int$value_as_text", "func(i:Int -> Shell)"}, + {"escape_text", "Shell$escape_text", "func(text:Text -> Shell)"}, + {"escape_text_array", "Shell$escape_text_array", "func(texts:[Text] -> Shell)"}, + {"run_bytes", "Shell$run", "func(command:Shell -> [Byte]?)"}, + {"run", "Shell$run", "func(command:Shell -> Text?)"}, )}, {"Text", TEXT_TYPE, "Text_t", "Text$info", TypedArray(ns_entry_t, - {"as_c_string", "Text$as_c_string", "func(text:Text)->CString"}, - {"codepoint_names", "Text$codepoint_names", "func(text:Text)->[Text]"}, - {"ends_with", "Text$ends_with", "func(text,suffix:Text)->Bool"}, - {"find", "Text$find", "func(text:Text, pattern:Pattern, start=1, length=!&Int64)->Int"}, - {"find_all", "Text$find_all", "func(text:Text, pattern:Pattern)->[Text]"}, - {"from_bytes", "Text$from_bytes", "func(bytes:[Byte])->Text"}, - {"from_c_string", "Text$from_str", "func(str:CString)->Text"}, - {"from_codepoint_names", "Text$from_codepoint_names", "func(codepoint_names:[Text])->Text"}, - {"from_codepoints", "Text$from_codepoints", "func(codepoints:[Int32])->Text"}, - {"without_escaping", "Path$cleanup", "func(text:Text)->Path"}, - {"has", "Text$has", "func(text:Text, pattern:Pattern)->Bool"}, - {"join", "Text$join", "func(glue:Text, pieces:[Text])->Text"}, - {"lines", "Text$lines", "func(text:Text)->[Text]"}, - {"lower", "Text$lower", "func(text:Text)->Text"}, - {"map", "Text$map", "func(text:Text, pattern:Pattern, fn:func(text:Text)->Text)->Text"}, - {"matches", "Text$matches", "func(text:Text, pattern:Pattern)->[Text]?"}, - {"quoted", "Text$quoted", "func(text:Text, color=no)->Text"}, - {"repeat", "Text$repeat", "func(text:Text, count:Int)->Text"}, - {"replace", "Text$replace", "func(text:Text, pattern:Pattern, replacement:Text, backref=$/\\/, recursive=yes)->Text"}, - {"replace_all", "Text$replace_all", "func(text:Text, replacements:{Pattern:Text}, backref=$/\\/, recursive=yes)->Text"}, - {"slice", "Text$slice", "func(text:Text, from=1, to=-1)->Text"}, - {"split", "Text$split", "func(text:Text, pattern=$Pattern'')->[Text]"}, - {"starts_with", "Text$starts_with", "func(text,prefix:Text)->Bool"}, - {"title", "Text$title", "func(text:Text)->Text"}, - {"trim", "Text$trim", "func(text:Text, pattern=$/{whitespace}/, trim_left=yes, trim_right=yes)->Text"}, - {"upper", "Text$upper", "func(text:Text)->Text"}, - {"utf32_codepoints", "Text$utf32_codepoints", "func(text:Text)->[Int32]"}, - {"utf8_bytes", "Text$utf8_bytes", "func(text:Text)->[Byte]"}, + {"as_c_string", "Text$as_c_string", "func(text:Text -> CString)"}, + {"codepoint_names", "Text$codepoint_names", "func(text:Text -> [Text])"}, + {"ends_with", "Text$ends_with", "func(text,suffix:Text -> Bool)"}, + {"find", "Text$find", "func(text:Text, pattern:Pattern, start=1, length=!&Int64 -> Int)"}, + {"find_all", "Text$find_all", "func(text:Text, pattern:Pattern -> [Text])"}, + {"from_bytes", "Text$from_bytes", "func(bytes:[Byte] -> Text)"}, + {"from_c_string", "Text$from_str", "func(str:CString -> Text)"}, + {"from_codepoint_names", "Text$from_codepoint_names", "func(codepoint_names:[Text] -> Text)"}, + {"from_codepoints", "Text$from_codepoints", "func(codepoints:[Int32] -> Text)"}, + {"without_escaping", "Path$cleanup", "func(text:Text -> Path)"}, + {"has", "Text$has", "func(text:Text, pattern:Pattern -> Bool)"}, + {"join", "Text$join", "func(glue:Text, pieces:[Text] -> Text)"}, + {"lines", "Text$lines", "func(text:Text -> [Text])"}, + {"lower", "Text$lower", "func(text:Text -> Text)"}, + {"map", "Text$map", "func(text:Text, pattern:Pattern, fn:func(text:Text -> Text) -> Text)"}, + {"matches", "Text$matches", "func(text:Text, pattern:Pattern -> [Text]?)"}, + {"quoted", "Text$quoted", "func(text:Text, color=no -> Text)"}, + {"repeat", "Text$repeat", "func(text:Text, count:Int -> Text)"}, + {"replace", "Text$replace", "func(text:Text, pattern:Pattern, replacement:Text, backref=$/\\/, recursive=yes -> Text)"}, + {"replace_all", "Text$replace_all", "func(text:Text, replacements:{Pattern:Text}, backref=$/\\/, recursive=yes -> Text)"}, + {"slice", "Text$slice", "func(text:Text, from=1, to=-1 -> Text)"}, + {"split", "Text$split", "func(text:Text, pattern=$Pattern'' -> [Text])"}, + {"starts_with", "Text$starts_with", "func(text,prefix:Text -> Bool)"}, + {"title", "Text$title", "func(text:Text -> Text)"}, + {"trim", "Text$trim", "func(text:Text, pattern=$/{whitespace}/, trim_left=yes, trim_right=yes -> Text)"}, + {"upper", "Text$upper", "func(text:Text -> Text)"}, + {"utf32_codepoints", "Text$utf32_codepoints", "func(text:Text -> [Int32])"}, + {"utf8_bytes", "Text$utf8_bytes", "func(text:Text -> [Byte])"}, )}, {"Thread", THREAD_TYPE, "Thread_t", "Thread", TypedArray(ns_entry_t, - {"new", "Thread$new", "func(fn:func())->Thread"}, + {"new", "Thread$new", "func(fn:func() -> Thread)"}, {"cancel", "Thread$cancel", "func(thread:Thread)"}, {"join", "Thread$join", "func(thread:Thread)"}, {"detach", "Thread$detach", "func(thread:Thread)"}, |
