Documentation ¶
Index ¶
- Variables
- func AddLoadPath(fs fs.FS)
- func NewEnvironment(opts ...EvalOption) value.Environment
- func RTReadString(s string) interface{}
- func ReadEval(code string, options ...ReadEvalOption) interface{}
- type EvalError
- type EvalOption
- type Fn
- type Program
- type RTMethods
- func (rt *RTMethods) Alength(x interface{}) int
- func (rt *RTMethods) BooleanCast(x interface{}) bool
- func (rt *RTMethods) ByteCast(x interface{}) byte
- func (rt *RTMethods) CharCast(x interface{}) Char
- func (rt *RTMethods) Contains(coll, key interface{}) bool
- func (rt *RTMethods) Dissoc(x interface{}, k interface{}) interface{}
- func (rt *RTMethods) Find(coll, key interface{}) interface{}
- func (rt *RTMethods) FindVar(qualifiedSym *Symbol) *Var
- func (rt *RTMethods) IntCast(x interface{}) int
- func (rt *RTMethods) Load(scriptBase string)
- func (rt *RTMethods) Munge(name string) string
- func (rt *RTMethods) NextID() int
- func (rt *RTMethods) Nth(x interface{}, i int) interface{}
- func (rt *RTMethods) NthDefault(x interface{}, i int, def interface{}) interface{}
- func (rt *RTMethods) Peek(x interface{}) interface{}
- func (rt *RTMethods) Pop(x interface{}) interface{}
- func (rt *RTMethods) Subvec(v IPersistentVector, start, end int) IPersistentVector
- func (rt *RTMethods) ToArray(coll interface{}) interface{}
- func (rt *RTMethods) UncheckedCharCast(x interface{}) Char
- type ReadEvalOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SymbolUnquote = value.NewSymbol("clojure.core/unquote") // TODO: rename to glojure.core/unquote SymbolSpliceUnquote = value.NewSymbol("splice-unquote") SymbolNamespace = value.NewSymbol("ns") SymbolInNamespace = value.NewSymbol("in-ns") SymbolUserNamespace = value.NewSymbol("user") SymbolDot = value.NewSymbol(".") )
View Source
var (
Compiler = &evalCompiler{}
)
View Source
var (
RT = &RTMethods{}
)
Functions ¶
func NewEnvironment ¶
func NewEnvironment(opts ...EvalOption) value.Environment
func RTReadString ¶
func RTReadString(s string) interface{}
func ReadEval ¶
func ReadEval(code string, options ...ReadEvalOption) interface{}
ReadEval reads and evaluates a string that may contain one or more forms in the global environment.
Types ¶
type EvalOption ¶
type EvalOption func(*evalOptions)
func WithLoadPath ¶
func WithLoadPath(path []string) EvalOption
func WithStderr ¶
func WithStderr(w io.Writer) EvalOption
func WithStdout ¶
func WithStdout(w io.Writer) EvalOption
type Fn ¶
type Fn struct {
// contains filtered or unexported fields
}
func (*Fn) Meta ¶
func (fn *Fn) Meta() lang.IPersistentMap
func (*Fn) WithMeta ¶
func (fn *Fn) WithMeta(meta lang.IPersistentMap) interface{}
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func (*Program) Eval ¶
func (p *Program) Eval(opts ...EvalOption) (interface{}, error)
type RTMethods ¶
type RTMethods struct {
// contains filtered or unexported fields
}
RT is a struct with methods that map to Clojure's RT class' static methods. This approach is used to make translation of core.clj to Glojure easier.
func (*RTMethods) BooleanCast ¶
func (*RTMethods) NthDefault ¶
func (*RTMethods) UncheckedCharCast ¶
func (rt *RTMethods) UncheckedCharCast(x interface{}) Char
type ReadEvalOption ¶
type ReadEvalOption func(*readEvalOptions)
ReadEvalOption is an option for ReadEval.
func WithEnv ¶
func WithEnv(env value.Environment) ReadEvalOption
WithEnv sets the environment to use for evaluation.
func WithFilename ¶
func WithFilename(filename string) ReadEvalOption
WithFilename sets the filename to use for evaluation.
Click to show internal directories.
Click to hide internal directories.