generic

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package generic contains the functions and types to support generics.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Pkg is the Class package.
	Pkg = slip.Package{
		Name:      "generic",
		Nicknames: []string{"generic"},
		Doc:       "Home of symbols defined for the generic functions, variables, and constants.",
		PreSet:    slip.DefaultPreSet,
	}
)

Functions

func DefCallerMethod

func DefCallerMethod(qualifier string, caller slip.Caller, fd *slip.FuncDoc) *slip.Method

DefCallerMethod defines a method for a caller.

func DefClassMethod

func DefClassMethod(obj slip.Class, name, daemon string, caller slip.Caller) slip.Object

DefClassMethod defines a direct method on a class.

func ObjectLoadForm

func ObjectLoadForm(obj slip.Object, follow bool) (form slip.Object)

ObjectLoadForm returns the load form for and object.

Types

type Aux

type Aux struct {
	// contains filtered or unexported fields
}

Aux encapsulates the auxiliary data for a generic function.

func NewAux

func NewAux(fd *slip.FuncDoc) *Aux

NewAux creates a new generic aux.

func (*Aux) AddMethod

func (aux *Aux) AddMethod(key string, method *slip.Method)

AddMethod adds a method to the Aux.

func (*Aux) Call

func (aux *Aux) Call(gf slip.Object, s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

func (*Aux) LoadForm

func (aux *Aux) LoadForm() slip.Object

LoadForm returns a list that can be evaluated to define a generic and all specialized methods for the generic.

type CallNextMethod

type CallNextMethod struct {
	slip.Function
}

CallNextMethod represents the call-next-method function.

func (*CallNextMethod) Call

func (f *CallNextMethod) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type ComputeApplicableMethods

type ComputeApplicableMethods struct {
	slip.Function
}

ComputeApplicableMethods represents the compute-applicable-methods function.

func (*ComputeApplicableMethods) Call

func (f *ComputeApplicableMethods) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type Defgeneric

type Defgeneric struct {
	slip.Function
}

Defgeneric represents the class-name function.

func (*Defgeneric) Call

func (f *Defgeneric) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type Defmethod

type Defmethod struct {
	slip.Function
}

Defmethod represents the defmethod function.

func (*Defmethod) Call

func (f *Defmethod) Call(s *slip.Scope, args slip.List, depth int) (result slip.Object)

Call the the function with the arguments provided.

type FindMethod

type FindMethod struct {
	slip.Function
}

FindMethod represents the find-method function.

func (*FindMethod) Call

func (f *FindMethod) Call(s *slip.Scope, args slip.List, depth int) (meth slip.Object)

Call the the function with the arguments provided.

type FunctionKeywords

type FunctionKeywords struct {
	slip.Function
}

FunctionKeywords represents the function-keywords function.

func (*FunctionKeywords) Call

func (f *FunctionKeywords) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type HasDocs

type HasDocs interface {
	// Docs returns the documentation for the object.
	Docs() string
}

HasDocs is an interface for objects that have documentation.

type HasMethods

type HasMethods interface {
	// GetMethod returns the method if it exists.
	GetMethod(name string) *slip.Method

	// Methods returns a map of the methods.
	Methods() map[string]*slip.Method
}

HasMethods is an interface for objects that have documentation.

type MakeLoadForm

type MakeLoadForm struct {
	slip.Function
}

MakeLoadForm represents the make-load-form function.

func (*MakeLoadForm) Call

func (f *MakeLoadForm) Call(s *slip.Scope, args slip.List, depth int) (form slip.Object)

Call the the function with the arguments provided.

type MethodQualifiers

type MethodQualifiers struct {
	slip.Function
}

MethodQualifiers represents the method-qualifiers function.

func (*MethodQualifiers) Call

func (f *MethodQualifiers) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type NextMethodP

type NextMethodP struct {
	slip.Function
}

NextMethodP represents the next-method-p function.

func (*NextMethodP) Call

func (f *NextMethodP) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type NoApplicableMethod

type NoApplicableMethod struct {
	slip.Function
	// contains filtered or unexported fields
}

NoApplicableMethod represents the class-name function.

func (*NoApplicableMethod) Call

func (f *NoApplicableMethod) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type NoNextMethod

type NoNextMethod struct {
	slip.Function
	// contains filtered or unexported fields
}

NoNextMethod represents the class-name function.

func (*NoNextMethod) Call

func (f *NoNextMethod) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type RemoveMethod

type RemoveMethod struct {
	slip.Function
}

RemoveMethod represents the remove-method function.

func (*RemoveMethod) Call

func (f *RemoveMethod) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type SlotMissing

type SlotMissing struct {
	slip.Function
	// contains filtered or unexported fields
}

SlotMissing represents the slot-missing function.

func (*SlotMissing) Call

func (f *SlotMissing) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

type SlotUnbound

type SlotUnbound struct {
	slip.Function
	// contains filtered or unexported fields
}

SlotUnbound represents the slot-unbound function.

func (*SlotUnbound) Call

func (f *SlotUnbound) Call(s *slip.Scope, args slip.List, depth int) slip.Object

Call the the function with the arguments provided.

Jump to

Keyboard shortcuts

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