INT32 and REAL32 support for create_array_
Currently, the code generated for create_array_ INT32 0 1 uses _create_r_array in the run-time system. Should this not be _create_arrayI32? For create_array, create_arrayI32 is used (as expected).
I'm trying to get the following to work. This is one possible problem that I see, but also after changing to _create_arrayI32 this does not work yet (update is never used):
import StdEnv
:: Array32 a = Array32 ()
instance Array Array32 Int
where
select _ _ = code {
select INT32 0 1
}
uselect :: !u:(Array32 Int) !Int -> *(!Int, !u:(Array32 Int))
uselect _ _ = code {
push_a 0
select INT32 0 1
}
size _ = code {
push_arraysize INT32 0 1
}
usize _ = code {
push_a 0
push_arraysize INT32 0 1
}
update :: !*(Array32 e:Int) !Int !e:Int -> *Array32 e:Int
update _ _ _ = code {
update INT32 0 1
}
createArray :: !Int !Int -> *Array32 Int
createArray _ _ = code {
create_array INT32 0 1
}
_createArray _ = code {
create_array_ INT32 0 1
}
replace :: !*(Array32 e:Int) !Int !e:Int -> *(!e:Int, !*Array32 e:Int)
replace _ _ _ = code {
replace INT32 0 1
}
Start
# xs = [1..10]
= [x \\ x <-: is_array32 {x \\ x <- xs}]
where
is_array32 :: !(Array32 Int) -> Array32 Int
is_array32 xs = xs