boxing.factor: Swap first and second positions
parent
7349f9d953
commit
95519b0130
|
@ -14,14 +14,14 @@ SYMBOLS: int-reg-reps float-reg-reps ;
|
|||
|
||||
: record-reg-reps ( reps -- reps )
|
||||
dup ! reps: { { reg-rep on-stack? odd-register? } ... }
|
||||
[ [ [ second not ] [ first int-rep? ] bi and ] count int-reg-reps +@ ]
|
||||
[ [ [ second not ] [ first int-rep? not ] bi and ] count float-reg-reps +@ ]
|
||||
[ [ [ first int-rep? ] [ second not ] bi and ] count int-reg-reps +@ ]
|
||||
[ [ [ first int-rep? not ] [ second not ] bi and ] count float-reg-reps +@ ]
|
||||
bi ;
|
||||
|
||||
: unrecord-reg-reps ( reps -- reps )
|
||||
dup
|
||||
[ [ [ second not ] [ first int-rep? ] bi and ] count -1 * int-reg-reps +@ ]
|
||||
[ [ [ second not ] [ first int-rep? not ] bi and ] count -1 * float-reg-reps +@ ]
|
||||
[ [ [ first int-rep? ] [ second not ] bi and ] count -1 * int-reg-reps +@ ]
|
||||
[ [ [ first int-rep? not ] [ second not ] bi and ] count -1 * float-reg-reps +@ ]
|
||||
bi ;
|
||||
|
||||
GENERIC: flatten-c-type ( c-type -- pairs )
|
||||
|
|
Loading…
Reference in New Issue