Verified Commit 5c871ed2 authored by Camil Staps's avatar Camil Staps 🐧

Merge remote-tracking branch 'git-svn'

parents 40d65ed5 1cc2fb84
......@@ -273,3 +273,5 @@ sfposition :: !File -> Int
* Change a file so that from now it can only be used with `sf...` operations.
*/
fshare :: !*File -> File
fflush :: !*File -> (!Bool,!*File)
......@@ -482,9 +482,7 @@ instance FileEnv World where
appFiles :: !.(*Files -> *Files) !*World -> *World
appFiles appfun world
#! files1=create_files
// RWS ... #! files=appfun files
files=appfun files1
// .. RWS
= do_files files world
where
do_files :: !*Files !*World -> *World
......@@ -495,3 +493,10 @@ instance FileEnv World where
}
create_files :== Files;
fflush :: !*File -> (!Bool,!*File)
fflush f = code {
.d 0 2 f
jsr flushF
.o 0 3 bf
}
......@@ -67,3 +67,10 @@ instance atanh Real // Arc Hyperbolic Tangent, partial function, only defined i
* @result The largest integer smaller than the parameter
*/
entier :: !Real -> Int
Infinity :== 1E9999
NaN :== 1E9999+(-1E9999)
isNaN x :== if (x==x) False True
isInfinity x :== if (abs x==1E9999) True False
isFinite x :== if (x-x==0.0) True False
......@@ -325,3 +325,10 @@ entier a
= code inline {
entierR
}
Infinity :== 1E9999
NaN :== 1E9999+(-1E9999)
isNaN x :== if (x==x) False True
isInfinity x :== if (abs x==1E9999) True False
isFinite x :== if (x-x==0.0) True False
......@@ -69,20 +69,58 @@ class Array .a e where
*/
replace :: !*(a .e) !Int .e -> *(.e, !*(a .e))
instance Array {!} a where
uselect :: !u:{! e} !Int -> *(!e, !u:{! e})
update :: !*{! .e} !Int !.e -> *{! .e}
createArray :: !Int !e -> *{! e}
replace :: !*{! .e} !Int !.e -> *(!.e, !*{! .e})
instance Array {!} a
instance Array {#} Int where
uselect :: !u:{# Int} !Int -> *(!Int, !u:{# Int})
update :: !*{# e:Int} !Int !e:Int -> *{# e:Int}
createArray :: !Int !Int -> *{# Int}
replace :: !*{# e:Int} !Int !e:Int -> *(!e:Int, !*{# e:Int})
instance Array {#} Int
instance Array {#} Char
instance Array {#} Real
instance Array {#} Bool
instance Array {#} Char where
uselect :: !u:{# Char} !Int -> *(!Char, !u:{# Char})
update :: !*{# e:Char} !Int !e:Char -> *{# e:Char}
createArray :: !Int !Char -> *{# Char}
replace :: !*{# e:Char} !Int !e:Char -> *(!e:Char, !*{# e:Char})
instance Array {#} {#.a}
instance Array {#} {!.a}
instance Array {#} {.a}
instance Array {#} Real where
uselect :: !u:{# Real} !Int -> *(!Real, !u:{# Real})
update :: !*{# e:Real} !Int !e:Real -> *{# e:Real}
createArray :: !Int !Real -> *{# Real}
replace :: !*{# e:Real} !Int !e:Real -> *(!e:Real, !*{# e:Real})
instance Array {#} a
instance Array {#} Bool where
uselect :: !u:{# Bool} !Int -> *(!Bool, !u:{# Bool})
update :: !*{# e:Bool} !Int !e:Bool -> *{# e:Bool}
createArray :: !Int !Bool -> *{# Bool}
replace :: !*{# e:Bool} !Int !e:Bool -> *(!e:Bool, !*{# e:Bool})
//instance Array {#} File
instance Array {#} {#.a} where
uselect :: !u:{#{#.a}} !Int -> *(!{#.a},!u:{#{#.a}})
update :: !*{#u:{#.a}} !Int !u:{#.a} -> *{#u:{#.a}}
createArray :: !Int !{#.a} -> *{# {#.a}}
replace :: !*{#u:{#.a}} !Int !u:{#.a} -> *(!u:{#.a},!*{#u:{#.a}})
instance Array {#} {!.a} where
uselect :: !u:{#{!.a}} !Int -> *(!{!.a},!u:{#{!.a}})
update :: !*{#u:{!.a}} !Int !u:{!.a} -> *{#u:{!.a}}
createArray :: !Int !{!.a} -> *{# {!.a}}
replace :: !*{#u:{!.a}} !Int !u:{!.a} -> *(!u:{!.a},!*{#u:{!.a}})
instance Array {#} {.a} where
uselect :: !u:{#{.a}} !Int -> *(!{.a},!u:{#{.a}})
update :: !*{#u:{.a}} !Int !u:{.a} -> *{#u:{.a}}
createArray :: !Int !{.a} -> *{# {.a}}
replace :: !*{#u:{.a}} !Int !u:{.a} -> *(!u:{.a},!*{#u:{.a}})
instance Array {#} a where
uselect :: !u:{# e} !Int -> *(!e, !u:{# e})
update :: !*{# .e} !Int !.e -> *{# .e}
createArray :: !Int !e -> *{# e}
replace :: !*{# .e} !Int !.e -> *(!.e, !*{# .e})
instance Array {} a
......@@ -16,6 +16,7 @@ instance Array {#} Int where
{
select INT 0 1
}
uselect :: !u:{# Int} !Int -> *(!Int, !u:{# Int})
uselect arr index =
code
{
......@@ -33,16 +34,19 @@ instance Array {#} Int where
push_a 0
push_arraysize INT 0 1
}
update :: !*{# e:Int} !Int !e:Int -> *{# e:Int}
update arr index el =
code
{
update INT 0 1
}
createArray :: !Int !Int -> *{# Int}
createArray size el =
code
{
create_array INT 0 1
}
}
replace :: !*{# e:Int} !Int !e:Int -> *(!e:Int, !*{# e:Int})
replace arr index el =
code
{
......@@ -60,6 +64,7 @@ instance Array {#} Char where
{
select CHAR 0 1
}
uselect :: !u:{# Char} !Int -> *(!Char, !u:{# Char})
uselect arr index =
code
{
......@@ -77,16 +82,19 @@ instance Array {#} Char where
push_a 0
push_arraysize CHAR 0 1
}
update :: !*{# e:Char} !Int !e:Char -> *{# e:Char}
update arr index el =
code
{
update CHAR 0 1
}
createArray :: !Int !Char -> *{# Char}
createArray size el =
code
{
create_array CHAR 0 1
}
replace :: !*{# e:Char} !Int !e:Char -> *(!e:Char, !*{# e:Char})
replace arr index el =
code
{
......@@ -104,6 +112,7 @@ instance Array {#} Real where
{
select REAL 0 1
}
uselect :: !u:{# Real} !Int -> *(!Real, !u:{# Real})
uselect arr index =
code
{
......@@ -121,16 +130,19 @@ instance Array {#} Real where
push_a 0
push_arraysize REAL 0 1
}
update :: !*{# e:Real} !Int !e:Real -> *{# e:Real}
update arr index el =
code
{
update REAL 0 1
}
createArray :: !Int !Real -> *{# Real}
createArray size el =
code
{
create_array REAL 0 1
}
replace :: !*{# e:Real} !Int !e:Real -> *(!e:Real, !*{# e:Real})
replace arr index el =
code
{
......@@ -148,6 +160,7 @@ instance Array {#} Bool where
{
select BOOL 0 1
}
uselect :: !u:{# Bool} !Int -> *(!Bool, !u:{# Bool})
uselect arr index =
code
{
......@@ -165,16 +178,19 @@ instance Array {#} Bool where
push_a 0
push_arraysize BOOL 0 1
}
update :: !*{# e:Bool} !Int !e:Bool -> *{# e:Bool}
update arr index el =
code
{
update BOOL 0 1
}
createArray :: !Int !Bool -> *{# Bool}
createArray size el =
code
{
create_array BOOL 0 1
}
replace :: !*{# e:Bool} !Int !e:Bool -> *(!e:Bool, !*{# e:Bool})
replace arr index el =
code
{
......@@ -192,6 +208,7 @@ instance Array {#} {#.a} where
{
select _ 1 0
}
uselect :: !u:{#{#.a}} !Int -> *(!{#.a},!u:{#{#.a}})
uselect arr index =
code
{
......@@ -209,16 +226,19 @@ instance Array {#} {#.a} where
push_a 0
push_arraysize _ 1 0
}
update :: !*{#u:{#.a}} !Int !u:{#.a} -> *{#u:{#.a}}
update arr index el =
code
{
update _ 1 0
}
createArray :: !Int !{#.a} -> *{# {#.a}}
createArray size el =
code
{
create_array _ 1 0
}
}
replace :: !*{#u:{#.a}} !Int !u:{#.a} -> *(!u:{#.a},!*{#u:{#.a}})
replace arr index el =
code
{
......@@ -236,6 +256,7 @@ instance Array {#} {!.a} where
{
select _ 1 0
}
uselect :: !u:{#{!.a}} !Int -> *(!{!.a},!u:{#{!.a}})
uselect arr index =
code
{
......@@ -253,16 +274,19 @@ instance Array {#} {!.a} where
push_a 0
push_arraysize _ 1 0
}
update :: !*{#u:{!.a}} !Int !u:{!.a} -> *{#u:{!.a}}
update arr index el =
code
{
update _ 1 0
}
createArray :: !Int !{!.a} -> *{# {!.a}}
createArray size el =
code
{
create_array _ 1 0
}
}
replace :: !*{#u:{!.a}} !Int !u:{!.a} -> *(!u:{!.a},!*{#u:{!.a}})
replace arr index el =
code
{
......@@ -280,6 +304,7 @@ instance Array {#} {.a} where
{
select _ 1 0
}
uselect :: !u:{#{.a}} !Int -> *(!{.a},!u:{#{.a}})
uselect arr index =
code
{
......@@ -297,16 +322,19 @@ instance Array {#} {.a} where
push_a 0
push_arraysize _ 1 0
}
update :: !*{#u:{.a}} !Int !u:{.a} -> *{#u:{.a}}
update arr index el =
code
{
update _ 1 0
}
createArray :: !Int !{.a} -> *{# {.a}}
createArray size el =
code
{
create_array _ 1 0
}
}
replace :: !*{#u:{.a}} !Int !u:{.a} -> *(!u:{.a},!*{#u:{.a}})
replace arr index el =
code
{
......@@ -328,6 +356,7 @@ instance Array {#} a where
.o 0 0
halt
}
uselect :: !u:{# e} !Int -> *(!e, !u:{# e})
uselect arr index =
code
{
......@@ -355,6 +384,7 @@ instance Array {#} a where
.o 0 0
halt
}
update :: !*{# .e} !Int !.e -> *{# .e}
update arr index el =
code
{
......@@ -364,6 +394,7 @@ instance Array {#} a where
.o 0 0
halt
}
createArray :: !Int !e -> *{# e}
createArray size el =
code
{
......@@ -373,6 +404,7 @@ instance Array {#} a where
.o 0 0
halt
}
replace :: !*{# .e} !Int !.e -> *(!.e, !*{# .e})
replace arr index el =
code
{
......@@ -398,6 +430,7 @@ instance Array {!} a where
{
select _ 1 0
}
uselect :: !u:{! e} !Int -> *(!e, !u:{! e})
uselect arr index =
code
{
......@@ -415,16 +448,19 @@ instance Array {!} a where
push_a 0
push_arraysize _ 1 0
}
update :: !*{! .e} !Int !.e -> *{! .e}
update arr index el =
code
{
update _ 1 0
}
createArray :: !Int !e -> *{! e}
createArray size el =
code
{
create_array _ 1 0
}
replace :: !*{! .e} !Int !.e -> *(!.e, !*{! .e})
replace arr index el =
code
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment