Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
StdEnv-doc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cloogle
StdEnv-doc
Commits
e1eb2b96
Verified
Commit
e1eb2b96
authored
Apr 24, 2020
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add {32#} instances for Array for Int and Real
parent
18a26c2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
0 deletions
+108
-0
_SystemArray.dcl
_SystemArray.dcl
+12
-0
_SystemArray.icl
_SystemArray.icl
+96
-0
No files found.
_SystemArray.dcl
View file @
e1eb2b96
...
...
@@ -64,4 +64,16 @@ instance Array {#} a where
createArray
::
!
Int
!
e
->
*{#
e
}
replace
::
!*{#
.
e
}
!
Int
!.
e
->
*(!.
e
,
!*{#
.
e
})
instance
Array
{
32
#}
Int
where
uselect
::
!
u
:{
32
#
Int
}
!
Int
->
*(!
Int
,
!
u
:{
32
#
Int
})
update
::
!*{
32
#
e
:
Int
}
!
Int
!
e
:
Int
->
*{
32
#
e
:
Int
}
createArray
::
!
Int
!
Int
->
*{
32
#
Int
}
replace
::
!*{
32
#
e
:
Int
}
!
Int
!
e
:
Int
->
*(!
e
:
Int
,
!*{
32
#
e
:
Int
})
instance
Array
{
32
#}
Real
where
uselect
::
!
u
:{
32
#
Real
}
!
Int
->
*(!
Real
,
!
u
:{
32
#
Real
})
update
::
!*{
32
#
e
:
Real
}
!
Int
!
e
:
Real
->
*{
32
#
e
:
Real
}
createArray
::
!
Int
!
Real
->
*{
32
#
Real
}
replace
::
!*{
32
#
e
:
Real
}
!
Int
!
e
:
Real
->
*(!
e
:
Real
,
!*{
32
#
e
:
Real
})
instance
Array
{}
a
_SystemArray.icl
View file @
e1eb2b96
...
...
@@ -424,6 +424,102 @@ instance Array {#} a where
halt
}
instance
Array
{
32
#}
Real
where
select
arr
index
=
code
{
select
REAL32
0
1
}
uselect
::
!
u
:{
32
#
Real
}
!
Int
->
*(!
Real
,
!
u
:{
32
#
Real
})
uselect
arr
index
=
code
{
push_a
0
select
REAL32
0
1
}
size
arr
=
code
{
push_arraysize
REAL32
0
1
}
usize
arr
=
code
{
push_a
0
push_arraysize
REAL32
0
1
}
update
::
!*{
32
#
e
:
Real
}
!
Int
!
e
:
Real
->
*{
32
#
e
:
Real
}
update
arr
index
el
=
code
{
update
REAL32
0
1
}
createArray
::
!
Int
!
Real
->
*{
32
#
Real
}
createArray
size
el
=
code
{
create_array
REAL32
0
1
}
replace
::
!*{
32
#
e
:
Real
}
!
Int
!
e
:
Real
->
*(!
e
:
Real
,
!*{
32
#
e
:
Real
})
replace
arr
index
el
=
code
{
replace
REAL32
0
1
}
_createArray
size
=
code
{
create_array_
REAL32
0
1
}
instance
Array
{
32
#}
Int
where
select
arr
index
=
code
{
select
INT32
0
1
}
uselect
::
!
u
:{
32
#
Int
}
!
Int
->
*(!
Int
,
!
u
:{
32
#
Int
})
uselect
arr
index
=
code
{
push_a
0
select
INT32
0
1
}
size
arr
=
code
{
push_arraysize
INT32
0
1
}
usize
arr
=
code
{
push_a
0
push_arraysize
INT32
0
1
}
update
::
!*{
32
#
e
:
Int
}
!
Int
!
e
:
Int
->
*{
32
#
e
:
Int
}
update
arr
index
el
=
code
{
update
INT32
0
1
}
createArray
::
!
Int
!
Int
->
*{
32
#
Int
}
createArray
size
el
=
code
{
create_array
INT32
0
1
}
replace
::
!*{
32
#
e
:
Int
}
!
Int
!
e
:
Int
->
*(!
e
:
Int
,
!*{
32
#
e
:
Int
})
replace
arr
index
el
=
code
{
replace
INT32
0
1
}
_createArray
size
=
code
{
create_array_
INT32
0
1
}
instance
Array
{!}
a
where
select
arr
index
=
code
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment