1///|
2
3///|
4let ConstPtr[Unit]
null_pointer : type ConstPtr[T]
ConstPtr[Unit
Unit] = () -> ConstPtr[Unit]
_null_pointer() |> (x : ConstPtr[Unit]) -> ConstPtr[Unit]
unsafe_coerce
5
6///|
7pub fn[T] type Ptr[T]
Ptr::() -> Ptr[T]
null_pointer() -> type Ptr[T]
Ptr[type parameter T
T] {
8 (x : ConstPtr[Unit]) -> Ptr[T]
unsafe_coerce(ConstPtr[Unit]
null_pointer)
9}
10
11///|
12pub fn[T] type Ptr[T]
Ptr::(self : Ptr[T]) -> Bool
is_null(Ptr[T]
self : type Ptr[T]
Ptr[type parameter T
T]) -> Bool
Bool {
13 (ptr : ConstPtr[Byte], other : ConstPtr[Byte]) -> Int64
pointer_sub((x : Ptr[T]) -> ConstPtr[Byte]
unsafe_coerce(Ptr[T]
self), (x : ConstPtr[Unit]) -> ConstPtr[Byte]
unsafe_coerce(ConstPtr[Unit]
null_pointer)) (self : Int64, other : Int64) -> Bool
Tests if two 64-bit integers are equal.
Parameters:
self : The first 64-bit integer to compare.
other : The second 64-bit integer to compare.
Returns true if both integers are equal, false otherwise.
Example:
let a = 42L
let b = 42L
let c = -42L
inspect(a == b, content="true")
inspect(a == c, content="false")
== 0
14}
15
16///|
17pub fn[T] type ConstPtr[T]
ConstPtr::() -> ConstPtr[T]
null_pointer() -> type ConstPtr[T]
ConstPtr[type parameter T
T] {
18 (x : ConstPtr[Unit]) -> ConstPtr[T]
unsafe_coerce(ConstPtr[Unit]
null_pointer)
19}
20
21///|
22pub fn[T] type ConstPtr[T]
ConstPtr::(self : ConstPtr[T]) -> Bool
is_null(ConstPtr[T]
self : type ConstPtr[T]
ConstPtr[type parameter T
T]) -> Bool
Bool {
23 (ptr : ConstPtr[Byte], other : ConstPtr[Byte]) -> Int64
pointer_sub((x : ConstPtr[T]) -> ConstPtr[Byte]
unsafe_coerce(ConstPtr[T]
self), (x : ConstPtr[Unit]) -> ConstPtr[Byte]
unsafe_coerce(ConstPtr[Unit]
null_pointer)) (self : Int64, other : Int64) -> Bool
Tests if two 64-bit integers are equal.
Parameters:
self : The first 64-bit integer to compare.
other : The second 64-bit integer to compare.
Returns true if both integers are equal, false otherwise.
Example:
let a = 42L
let b = 42L
let c = -42L
inspect(a == b, content="true")
inspect(a == c, content="false")
== 0
24}
25