address¶
type addressAn address represents a read-only bounded section of memory.
meth address(String: string): addressReturns an address view of
String.address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A>
meth (Arg₁: address) != (Arg₂: address): address | nilReturns
Arg₂if the bytes atArg₁!= the bytes atArg₂andnilotherwise."Hello" != "World" :> "World" "World" != "Hello" :> "Hello" "Hello" != "Hello" :> nil "abcd" != "abc" :> "abc" "abc" != "abcd" :> "abcd"
meth (Address: address) + (Offset: integer): addressReturns the address at offset
OffsetfromAddress.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A + 4 :> <9:6F20776F726C64210A>
meth (Address₁: address) - (Address₂: address): integerReturns the offset from
Address₂toAddress₁, providedAddress₂is visible toAddress₁.let A := address("Hello world!\n") let B := A + 4 B - A :> 4 address("world!\n") - A :> error("ValueError", "Addresses are not from same base")
meth (Arg₁: address) < (Arg₂: address): address | nilReturns
Arg₂if the bytes atArg₁< the bytes atArg₂andnilotherwise."Hello" < "World" :> "World" "World" < "Hello" :> nil "Hello" < "Hello" :> nil "abcd" < "abc" :> nil "abc" < "abcd" :> "abcd"
meth (Arg₁: address) <= (Arg₂: address): address | nilReturns
Arg₂if the bytes atArg₁<= the bytes atArg₂andnilotherwise."Hello" <= "World" :> "World" "World" <= "Hello" :> nil "Hello" <= "Hello" :> "Hello" "abcd" <= "abc" :> nil "abc" <= "abcd" :> "abcd"
meth (A: address) <> (B: address): integerCompares the bytes at
AandBlexicographically and returns-1,0or1respectively."Hello" <> "World" :> -1 "World" <> "Hello" :> 1 "Hello" <> "Hello" :> 0 "abcd" <> "abc" :> 1 "abc" <> "abcd" :> -1
meth (Arg₁: address) = (Arg₂: address): address | nilReturns
Arg₂if the bytes atArg₁= the bytes atArg₂andnilotherwise."Hello" = "World" :> nil "World" = "Hello" :> nil "Hello" = "Hello" :> "Hello" "abcd" = "abc" :> nil "abc" = "abcd" :> nil
meth (Arg₁: address) > (Arg₂: address): address | nilReturns
Arg₂if the bytes atArg₁> the bytes atArg₂andnilotherwise."Hello" > "World" :> nil "World" > "Hello" :> "Hello" "Hello" > "Hello" :> nil "abcd" > "abc" :> "abc" "abc" > "abcd" :> nil
meth (Arg₁: address) >= (Arg₂: address): address | nilReturns
Arg₂if the bytes atArg₁>= the bytes atArg₂andnilotherwise."Hello" >= "World" :> nil "World" >= "Hello" :> "Hello" "Hello" >= "Hello" :> "Hello" "abcd" >= "abc" :> "abc" "abc" >= "abcd" :> nil
meth (Address: address) @ (Length: integer): addressReturns the same address as
Address, limited toLengthbytes.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A @ 5 :> <5:48656C6C6F>
meth (Address: address) @ (Offset: integer, Length: integer): addressReturns the address at offset
OffsetfromAddresslimited toLengthbytes.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A @ (4, 4) :> <4:6F20776F>
meth (Haystack: address):find(Needle: address): integer | nilReturns the offset of the first occurence of the bytes of
NeedleinHaystackornilis no occurence is found.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:find("world") :> 6 A:find("other") :> nil
meth (Haystack: address):find(Needle: address, Start: integer): integer | nilReturns the offset of the first occurence of the bytes of
NeedleinHaystackornilis no occurence is found.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:find("world") :> 6 A:find("other") :> nil
meth (Address: address):get16: integerReturns the signed 16-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get16 :> 25928
meth (Address: address):get16(Order: byte::order): integerReturns the signed 16-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get16(address::LE) :> 25928 A:get16(address::BE) :> 18533
meth (Address: address):get16(Offset: integer): integerReturns the signed 16-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get16 :> 25928
meth (Address: address):get16(Offset: integer, Order: byte::order): integerReturns the signed 16-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get16(address::LE) :> 25928 A:get16(address::BE) :> 18533
meth (Address: address):get32: integerReturns the signed 32-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get32 :> 1819043144
meth (Address: address):get32(Order: byte::order): integerReturns the signed 32-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get32(address::LE) :> 1819043144 A:get32(address::BE) :> 1214606444
meth (Address: address):get32(Offset: integer): integerReturns the signed 32-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get32 :> 1819043144
meth (Address: address):get32(Offset: integer, Order: byte::order): integerReturns the signed 32-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get32(address::LE) :> 1819043144 A:get32(address::BE) :> 1214606444
meth (Address: address):get64: integerReturns the signed 64-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get64 :> 8031924123371070792
meth (Address: address):get64(Order: byte::order): integerReturns the signed 64-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get64(address::LE) :> 8031924123371070792 A:get64(address::BE) :> 5216694956355254127
meth (Address: address):get64(Offset: integer): integerReturns the signed 64-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get64 :> 8031924123371070792
meth (Address: address):get64(Offset: integer, Order: byte::order): integerReturns the signed 64-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get64(address::LE) :> 8031924123371070792 A:get64(address::BE) :> 5216694956355254127
meth (Address: address):get8: integerReturns the signed 8-bit value at
Address.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:get8 :> 72
meth (Address: address):getf32: realReturns the 32-bit floating point value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf32 :> 1.14313912243758e+27
meth (Address: address):getf32(Order: byte::order): realReturns the 32-bit floating point value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf32(address::LE) :> 1.14313912243758e+27 A:getf32(address::BE) :> 234929.6875
meth (Address: address):getf32(Offset: integer): realReturns the 32-bit floating point value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf32 :> 1.14313912243758e+27
meth (Address: address):getf32(Offset: integer, Order: byte::order): realReturns the 32-bit floating point value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf32(address::LE) :> 1.14313912243758e+27 A:getf32(address::BE) :> 234929.6875
meth (Address: address):getf64: realReturns the 64-bit floating point value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf64 :> 8.76577647882785e+228
meth (Address: address):getf64(Order: byte::order): realReturns the 64-bit floating point value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf64(address::LE) :> 8.76577647882785e+228 A:getf64(address::BE) :> 5.83203948069194e+40
meth (Address: address):getf64(Offset: integer): realReturns the 64-bit floating point value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf64 :> 8.76577647882785e+228
meth (Address: address):getf64(Offset: integer, Order: byte::order): realReturns the 64-bit floating point value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getf64(address::LE) :> 8.76577647882785e+228 A:getf64(address::BE) :> 5.83203948069194e+40
meth (Address: address):gets: stringReturns the string consisting of the bytes at
Address.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:gets :> "Hello world!\n"
meth (Address: address):gets(Size: integer): stringReturns the string consisting of the first
Sizebytes atAddress.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:gets(5) :> " wo\0ld!\n"
meth (Address: address):gets(Offset: integer): stringReturns the string consisting of the bytes at
Address.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:gets :> "Hello world!\n"
meth (Address: address):gets(Size: integer, Arg₃: integer): stringReturns the string consisting of the first
Sizebytes atAddress.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:gets(5) :> " wo\0ld!\n"
meth (Address: address):getu16(Order: any): integerReturns the unsigned 16-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu16 :> 25928
meth (Address: address):getu16(Arg₂: byte::order): integerReturns the unsigned 16-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu16(address::LE) :> 25928 A:getu16(address::BE) :> 18533
meth (Address: address):getu16(Offset: integer, Order: any): integerReturns the unsigned 16-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu16 :> 25928
meth (Address: address):getu16(Offset: integer, Arg₃: byte::order): integerReturns the unsigned 16-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu16(address::LE) :> 25928 A:getu16(address::BE) :> 18533
meth (Address: address):getu32(Order: any): integerReturns the unsigned 32-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu32 :> 1819043144
meth (Address: address):getu32(Arg₂: byte::order): integerReturns the unsigned 32-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu32(address::LE) :> 1819043144 A:getu32(address::BE) :> 1214606444
meth (Address: address):getu32(Offset: integer, Order: any): integerReturns the unsigned 32-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu32 :> 1819043144
meth (Address: address):getu32(Offset: integer, Arg₃: byte::order): integerReturns the unsigned 32-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu32(address::LE) :> 1819043144 A:getu32(address::BE) :> 1214606444
meth (Address: address):getu64(Order: any): integerReturns the unsigned 64-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu64 :> 8031924123371070792
meth (Address: address):getu64(Arg₂: byte::order): integerReturns the unsigned 64-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu64(address::LE) :> 8031924123371070792 A:getu64(address::BE) :> 5216694956355254127
meth (Address: address):getu64(Offset: integer, Order: any): integerReturns the unsigned 64-bit value at
Address. Uses the platform byte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu64 :> 8031924123371070792
meth (Address: address):getu64(Offset: integer, Arg₃: byte::order): integerReturns the unsigned 64-bit value at
Address. UsesOrderbyte order.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu64(address::LE) :> 8031924123371070792 A:getu64(address::BE) :> 5216694956355254127
meth (Address: address):getu8: integerReturns the unsigned 8-bit value at
Address.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:getu8 :> 72
meth (Address: address):length: integerReturns the number of bytes visible at
Address.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:length :> 13
meth (Address: address):size: integerReturns the number of bytes visible at
Address.let A := address("Hello world!\n") :> <13:48656C6C6F20776F726C64210A> A:size :> 13
meth (Buffer: string::buffer):append(Value: address)Appends the contents of
ValuetoBuffer.