func (s *Block) GetWordDefault(address rune, def float64) (res float64) {
	res, err := s.GetWord(address)
	if err != nil {
		return def
	}
	return res
}
Same as GetWord, but has a default value.
package gcode
import "strconv"
import "strings"
import "errors"
import "fmt"
type Node interface {
	GetType() string
	Export(precision int) string
}
type Word struct {
	Address rune
	Command float64
}
type Comment struct {
	Content string
	EOL     bool
}
type Filemarker struct{}
func (w *Word) GetType() string {
	return "word"
}
func (w *Word) Export(precision int) string {
	x := strconv.FormatFloat(w.Command, 'f', precision, 64)
	if strings.IndexRune(x, '.') != -1 {
		for x[len(x)-1] == '0' {
			x = x[:len(x)-1]
		}
		if x[len(x)-1] == '.' {
			x = x[:len(x)-1]
		}
	}
	return string(w.Address) + x
}
func (c *Comment) GetType() string {
	return "comment"
}
func (c *Comment) Export(precision int) string {
	if c.EOL {
		return ";" + c.Content
	} else {
		return "(" + c.Content + ")"
	}
}
func (f *Filemarker) GetType() string {
	return "filemarker"
}
func (f *Filemarker) Export(precision int) string {
	return "%"
}
type Block struct {
	Nodes       []Node
	BlockDelete bool
}
func (s *Block) AppendNode(n Node) {
	s.Nodes = append(s.Nodes, n)
}
func (s *Block) AppendNodes(n ...Node) {
	for _, m := range n {
		s.AppendNode(m)
	}
}
func (s *Block) Export(precision int) string {
	var k string
	if s.BlockDelete {
		return ""
	}
	for _, c := range s.Nodes {
		k += c.Export(precision)
	}
	return k
}
func (s *Block) Length() int {
	return len(s.Nodes)
}
func (s *Block) GetWord(address rune) (res float64, err error) {
	found := false
	for _, m := range s.Nodes {
		if word, ok := m.(*Word); ok {
			if word.Address == address {
				if found {
					return res, errors.New(fmt.Sprintf("Multiple instances of address '%c' in block", address))
				}
				found = true
				res = word.Command
			}
		}
	}
	if !found {
		return res, errors.New(fmt.Sprintf("'%c' not found in block", address))
	}
	return res, nil
}