Documentation ¶
Index ¶
- Constants
- func Builtins(s *Serializer) []*libutil.Builtin
- func Dump(v *lisp.LVal, stringNums bool) ([]byte, error)
- func Load(b []byte, stringNums bool) *lisp.LVal
- func LoadPackage(env *lisp.LEnv) *lisp.LVal
- type Serializer
- func (s *Serializer) Dump(v *lisp.LVal, stringNums bool) ([]byte, error)
- func (s *Serializer) DumpBytesBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- func (s *Serializer) DumpMessageBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- func (s *Serializer) DumpStringBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- func (s *Serializer) GoError(v *lisp.LVal) errordeprecated
- func (s *Serializer) GoFloat64(v *lisp.LVal) (float64, bool)deprecated
- func (s *Serializer) GoInt(v *lisp.LVal) (int, bool)deprecated
- func (s *Serializer) GoMap(v *lisp.LVal, stringNums bool) (SortedMap, bool)deprecated
- func (s *Serializer) GoSlice(v *lisp.LVal, stringNums bool) ([]interface{}, bool)deprecated
- func (s *Serializer) GoString(v *lisp.LVal) (string, bool)deprecated
- func (s *Serializer) GoValue(v *lisp.LVal, stringNums bool) interface{}deprecated
- func (s *Serializer) Load(b []byte, stringNums bool) *lisp.LVal
- func (s *Serializer) LoadBytesBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- func (s *Serializer) LoadMessageBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- func (s *Serializer) LoadStringBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- func (s *Serializer) MessageBytesBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- func (s *Serializer) SymbolName(v *lisp.LVal) (string, bool)deprecated
- func (s *Serializer) UseStringNumbersBuiltin(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal
- type SortedMap
Constants ¶
const DefaultPackageName = "json"
DeafultPackageName is the package name used by LoadPackage.
Variables ¶
This section is empty.
Functions ¶
func Builtins ¶
func Builtins(s *Serializer) []*libutil.Builtin
Builtins takes the default serializer for a lisp environment and returns a set of package builtin functions that use it.
Types ¶
type Serializer ¶
Serializer defines JSON serialization rules for lisp values.
func DefaultSerializer ¶
func DefaultSerializer() *Serializer
func (*Serializer) DumpBytesBuiltin ¶
func (*Serializer) DumpMessageBuiltin ¶
func (*Serializer) DumpStringBuiltin ¶
func (*Serializer) GoError
deprecated
func (s *Serializer) GoError(v *lisp.LVal) error
GoError returns an error that represents v. If v is not LError then nil is returned.
Deprecated: GoError is no longer used internally for serialization and should be avoided.
func (*Serializer) GoFloat64
deprecated
func (s *Serializer) GoFloat64(v *lisp.LVal) (float64, bool)
GoFloat64 converts the numeric value that v represents to a float64 and returns it with the value true. If v does not represent a number GoFloat64 returns a false second argument
Deprecated: GoFloat64 is no longer used internally for serialization and should be avoided.
func (*Serializer) GoInt
deprecated
func (s *Serializer) GoInt(v *lisp.LVal) (int, bool)
GoInt converts the numeric value that v represents to and int and returns it with the value true. If v does not represent a number GoInt returns a false second argument
Deprecated: GoInt is no longer used internally for serialization and should be avoided.
func (*Serializer) GoMap
deprecated
GoMap converts an LSortMap to its Go equivalent and returns it with a true second argument. If v does not represent a map json serializable map GoMap returns a false second argument
Deprecated: GoMap is no longer used internally for serialization and should be avoided.
func (*Serializer) GoSlice
deprecated
func (s *Serializer) GoSlice(v *lisp.LVal, stringNums bool) ([]interface{}, bool)
GoSlice returns the string that v represents and the value true. If v does not represent a string GoSlice returns a false second argument
Deprecated: GoSlice is no longer used internally for serialization and should be avoided.
func (*Serializer) GoString
deprecated
func (s *Serializer) GoString(v *lisp.LVal) (string, bool)
GoString returns the string that v represents and the value true. If v does not represent a string GoString returns a false second argument
Deprecated: GoString is no longer used internally for serialization and should be avoided.
func (*Serializer) GoValue
deprecated
func (s *Serializer) GoValue(v *lisp.LVal, stringNums bool) interface{}
GoValue converts v to its natural representation in Go. Quotes are ignored and all lists are turned into slices. Symbols are converted to strings. The value Nil() is converted to nil. Functions are returned as is.
Deprecated: GoValue is no longer used internally for serialization and should be avoided.
func (*Serializer) Load ¶
func (s *Serializer) Load(b []byte, stringNums bool) *lisp.LVal
Load parses b and returns an LVal representing its structure.
func (*Serializer) LoadBytesBuiltin ¶
func (*Serializer) LoadMessageBuiltin ¶
func (*Serializer) LoadStringBuiltin ¶
func (*Serializer) MessageBytesBuiltin ¶
func (*Serializer) SymbolName
deprecated
func (s *Serializer) SymbolName(v *lisp.LVal) (string, bool)
SymbolName returns the name of the symbol that v represents and the value true. If v does not represent a symbol SymbolName returns a false second argument
Deprecated: SymbolName is no longer used internally for serialization and should be avoided.