This commit is contained in:
Brad Nelson
2024-11-15 20:03:00 -08:00
parent eeb10b4bcd
commit 0c9ba3ef86

View File

@ -35,7 +35,7 @@ variable arp arstack arp !
1 constant STRING 1 constant STRING
2 constant INTEGER 2 constant INTEGER
3 constant REAL 3 constant REAL
create array-sizes cell , 1 , cell , 4 , create array-sizes cell , 1 , cell , sfloat ,
: >esize ( type -- n ) cells array-sizes + @ ; : >esize ( type -- n ) cells array-sizes + @ ;
( ref n type ^data... ) ( ref n type ^data... )
@ -50,7 +50,7 @@ create array-sizes cell , 1 , cell , 4 ,
: range ( a -- a n ) dup >count @ ; : range ( a -- a n ) dup >count @ ;
( Create an uninitialized array ) ( Create an uninitialized array )
: array ( n type -- a ) : array ( n type -- a: a )
2dup >esize * header-size + allocate throw header-size + apush 2dup >esize * header-size + allocate throw header-size + apush
top >type ! top >count ! 0 top >ref ! ; top >type ! top >count ! 0 top >ref ! ;