tweak specialized-arrays to box values returned by nth

db4
Joe Groff 2009-02-09 15:38:07 -06:00
parent d24b03098a
commit db6706434d
4 changed files with 6 additions and 6 deletions

View File

@ -185,6 +185,9 @@ M: f byte-length drop 0 ;
[ "Cannot read struct fields with this type" throw ]
] unless* ;
: c-type-getter-boxer ( name -- quot )
[ c-getter ] [ c-type-boxer-quot ] bi append ;
: c-setter ( name -- quot )
c-type-setter [
[ "Cannot write struct fields with this type" throw ]

View File

@ -58,10 +58,7 @@ PREDICATE: slot-writer < word "writing" word-prop >boolean ;
: define-getter ( type spec -- )
[ set-reader-props ] keep
[ reader>> ]
[
type>>
[ c-getter ] [ c-type-boxer-quot ] bi append
]
[ type>> c-type-getter-boxer ]
[ ] tri
(( c-ptr -- value )) define-struct-slot-word ;

View File

@ -14,7 +14,7 @@ A' IS ${T}-array
A DEFINES-CLASS direct-${T}-array
<A> DEFINES <${A}>
NTH [ T dup c-getter array-accessor ]
NTH [ T dup c-type-getter-boxer array-accessor ]
SET-NTH [ T dup c-setter array-accessor ]
WHERE

View File

@ -22,7 +22,7 @@ A DEFINES-CLASS ${T}-array
byte-array>A DEFINES byte-array>${A}
A{ DEFINES ${A}{
NTH [ T dup c-getter array-accessor ]
NTH [ T dup c-type-getter-boxer array-accessor ]
SET-NTH [ T dup c-setter array-accessor ]
WHERE