...

Package core

import "github.com/zylisp/zylisp/core"
Overview
Index
Subdirectories

Overview ▾

Constants

Core error messages

const (
    ModArgTypeError               string = "mod function requires need int/float argument; received incorrect type: "
    AddArgTypeError               string = "add function requires int and/or float64 objects"
    SubArgTypeError               string = "sub function requires need int/float argument"
    CompareArgsCountError         string = "You cannot compare less than two values"
    IncompatibleCompareTypesError string = "The comparison of types of args provided is not allowed"
    GetNot2Or3ArgsError           string = "The get function needs 2 or 3 arguments %d given."
    GetArgsTypesError             string = "Arguments to the get function must include slice/vector/string"
)

func ADD

func ADD(args ...Any) float64

ADD any number of int or float64 args ALWAYS returns a float64

func DIV

func DIV()

DIV any number of int or float64 args ALWAYS returns a float64

func EQ

func EQ(args ...Any) bool

EQ equal

func GT

func GT(args ...Any) bool

GT greater-than TODO: can only compare ints and slice lens for now.

func GTEQ

func GTEQ(args ...Any) bool

GTEQ greater-than or equal

func IsFloat

func IsFloat(n Any) bool

IsFloat boolean check

func IsInt

func IsInt(n Any) bool

IsInt boolean check

func LT

func LT(args ...Any) bool

LT less-than TODO: can only compare ints and slice lens for now.

func LTEQ

func LTEQ(args ...Any) bool

LTEQ less-than or equal

func MOD

func MOD(a, b Any) int

MOD modulus operator

func MUL

func MUL(args ...Any) float64

MUL any number of int or float64 args ALWAYS returns a float64

func SUB

func SUB(args ...Any) float64

SUB any number of int or float64 args ALWAYS returns a float64

type Any

Any is an interface for any ZYLISP type

type Any interface{}

func Get

func Get(args ...Any) Any

Get ...

type Number

Number type

type Number struct {
    Value Any
}

func AddNumbers

func AddNumbers(args ...Number) (newNum Number, err error)

AddNumbers adds a series of numbers

func (Number) IsFloat

func (n Number) IsFloat() bool

IsFloat method on number type

func (Number) IsInt

func (n Number) IsInt() bool

IsInt method on number type

func (Number) ToFloat

func (n Number) ToFloat() float64

ToFloat method on number type

func (Number) ToInt

func (n Number) ToInt() int

ToInt method on number type

Subdirectories

Name Synopsis
..
generator
helpers
lexer
parser