-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathvalue.go
More file actions
25 lines (22 loc) · 816 Bytes
/
Copy pathvalue.go
File metadata and controls
25 lines (22 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package apl
import "io"
// Value is the result of an evaluation.
// Any type that implements the interface is a valid type for apl.
//
// The String method is used to display the value.
// It does not need to be unique or represent the input syntax.
// Mosty types have no input respresentation at all.
// They are the result of a computation.
//
// A Value may implement further interfaces such as Array, Uniform or Function.
type Value interface {
String(Format) string
Copy() Value
}
// VarReader is implemented by Values that are able to parse from a Reader.
// The ReadFrom method must return a new value of the same type.
// The function should be able to parse the format of it's String method.
// It is used by varfs in package io.
type VarReader interface {
ReadFrom(*Apl, io.Reader) (Value, error)
}