Core runtime library providing primitive types (Bool, Byte, Char, Int, Float, String), base collections, and system utilities. Every Objeck program links against this bundle automatically via lang.obl.
Runtime
Provides access to runtime system
Operations
- Assert
- Command
- CommandOutput
- Copy
- Exit
- GetEnvironmentVariable
- GetInstallDir
- GetLibraryDir
- GetPlatform
- GetProperty
- GetTempDir
- GetTime
- GetUserDir
- GetUuid
- GetVersion
- HasEnvironmentVariable
- HasProperty
- RaiseSignal
- SetEnvironmentVariable
- SetLocale
- SetProperty
- SetSignal
Assert # function
Asserts runtime value to be true. If false, program exits with stack trace.
function : Assert(assert:Bool) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| assert | Bool | value to assert |
Command # function
Executes a system command
function : Command(c:System.String) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| c | String | system command |
Return
| Type | Description |
|---|---|
| Int | command status code |
CommandOutput # function
Executes a system command
function : CommandOutput(c:System.String) ~ CommandOutputParameters
| Name | Type | Description |
|---|---|---|
| c | String | system command |
Return
| Type | Description |
|---|---|
| CommandOutput | output from command |
CommandOutput # function
Executes a system command
function : CommandOutput(c:System.String, e:String[]) ~ CommandOutputParameters
| Name | Type | Description |
|---|---|---|
| c | String | system command |
| e | String | array of environment variables |
Return
| Type | Description |
|---|---|
| CommandOutput | output from command |
Copy # function
Copies data between two byte arrays
function : Copy(dest:Byte[], dest_offset:Int, src:Byte[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Byte | destination array |
| dest_offset | Int | destination array copy offset |
| src | Byte | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of bytes to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy # function
Copies data between two character arrays
function : Copy(dest:Char[], dest_offset:Int, src:Char[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Char | destination array |
| dest_offset | Int | destination array copy offset |
| src | Char | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of characters to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy # function
Copies data between two integer arrays
function : Copy(dest:Int[], dest_offset:Int, src:Int[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Int | destination array |
| dest_offset | Int | destination array copy offset |
| src | Int | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy # function
Copies data between two Base arrays
function : Copy(dest:Base[], dest_offset:Int, src:Base[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Base | destination array |
| dest_offset | Int | destination array copy offset |
| src | Base | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy # function
Copies data between two Compare arrays
function : Copy(dest:Compare[], dest_offset:Int, src:Compare[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Compare | destination array |
| dest_offset | Int | destination array copy offset |
| src | Compare | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy # function
Copies data between two float arrays
function : Copy(dest:Float[], dest_offset:Int, src:Float[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Float | destination array |
| dest_offset | Int | destination array copy offset |
| src | Float | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Exit # function
Causes the executing program to halt
function : Exit(code:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | exit code |
GetEnvironmentVariable # function
Fetches a runtime environment variable.
function : GetEnvironmentVariable(key:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| key | String | variable key |
Return
| Type | Description |
|---|---|
| String | runtime environment variable |
GetInstallDir # function
Returns the installation directory
function : GetInstallDir() ~ StringReturn
| Type | Description |
|---|---|
| String | installation directory |
GetLibraryDir # function
Returns the library directory
function : GetLibraryDir() ~ StringReturn
| Type | Description |
|---|---|
| String | installation directory |
GetPlatform # function
Returns an OS platform string
function : GetPlatform() ~ StringReturn
| Type | Description |
|---|---|
| String | OS platform string |
GetProperty # function
Fetches a runtime property. System properties include: 'user_dir', temp_dir and 'install_dir'.
function : GetProperty(key:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| key | String | property key |
Return
| Type | Description |
|---|---|
| String | runtime property |
GetTempDir # function
Returns the system's temporary directory
function : GetTempDir() ~ StringReturn
| Type | Description |
|---|---|
| String | system's temporary directory |
GetTime # function
Returns the current time
function : GetTime(gmt:Bool) ~ Time.DateParameters
| Name | Type | Description |
|---|---|---|
| gmt | Bool | true of time is in GMT, false for local time zone |
Return
| Type | Description |
|---|---|
| Time.Date | current time |
GetUserDir # function
Returns the current user's working directory
function : GetUserDir() ~ StringReturn
| Type | Description |
|---|---|
| String | current user's working directory |
GetUuid # function
Generates a RFC 4122 version-4 UUID string
function : GetUuid() ~ StringReturn
| Type | Description |
|---|---|
| String | UUID string |
GetVersion # function
Returns the package version string
function : GetVersion() ~ StringReturn
| Type | Description |
|---|---|
| String | package version string |
HasEnvironmentVariable # function
Checks if an environment variable exists
function : HasEnvironmentVariable(key:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| key | String | variable key |
Return
| Type | Description |
|---|---|
| Bool | true if it exists, false otherwise |
HasProperty # function
Checks if a property exists
function : HasProperty(key:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| key | String | property key |
Return
| Type | Description |
|---|---|
| Bool | true if it exists, false otherwise |
RaiseSignal # function
Raises a system signal
function : RaiseSignal(type:Runtime->Signal) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| type | Runtime->Signal | signal type |
SetEnvironmentVariable # function
Sets a runtime environment variable
function : SetEnvironmentVariable(key:String, value:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| key | String | variable key |
| value | String | environment value |
SetLocale # function
Sets the runtime locale
function : SetLocale(locale:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| locale | String | locale string |