chain

package module
v0.0.0-...-fc2bd72 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: JSON Imports: 1 Imported by: 6

README

== About ==

Chain is an implementation of the classic Lisp-style Cons list data structure, a chain of value-link pairs.

Documentation

Index

Constants

View Source
const (
	PREVIOUS_NODE = -1
	CURRENT_NODE  = 0
	NEXT_NODE     = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Head interface{}
	Tail *Cell
}

func Append

func Append(c *Cell, x interface{}) *Cell

func Cons

func Cons(items ...interface{}) (c *Cell)

func Prepend

func Prepend(c *Cell, x interface{}) *Cell

func (*Cell) Append

func (c *Cell) Append(x interface{})

func (*Cell) Assq

func (c *Cell) Assq(key interface{}) (r *Cell)

func (*Cell) Caar

func (c *Cell) Caar() (v interface{})

func (*Cell) Cadr

func (c *Cell) Cadr() (v *Cell)

func (*Cell) Car

func (c *Cell) Car() (v interface{})

func (*Cell) Car2

func (c *Cell) Car2() (x, y interface{})

func (*Cell) Car3

func (c *Cell) Car3() (x, y, z interface{})

func (*Cell) Cddr

func (c *Cell) Cddr() (v *Cell)

func (*Cell) Cdr

func (c *Cell) Cdr() (v *Cell)

func (Cell) Content

func (c Cell) Content() interface{}

func (*Cell) Define

func (c *Cell) Define(key interface{}, value interface{}) (r *Cell)

func (*Cell) Each

func (c *Cell) Each(f interface{})

func (*Cell) End

func (c *Cell) End() (r *Cell)

func (*Cell) Equal

func (c *Cell) Equal(o interface{}) (r bool)

func (*Cell) Len

func (c *Cell) Len() (l int)
func (c *Cell) Link(i int, l Node) (b bool)

func (*Cell) MinimumLength

func (c *Cell) MinimumLength(l int) bool

func (Cell) MoveTo

func (c Cell) MoveTo(i int) (l Node)

func (*Cell) Prepend

func (c *Cell) Prepend(x interface{})

func (*Cell) Rplaca

func (c *Cell) Rplaca(i interface{})

func (*Cell) Rplacd

func (c *Cell) Rplacd(next *Cell)

func (*Cell) Set

func (c *Cell) Set(i int, v interface{}) (r bool)

func (Cell) String

func (c Cell) String() (t string)

func (*Cell) Until

func (c *Cell) Until(f interface{}) (i int, k *Cell)

func (*Cell) While

func (c *Cell) While(f interface{}) (i int, k *Cell)

type Equatable

type Equatable interface {
	Equal(interface{}) bool
}

type Node

type Node interface {
	MoveTo(int) Node
	Content() interface{}
	Link(int, Node) bool
	Set(int, interface{}) bool
}

func FirstElement

func FirstElement(l Node) (r Node)

func LastElement

func LastElement(l Node) (r Node)

func Next

func Next(l Node) (r Node)

func Previous

func Previous(l Node) Node

Jump to

Keyboard shortcuts

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