all

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package all provides additional primitives for records, promises, and extended string/character operations.

Records (R7RS 5.5)

  • make-record-type, record-type?
  • make-record, record?, record-type-of
  • record-ref, record-set!

Promises (R7RS 4.2.5)

  • make-promise, promise?
  • force

Extended String Operations

  • string-copy, string-copy!, string-fill!
  • substring, list->string, string->list

Extended Character Operations

  • char-alphabetic?, char-numeric?, char-whitespace?
  • char-upper-case?, char-lower-case?
  • char-upcase, char-downcase, char-foldcase

Use Extension or AddToRegistry to register all primitives.

Package all provides a convenience extension that includes all standard extensions.

Index

Constants

This section is empty.

Variables

View Source
var AddToRegistry = Builder.AddToRegistry

AddToRegistry registers all standard primitives.

Builder aggregates all extension registration functions.

Extension includes all standard extensions.

Functions

func PrimCharAlphabeticQ

func PrimCharAlphabeticQ(_ context.Context, mc *machine.MachineContext) error

PrimCharAlphabeticQ tests if a character is alphabetic.

func PrimCharCiEqVariadic

func PrimCharCiEqVariadic(_ context.Context, mc *machine.MachineContext) error

PrimCharCiEqVariadic implements the variadic char-ci=? primitive.

func PrimCharCiGeVariadic

func PrimCharCiGeVariadic(_ context.Context, mc *machine.MachineContext) error

PrimCharCiGeVariadic implements the variadic char-ci>=? primitive.

func PrimCharCiGtVariadic

func PrimCharCiGtVariadic(_ context.Context, mc *machine.MachineContext) error

PrimCharCiGtVariadic implements the variadic char-ci>? primitive.

func PrimCharCiLeVariadic

func PrimCharCiLeVariadic(_ context.Context, mc *machine.MachineContext) error

PrimCharCiLeVariadic implements the variadic char-ci<=? primitive.

func PrimCharCiLtVariadic

func PrimCharCiLtVariadic(_ context.Context, mc *machine.MachineContext) error

PrimCharCiLtVariadic implements the variadic char-ci<? primitive.

func PrimCharDowncase

func PrimCharDowncase(_ context.Context, mc *machine.MachineContext) error

PrimCharDowncase returns the lowercase version of a character.

func PrimCharFoldcase

func PrimCharFoldcase(_ context.Context, mc *machine.MachineContext) error

PrimCharFoldcase returns the case-folded version of a character. R7RS §6.6: Returns the simple Unicode case-folded version of the character. Simple case folding maps each character to exactly one character.

func PrimCharLowerCaseQ

func PrimCharLowerCaseQ(_ context.Context, mc *machine.MachineContext) error

PrimCharLowerCaseQ tests if a character is lowercase.

func PrimCharNumericQ

func PrimCharNumericQ(_ context.Context, mc *machine.MachineContext) error

PrimCharNumericQ tests if a character is numeric.

func PrimCharUpcase

func PrimCharUpcase(_ context.Context, mc *machine.MachineContext) error

PrimCharUpcase returns the uppercase version of a character.

func PrimCharUpperCaseQ

func PrimCharUpperCaseQ(_ context.Context, mc *machine.MachineContext) error

PrimCharUpperCaseQ tests if a character is uppercase.

func PrimCharWhitespaceQ

func PrimCharWhitespaceQ(_ context.Context, mc *machine.MachineContext) error

PrimCharWhitespaceQ tests if a character is whitespace.

func PrimDigitValue

func PrimDigitValue(_ context.Context, mc *machine.MachineContext) error

PrimDigitValue implements the (digit-value) primitive. R7RS §6.6: Returns the numeric value (0-9) of a character that is a decimal digit according to Unicode, or #f if it is not a decimal digit.

func PrimForce

func PrimForce(_ context.Context, mc *machine.MachineContext) error

PrimForce implements the (force) primitive. Forces evaluation of a promise with proper memoization.

R7RS §4.2.5: The first time a promise is forced, its body is evaluated and the result is memoized; on subsequent forces, the memoized result is returned.

func PrimIsRecord

func PrimIsRecord(_ context.Context, mc *machine.MachineContext) error

PrimIsRecord implements the (record? obj) primitive.

func PrimIsRecordType

func PrimIsRecordType(_ context.Context, mc *machine.MachineContext) error

PrimIsRecordType implements the (record-type? obj) primitive.

func PrimMakeLazyPromise

func PrimMakeLazyPromise(_ context.Context, mc *machine.MachineContext) error

PrimMakeLazyPromise implements the (delay-force) primitive. Creates a lazy promise that delays evaluation of a thunk.

