- live browsing of Self object memory -

lobby traitsint64

CopyDowns: vector

CreatorPath: traits int64

Module: int32and64

parent* = traits int32or64
zero = ( int64)

64 bit primitives

add:With: = ( _Int64: i1 asInt64 Add: i2 asInt64)
and:With: = ( _Int64: i1 asInt64 And: i2 asInt64)
cmp:With: = ( _Int64: i1 asInt64 Cmp: i2 asInt64)
div:With:IfFail: = ( _Int64: i1 asInt64 Div: i2 asInt64 IfFail: eb)
fromFloat: = ( _Int64FromFloat: f asFloat)
fromInt32: = ( _Int64FromInt32: i asInt32)
mul:With: = ( _Int64: i1 asInt64 Mul: i2 asInt64)
or:With: = ( _Int64: i1 asInt64 Or: i2 asInt64)
rem:With:IfFail: = ( _Int64: i1 asInt64 Rem: i2 asInt64 IfFail: eb)
shl:With: = ( _Int64: i1 asInt64 Shl: i2 asInt64)
shr:With: = ( _Int64: i1 asInt64 Shr: i2 asInt64)
sub:With: = ( _Int64: i1 asInt64 Sub: i2 asInt64)
ushr:With: = ( _Int64: i1 asInt64 Ushr: i2 asInt64)
xor:With: = ( _Int64: i1 asInt64 Xor: i2 asInt64)

deprecated

add:And: = ( _Int64: i1 asInt64 Add: i2 asInt64)
and:And: = ( _Int64: i1 asInt64 And: i2 asInt64)
cmp:And: = ( _Int64: i1 asInt64 Cmp: i2 asInt64)
div:And:IfFail: = ( _Int64: i1 asInt64 Div: i2 asInt64 IfFail: eb)
mul:And: = ( _Int64: i1 asInt64 Mul: i2 asInt64)
or:And: = ( _Int64: i1 asInt64 Or: i2 asInt64)
rem:And:IfFail: = ( _Int64: i1 asInt64 Rem: i2 asInt64 IfFail: eb)
shl:And: = ( _Int64: i1 asInt64 Shl: i2 asInt64)
shr:And: = ( _Int64: i1 asInt64 Shr: i2 asInt64)
sub:And: = ( _Int64: i1 asInt64 Sub: i2 asInt64)
ushr:And: = ( _Int64: i1 asInt64 Ushr: i2 asInt64)
xor:And: = ( _Int64: i1 asInt64 Xor: i2 asInt64)

coercions

asBigEndianByteVectorFrom: =
( | i. r |
    [endianDependentServer].
    i: intOrInt64.
    r: byteVector copySize: 8.
    r at: 0 Put: ushr:  i With: 56.
    r at: 1 Put: and: 255 With: ushr: i With: 48.
    r at: 2 Put: and: 255 With: ushr: i With: 40.
    r at: 3 Put: and: 255 With: ushr: i With: 32.
    r at: 4 Put: and: 255 With: ushr: i With: 24.
    r at: 5 Put: and: 255 With: ushr: i With: 16.
    r at: 6 Put: and: 255 With: ushr: i With: 8.
    r at: 7 Put: and: 255 With: i.
    r)
asFloat = ( _FloatFromInt64)
asInt16 = ( _Int16FromInt64: self)
asInt32 = ( int32 fromInt64: self)
asInt64 = ( self)
asInt8 = ( _Int8FromInt64: self)
asLittleEndianByteVectorFrom: =
( | i. r |
    [endianDependentServer].
    i: intOrInt64.
    r: byteVector copySize: 8.
    r at: 7 Put: ushr: i With: 56.
    r at: 6 Put: and: 255 With: ushr: i With: 48.
    r at: 5 Put: and: 255 With: ushr: i With: 40.
    r at: 4 Put: and: 255 With: ushr: i With: 32.
    r at: 3 Put: and: 255 With: ushr: i With: 24.
    r at: 2 Put: and: 255 With: ushr: i With: 16.
    r at: 1 Put: and: 255 With: ushr: i With: 8.
    r at: 0 Put: and: 255 With: i.
    r)

iterating

bigEndianBytesFrom:Do: =
( 
    [endianDependentServer].
    blk value: (                ushr: i With: 56 ) With: 0.
    blk value: ( and: 255 With: ushr: i With: 48 ) With: 1.
    blk value: ( and: 255 With: ushr: i With: 40 ) With: 2.
    blk value: ( and: 255 With: ushr: i With: 32 ) With: 3.
    blk value: ( and: 255 With: ushr: i With: 24 ) With: 4.
    blk value: ( and: 255 With: ushr: i With: 16 ) With: 5.
    blk value: ( and: 255 With: ushr: i With:  8 ) With: 6.
    blk value: ( and: 255 With:       i          ) With: 7.
    self)
littleEndianBytesFrom:Do: =
( 
    [endianDependentServer].
    blk value: ( and: 255 With:       i          ) With: 0.
    blk value: ( and: 255 With: ushr: i With:  8 ) With: 1.
    blk value: ( and: 255 With: ushr: i With: 16 ) With: 2.
    blk value: ( and: 255 With: ushr: i With: 24 ) With: 3.
    blk value: ( and: 255 With: ushr: i With: 32 ) With: 4.
    blk value: ( and: 255 With: ushr: i With: 40 ) With: 5.
    blk value: ( and: 255 With: ushr: i With: 48 ) With: 6.
    blk value: (                ushr: i With: 56 ) With: 7.
    self)

store string

from:And:And:And: =
( 
    or: (shl: p1 With: 48) With:
    or: (shl: p2 With: 32) With:
    or: (shl: p3 With: 16) With: p4)
storeStringFor:IfFail: =
( | p1. p2. p3. p4 |
    p1: '16r', (ushr: a With: 48) hexPrintString.
    p2: '16r', (and: 16rffff With: ushr: a With: 32) hexPrintString.
    p3: '16r', (and: 16rffff With: ushr: a With: 16) hexPrintString.
    p4: '16r', (and:  a With: 16rffff) hexPrintString.
    'int64 from: ', p1, ' With: ', p2, ' With: ', p3, ' With: ', p4)
faster than parent's