mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
Add release-array
This commit is contained in:
parent
71bb8bcaae
commit
4bb6829378
1 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,11 @@ s" Index out of range" exception constant OUT-OF-RANGE export
|
||||||
allocate-array
|
allocate-array
|
||||||
; export
|
; export
|
||||||
|
|
||||||
|
: release-array ( arr -- )
|
||||||
|
dup array>buf @ free
|
||||||
|
free
|
||||||
|
; export
|
||||||
|
|
||||||
: array-size ( arr -- n ) array>size @ ; export
|
: array-size ( arr -- n ) array>size @ ; export
|
||||||
|
|
||||||
: check-index ( i arr -- )
|
: check-index ( i arr -- )
|
||||||
|
@ -135,3 +140,4 @@ T{ 1 0 A array! -> }T
|
||||||
T{ 0 A array@ -> 1 }T
|
T{ 0 A array@ -> 1 }T
|
||||||
T{ 2 99 A array! -> }T
|
T{ 2 99 A array! -> }T
|
||||||
T{ 99 A array@ -> 2 }T
|
T{ 99 A array@ -> 2 }T
|
||||||
|
T{ A release-array -> }T
|
||||||
|
|
Loading…
Reference in a new issue