How to extend C programs with Guile

Michael Gran

Legal Notice
Table of Contents
Preface
Guile Background
The State of Guile
Who Should Read This Book
Structure of the Book
Comments and Questions
Acknowledgements
Guile as Extension Language
Examples of extension languages
Visualizing a Hybrid Application
Details vs Abstraction
Adaptability
Low-level, High-level
Getting Started
Checking Out the System
Guile
GCC
Make
The Editor
Simple Guile Example
Basic Guile Concepts
Starting the Interpreter
Reading in a Scheme File
Calling a Guile Function
Something Went Wrong
Summary
Symbols, Variables and Values
Comparing Terms
Variable names and symbols
Variables and Pointers
Looking Up a Guile Symbol By Name
Data and Values
Guile's Simple Data Types
Booleans
Integers
Real Numbers
Complex Numbers
Characters
Strings
Creating Guile Top-Level Variables from C
Converting C data into SCM data
Converting SCM into Guile Top-Level Variables
Reading Guile Top-Level Variables into C
Getting the variable from the symbol
Converting a SCM variable into a C value
Guile Scripts as Configuration Files
Functions I
Calling Guile functions from C
Calling from C a Guile function with no parameters
Calling from C a Guile function with parameters
Calling Guile Functions from C, an Example
Calling C functions from Guile
Manually Creating a C Function for Guile
Arrays, and other compound data types
Guile's Compound Data Types
pair
list
vector
Conventional Arrays
Uniform Arrays
Association Lists
Interacting with Guile Compound Data Types in C
Pairs
Lists
Vectors
Conventional Arrays
Uniform Arrays
Functions II
Calling a Guile Function with variable number of arguments from C
Calling a C Function with variable number of arguments from Guile
Custom data types (SMOBs)