Module: core.box
Source: ./core/box.reef
Overview
core.box - Box types for wrapping primitive values
Allows primitives to be stored in Any type or used where reference types are required. Provides BoxInt, BoxFloat, BoxBool, BoxString, BoxChar.
Types
BoxInt
Box struct for int values
Fields:
| Name | Type |
|---|---|
value |
int |
BoxFloat
Box struct for float values
Fields:
| Name | Type |
|---|---|
value |
float |
BoxBool
Box struct for bool values
Fields:
| Name | Type |
|---|---|
value |
bool |
BoxString
Box struct for string values
Fields:
| Name | Type |
|---|---|
value |
string |
BoxChar
Box struct for char values
Fields:
| Name | Type |
|---|---|
value |
char |
Functions
fn box_int(value: int): BoxInt
Create a boxed int
fn unbox_int(b: BoxInt): int
Extract value from boxed int
fn box_float(value: float): BoxFloat
Create a boxed float
fn unbox_float(b: BoxFloat): float
Extract value from boxed float
fn box_bool(value: bool): BoxBool
Create a boxed bool
fn unbox_bool(b: BoxBool): bool
Extract value from boxed bool
fn box_string(value: string): BoxString
Create a boxed string
fn unbox_string(b: BoxString): string
Extract value from boxed string
fn box_char(value: char): BoxChar
Create a boxed char
fn unbox_char(b: BoxChar): char
Extract value from boxed char
Generated by reefc doc