Documentation
¶
Overview ¶
Package system provides system interface primitives.
System Interface (R7RS 6.14) ¶
- command-line: return command-line arguments as list
- exit: terminate with exit status
- emergency-exit: terminate immediately without cleanup
- get-environment-variable: get environment variable value
- get-environment-variables: get all environment variables
Features ¶
- features: return list of implementation features
Time ¶
- current-second: current time as inexact seconds since epoch
- current-jiffy: high-resolution monotonic time
- jiffies-per-second: resolution of current-jiffy
Use Extension or AddToRegistry to register all primitives.
Package system provides system-level primitives.
Index ¶
- Variables
- func PrimCommandLine(_ context.Context, mc *machine.MachineContext) error
- func PrimCurrentJiffy(_ context.Context, mc *machine.MachineContext) error
- func PrimCurrentSecond(_ context.Context, mc *machine.MachineContext) error
- func PrimEmergencyExit(_ context.Context, mc *machine.MachineContext) error
- func PrimExit(_ context.Context, mc *machine.MachineContext) error
- func PrimFeatures(_ context.Context, mc *machine.MachineContext) error
- func PrimGetEnvironmentVariable(_ context.Context, mc *machine.MachineContext) error
- func PrimGetEnvironmentVariables(_ context.Context, mc *machine.MachineContext) error
- func PrimJiffiesPerSecond(_ context.Context, mc *machine.MachineContext) error
Constants ¶
This section is empty.
Variables ¶
var AddToRegistry = Builder.AddToRegistry
AddToRegistry registers all system primitives.
var Builder = registry.NewRegistryBuilder(addPrimitives)
Builder aggregates all system registration functions.
var Extension = registry.NewExtension("system", AddToRegistry)
Extension is the system extension.
var ProgramStartTime = time.Now()
ProgramStartTime is used for current-jiffy to measure elapsed time.
Functions ¶
func PrimCommandLine ¶
func PrimCommandLine(_ context.Context, mc *machine.MachineContext) error
PrimCommandLine implements the (command-line) primitive. Returns a list of command line arguments.
func PrimCurrentJiffy ¶
func PrimCurrentJiffy(_ context.Context, mc *machine.MachineContext) error
PrimCurrentJiffy implements the (current-jiffy) primitive. Returns current time in jiffies since program start.
func PrimCurrentSecond ¶
func PrimCurrentSecond(_ context.Context, mc *machine.MachineContext) error
PrimCurrentSecond implements the (current-second) primitive. Returns current time in seconds since Unix epoch.
func PrimEmergencyExit ¶
func PrimEmergencyExit(_ context.Context, mc *machine.MachineContext) error
PrimEmergencyExit implements the (emergency-exit) primitive. Exits the program immediately without cleanup or finalization.
func PrimExit ¶
func PrimExit(_ context.Context, mc *machine.MachineContext) error
PrimExit implements the (exit) primitive. Exits the program with an optional status code.
func PrimFeatures ¶
func PrimFeatures(_ context.Context, mc *machine.MachineContext) error
PrimFeatures implements the (features) primitive. Returns list of implementation features.
func PrimGetEnvironmentVariable ¶
func PrimGetEnvironmentVariable(_ context.Context, mc *machine.MachineContext) error
PrimGetEnvironmentVariable implements the (get-environment-variable) primitive. Gets environment variable value.
func PrimGetEnvironmentVariables ¶
func PrimGetEnvironmentVariables(_ context.Context, mc *machine.MachineContext) error
PrimGetEnvironmentVariables implements the (get-environment-variables) primitive. Returns all environment variables.
func PrimJiffiesPerSecond ¶
func PrimJiffiesPerSecond(_ context.Context, mc *machine.MachineContext) error
PrimJiffiesPerSecond implements the (jiffies-per-second) primitive. Returns the number of jiffies per second (1 billion nanoseconds).
Types ¶
This section is empty.