Uniot Core
0.9.0
Loading...
Searching...
No Matches

Helper utilities and type definitions for working with UniotLisp. More...

Collaboration diagram for Helper:

Classes

class  uniot::Lisp
 Utility class for working with Lisp objects in C++. More...
 

Macros

#define getPrimitiveName()
 Macro to get the current function name.
 
#define exportPrimitiveNameTo(name)
 Exports the current function name to a provided variable.
 

Typedefs

using uniot::lisp::Object = struct Obj *
 A pointer to a Lisp object structure.
 
using uniot::lisp::VarObject = struct Obj **
 A pointer to a pointer to a Lisp object structure.
 
using uniot::lisp::Root = void *
 A generic pointer representing the root of a Lisp environment.
 
enum class  uniot::LispStartReason { uniot::LispStartReason::Restored , uniot::LispStartReason::Received }
 Why a script started running. More...
 
enum class  uniot::LispStopReason { uniot::LispStopReason::Completed , uniot::LispStopReason::Replaced , uniot::LispStopReason::Cleared , uniot::LispStopReason::Failed }
 Why a script stopped running. More...
 
using uniot::LispStartHook = std::function<void(LispStartReason)>
 Called after the interpreter is built and before the script is evaluated.
 
using uniot::LispStopHook = std::function<void(LispStopReason)>
 Called before the interpreter is destroyed.
 

Detailed Description

Helper utilities and type definitions for working with UniotLisp.

This file provides wrapper types and utility functions to simplify the usage of the UniotLisp interpreter within the Uniot Core.

Macro Definition Documentation

◆ exportPrimitiveNameTo

#define exportPrimitiveNameTo ( name)
Value:
char name[sizeof(__func__)]; \
snprintf(name, sizeof(name), __func__)

Exports the current function name to a provided variable.

Parameters
nameThe variable name that will hold the function name.

◆ getPrimitiveName

#define getPrimitiveName ( )
Value:
(__func__)

Macro to get the current function name.

Return values
nameThe name of the current function.

Typedef Documentation

◆ LispStartHook

using uniot::LispStartHook = std::function<void(LispStartReason)>

Called after the interpreter is built and before the script is evaluated.

◆ LispStopHook

using uniot::LispStopHook = std::function<void(LispStopReason)>

Called before the interpreter is destroyed.

◆ Object

using uniot::lisp::Object = struct Obj *

A pointer to a Lisp object structure.

◆ Root

using uniot::lisp::Root = void *

A generic pointer representing the root of a Lisp environment.

◆ VarObject

using uniot::lisp::VarObject = struct Obj **

A pointer to a pointer to a Lisp object structure.

Used for functions that may modify the Lisp object reference.

Enumeration Type Documentation

◆ LispStartReason

enum class uniot::LispStartReason
strong

Why a script started running.

Enumerator
Restored 

A stored script, run from AppKit::attach() during boot.

Received 

A script that arrived over MQTT.

◆ LispStopReason

enum class uniot::LispStopReason
strong

Why a script stopped running.

Enumerator
Completed 

The script ran to the end, or a finite task used up its passes.

Replaced 

A new script arrived and took its place.

Cleared 

An empty script arrived, which means "run nothing".

Failed 

A Lisp error tore the machine down.