Truffle interop

This module provides interop facilities with other truffle languages.

(requires "builtin/truffle.lisp")

<truffle-native-library>

class

Superclasses
  • <object>

Class for interop truffle objects representing a library loaded through FFI facilities.

<truffle-object>

class

Superclasses
  • <object>

Class for interop truffle objects with fields.

<truffle-vector>

class

Superclasses
  • <basic-vector>

Class for interop truffle object which are vector-like.

load-native-library

function

(load-native-library name) => <truffle-native-library>

Loads a native library with given name. An error shall be signaled if name is not a string (error-id. domain-error). Interop errors are signalled as an instance of <truffle-interop-error>.

native-library-symbol

function

(native-library-symbol native-library symbol signature => <object>

Retrieves binding symbol in given native_library. signature specifies the shape of the binding such that it can be transposed into truffle runtime. See truffle’s NFI documentation for details. An error shall be signaled if native-library is not an instance of <truffle-native-library> or if either signature or symbol is not a string (error-id. domain-error). Interop errors are signalled as an instance of <truffle-interop-error>.

set-truffle-object-field

function

(set-truffle-object-field value truffle-obj field-name) => <object>

Sets value of field-name field in truffle-obj to value. Returns value. An error shall be signaled if truffle-obj is not an instance of <truffle-object>, or if field-name is not a string (error-id. domain-error). Interop errors are signalled as an instance of <truffle-interop-error>.

truffle-interop-error-message

function

(truffle-interop-error-message error => <string>

Retrieves message attached to error raised during truffle interop operations. An error shall be signaled if error is not an instance of <truffle-interop-error>.

truffle-object-field

function

(truffle-object-field truffle-obj field-name) => <object>

Returns a value of a field named by field-name in given truffle-obj. An error shall be signaled if truffle-obj is not an instance of <truffle-object>, or if field-name is not a string (error-id. domain-error). Interop errors are signalled as an instance of <truffle-interop-error>.

truffle-object-field

setf

(setf (truffle-object-field truffle-obj field-name) value) => <object>

Sets value of field-name field in truffle-obj to value. Returns value. An error shall be signaled if truffle-obj is not an instance of <truffle-object>, or if field-name is not a string (error-id. domain-error). Interop errors are signalled as an instance of <truffle-interop-error>.

truffle-object-fields

function

(truffle-object-fields truffle-obj) => <vector>

Returns a vector of strings, listing fields exposed by given truffle obj. An error shall be signaled if truffle-obj is not an instance of <truffle-object> (error-id. domain-error). Interop errors are signalled as an instance of <truffle-interop-error>.