schemeutil

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package schemeutil provides conversion utilities between syntax, datum, and Go types.

Syntax/Datum Conversion

Boolean Conversion

For implementing Scheme predicates and control flow:

  • [BoolToBoolean]: Go bool -> Scheme #t/#f
  • [BooleanToBool]: Scheme #t/#f -> Go bool
  • [ValueToBool]: Scheme truthiness (only #f is false)
  • [ValueToBoolean]: coerce any value to Scheme boolean

Collection

  • [AsList]: convert Go slice to proper Scheme list

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatumToSyntaxValue

func DatumToSyntaxValue(ctx context.Context, sctx *syntax.SourceContext, o values.Value) syntax.SyntaxValue

DatumToSyntaxValue wraps a raw Scheme datum in syntax objects, attaching the provided SourceContext for source location and scope tracking. Recursively wraps pairs, vectors, and boxed values. If the input is already a SyntaxValue, it is returned unchanged.

func IsSyntaxComment

func IsSyntaxComment(v values.Value) bool

IsSyntaxComment returns true if the given value is a SyntaxComment.

func SyntaxValueToDatum

func SyntaxValueToDatum(sv values.Value) values.Value

SyntaxValueToDatum converts a syntax object back to a raw Scheme datum, stripping away source location and scope information. Recursively unwraps pairs, vectors, and boxed values.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL