Commit 5ab7b0ad authored by John van Groningen's avatar John van Groningen

Merge branch 'add-default-array-instance-for-packed-arrays' into 'master'

Add default instance Array {32#} a for packed arrays

See merge request clean-compiler-and-rts/stdenv!8
parents c24e0196 7a8d4c1a
......@@ -76,4 +76,10 @@ instance Array {32#} Real where
createArray :: !Int !Real -> *{32# Real}
replace :: !*{32# e:Real} !Int !e:Real -> *(!e:Real, !*{32# e:Real})
instance Array {32#} a where
uselect :: !u:{32# e} !Int -> *(!e, !u:{32# e})
update :: !*{32# .e} !Int !.e -> *{32# .e}
createArray :: !Int !e -> *{32# e}
replace :: !*{32# .e} !Int !.e -> *(!.e, !*{32# .e})
instance Array {} a
......@@ -520,6 +520,84 @@ instance Array {32#} Int where
create_array_ INT32 0 1
}
instance Array {32#} a where
select arr index =
code
{
buildAC "StdArray:select ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
uselect :: !u:{32# e} !Int -> *(!e, !u:{32# e})
uselect arr index =
code
{
buildAC "StdArray:uselect ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
size arr =
code
{
buildAC "StdArray:size ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
usize arr =
code
{
buildAC "StdArray:usize ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
update :: !*{32# .e} !Int !.e -> *{32# .e}
update arr index el =
code
{
buildAC "StdArray:update ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
createArray :: !Int !e -> *{32# e}
createArray size el =
code
{
buildAC "StdArray:createArray ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
replace :: !*{32# .e} !Int !.e -> *(!.e, !*{32# .e})
replace arr index el =
code
{
buildAC "StdArray:replace ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
_createArray size =
code
{
buildAC "StdArray:_createArray ({32#} a) should not be called"
.d 1 0
jsr print_string_
.o 0 0
halt
}
instance Array {!} a where
select arr index =
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