func PrimMakePromise

func PrimMakePromise(_ context.Context, mc *machine.MachineContext) error

PrimMakePromise implements the (make-promise) primitive. Creates a promise from a value, wrapping it if not already a promise.

func PrimMakeRecordType

func PrimMakeRecordType(ctx context.Context, mc *machine.MachineContext) error

PrimMakeRecordType implements the (make-record-type name field-names) primitive. Creates a new record type descriptor.

func PrimPromiseQ

func PrimPromiseQ(_ context.Context, mc *machine.MachineContext) error

PrimPromiseQ tests if an object is a promise.

func PrimRecordAccessor

func PrimRecordAccessor(_ context.Context, mc *machine.MachineContext) error

PrimRecordAccessor implements the (record-accessor rt field-tag) primitive. Returns an accessor procedure for the specified field.

func PrimRecordConstructor

func PrimRecordConstructor(ctx context.Context, mc *machine.MachineContext) error

PrimRecordConstructor implements the (record-constructor rt field-tags) primitive. Returns a constructor procedure for the record type.

func PrimRecordModifier

func PrimRecordModifier(_ context.Context, mc *machine.MachineContext) error

PrimRecordModifier implements the (record-modifier rt field-tag) primitive. Returns a modifier procedure for the specified field.

func PrimRecordPredicate

func PrimRecordPredicate(_ context.Context, mc *machine.MachineContext) error

PrimRecordPredicate implements the (record-predicate rt) primitive. Returns a predicate procedure for the record type.

func PrimRecordType

func PrimRecordType(_ context.Context, mc *machine.MachineContext) error

PrimRecordType implements the (record-type record) primitive. Returns the record type of a record instance.

func PrimStringCiEqVariadic

func PrimStringCiEqVariadic(_ context.Context, mc *machine.MachineContext) error

PrimStringCiEqVariadic implements the variadic string-ci=? primitive.

func PrimStringCiGeVariadic

func PrimStringCiGeVariadic(_ context.Context, mc *machine.MachineContext) error

PrimStringCiGeVariadic implements the variadic string-ci>=? primitive.

func PrimStringCiGtVariadic

func PrimStringCiGtVariadic(_ context.Context, mc *machine.MachineContext) error

PrimStringCiGtVariadic implements the variadic string-ci>? primitive.

func PrimStringCiLeVariadic

func PrimStringCiLeVariadic(_ context.Context, mc *machine.MachineContext) error

PrimStringCiLeVariadic implements the variadic string-ci<=? primitive.

func PrimStringCiLtVariadic

func PrimStringCiLtVariadic(_ context.Context, mc *machine.MachineContext) error

PrimStringCiLtVariadic implements the variadic string-ci<? primitive.

func PrimStringCopyTo

func PrimStringCopyTo(_ context.Context, mc *machine.MachineContext) error

PrimStringCopyTo implements the string-copy! primitive. R7RS §6.7: (string-copy! to at from [start [end]])

func PrimStringDowncase

func PrimStringDowncase(_ context.Context, mc *machine.MachineContext) error

PrimStringDowncase implements the string-downcase primitive. R7RS §6.7: Returns a string whose characters are the lowercase versions of the characters in string. Uses Unicode full case mapping which can expand characters.

func PrimStringFill

func PrimStringFill(_ context.Context, mc *machine.MachineContext) error

PrimStringFill implements the string-fill! primitive. R7RS §6.7: (string-fill! string fill [start [end]])

func PrimStringFoldcase

func PrimStringFoldcase(_ context.Context, mc *machine.MachineContext) error

PrimStringFoldcase implements the string-foldcase primitive. R7RS §6.7: Returns a string whose characters are the case-folded versions of the characters in string. Uses Unicode full case folding which can expand characters (e.g., ß → ss).

func PrimStringForEach

func PrimStringForEach(_ context.Context, mc *machine.MachineContext) error

PrimStringForEach implements the string-for-each primitive. R7RS §6.7: (string-for-each proc string1 string2 ...)

func PrimStringMap

func PrimStringMap(_ context.Context, mc *machine.MachineContext) error

PrimStringMap implements the string-map primitive. R7RS §6.7: (string-map proc string1 string2 ...)

func PrimStringUpcase

func PrimStringUpcase(_ context.Context, mc *machine.MachineContext) error

PrimStringUpcase implements the string-upcase primitive. R7RS §6.7: Returns a string whose characters are the uppercase versions of the characters in string. Uses Unicode full case mapping which can expand characters (e.g., ß → SS).

Types

This section is empty.

Jump to

Keyboard shortcuts

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