chars

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: BSD-2-Clause, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package chars contains convenience functions for working with Prolog strings (list of characters).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List[T Chars](strs ...T) engine.Term

List returns a new list of Prolog strings constructed from strs.

func String

func String[T Chars](str T) engine.Term

String returns a new Prolog string constructed from str.

func Value

func Value[T Chars](str engine.Term, env *engine.Env) (T, error)

Value resolves str, which must be a Prolog string, and returns a Go string or an error.

func Values

func Values[T Chars](list engine.Term, env *engine.Env) ([]T, error)

Values resolves list, which must be a list of strings, and converts all its members into Go strings.

Types

type Chars

type Chars interface {
	~string | ~[]rune
}

Chars is a list of characters in native Go representation.

Jump to

Keyboard shortcuts

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