Verified Commit bfd9de4b authored by Bernd Paysan's avatar Bernd Paysan
Browse files

Add uval-o, value-flavored user-o

parent 21154f11
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3477,6 +3477,11 @@ DO: true abort" not in cross compiler!" ;DO
Build: 0 au, dup class-o ! X , ;Build
by User

Builder uval-o
DO: true abort" not in cross compiler!" ;DO
Build: 0 au, dup class-o ! X , ;Build
by UValue

>TARGET
: umethod ( m v -- m' v )
    over >r no-loop on T : H compile u#exec class-o @ T , H
@@ -3854,6 +3859,7 @@ Cond: IS cross-record-name T ' >body H compile ALiteral compile ! ;Cond
Cond: TO        T ' >body H compile ALiteral compile ! ;Cond
: TO            T ' >body ! H ;
Cond: UTO       compile useraddr T ' >body @ , H compile ! ;Cond
: UTO           T ' >body @ H tup@ + X ! ;
Cond: UADDR     compile useraddr T ' >body @ , H ;Cond
[THEN]

+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ here
' heap-resize a,
A, here Aconstant heap-words

user-o current-memory-words
heap-words current-memory-words A!
uval-o current-memory-words
heap-words uto current-memory-words
0 0
umethod allocate ( u -- a_addr wior )	\ memory
    \G Allocate @i{u} address units of contiguous data space. The
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ Variable class-o

: user-o ( "name" -- )
    0 uallot class-o !  User ;
: uval-o ( "name" -- )
    0 uallot class-o !  UValue ;

: umethod ( m v -- m' v )
    postpone nocov[