func Runes(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("runes")
	if len(args) == 0 {
		return wdte.GoFunc(Runes)
	}
	a := args[0]
	var r io.RuneReader
	switch a := a.(type) {
	case io.RuneReader:
		r = a
	case io.Reader:
		r = bufio.NewReader(a)
	default:
		panic(fmt.Errorf("Unexpected argument type: %T", a))
	}
	return runeStream{r: r}
}
Runes is a WDTE function with the following signature:

runes r

Returns a stream.Stream that yields individual Unicode characters
from the reader r as numbers.

TODO: Maybe it makes more sense for them to be yielded as strings
with a length of one.
package io
import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os"
	"github.com/DeedleFake/wdte"
	"github.com/DeedleFake/wdte/std"
	"github.com/DeedleFake/wdte/wdteutil"
)
var (
	Stdin  io.Reader = os.Stdin
	Stdout io.Writer = os.Stdout
	Stderr io.Writer = os.Stderr
)
type stdin struct{}
func (r stdin) Call(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	return r
}
func (stdin) Read(buf []byte) (int, error) {
	return Stdin.Read(buf)
}
func (stdin) String() string {
	return "<reader(stdin)>"
}
func (stdin) Reflect(name string) bool {
	return name == "Reader"
}
type stdout struct{}
func (w stdout) Call(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	return w
}
func (stdout) Write(data []byte) (int, error) {
	return Stdout.Write(data)
}
func (stdout) String() string {
	return "<writer(stdout)>"
}
func (stdout) Reflect(name string) bool {
	return name == "Writer"
}
type stderr struct{}
func (w stderr) Call(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	return w
}
func (stderr) Write(data []byte) (int, error) {
	return Stderr.Write(data)
}
func (stderr) String() string {
	return "<writer(stderr)>"
}
func (stderr) Reflect(name string) bool {
	return name == "Writer"
}
type reader interface {
	wdte.Func
	io.Reader
}
type Reader struct {
	io.Reader
}
func (r Reader) Call(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	return r
}
func (r Reader) String() string {
	if inner, ok := r.Reader.(fmt.Stringer); ok {
		return inner.String()
	}
	return "<reader>"
}
func (r Reader) Reflect(name string) bool {
	return name == "Reader"
}
type writer interface {
	wdte.Func
	io.Writer
}
type Writer struct {
	io.Writer
}
func (w Writer) Call(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	return w
}
func (w Writer) String() string {
	if inner, ok := w.Writer.(fmt.Stringer); ok {
		return inner.String()
	}
	return "<writer>"
}
func (w Writer) Reflect(name string) bool {
	return name == "Writer"
}
func Seek(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("seek")
	if len(args) < 3 {
		return wdteutil.SaveArgsReverse(wdte.GoFunc(Seek), args...)
	}
	s := args[0].(io.Seeker)
	off := int64(args[1].(wdte.Number))
	rel := args[2].(wdte.Number)
	var w int
	switch {
	case rel < 0:
		w = io.SeekEnd
	case rel == 0:
		w = io.SeekCurrent
	case rel > 0:
		w = io.SeekStart
	}
	_, err := s.Seek(off, w)
	if err != nil {
		return wdte.Error{Err: err, Frame: frame}
	}
	return s.(wdte.Func)
}
func Close(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("close")
	if len(args) == 0 {
		return wdte.GoFunc(Close)
	}
	c := args[0].(io.Closer)
	err := c.Close()
	if err != nil {
		return wdte.Error{Err: err, Frame: frame}
	}
	return c.(wdte.Func)
}
func Combine(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("combine")
	if len(args) < 2 {
		return wdteutil.SaveArgs(wdte.GoFunc(Combine), args...)
	}
	switch a0 := args[0].(type) {
	case reader:
		r := make([]io.Reader, 1, len(args))
		r[0] = a0
		for _, a := range args[1:] {
			r = append(r, a.(reader))
		}
		return Reader{Reader: io.MultiReader(r...)}
	case writer:
		w := make([]io.Writer, 1, len(args))
		w[0] = a0
		for _, a := range args[1:] {
			w = append(w, a.(writer))
		}
		return Writer{Writer: io.MultiWriter(w...)}
	default:
		panic(fmt.Errorf("Unexpected argument type: %T", a0))
	}
}
func Copy(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("copy")
	if len(args) < 2 {
		return wdteutil.SaveArgs(wdte.GoFunc(Copy), args...)
	}
	var w writer
	var r reader
	var a1 wdte.Func
	switch a0 := args[0].(type) {
	case writer:
		w = a0
		r = args[1].(reader)
		a1 = r
	case reader:
		w = args[1].(writer)
		r = a0
		a1 = w
	}
	_, err := io.Copy(w, r)
	if err != nil {
		return wdte.Error{Err: err, Frame: frame}
	}
	return a1
}
func String(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("string")
	if len(args) == 0 {
		return wdte.GoFunc(String)
	}
	r := args[0].(reader)
	var buf bytes.Buffer
	_, err := io.Copy(&buf, r)
	if err != nil {
		return wdte.Error{Err: err, Frame: frame}
	}
	return wdte.String(buf.String())
}
type scanner struct {
	s *bufio.Scanner
}
func (s scanner) Call(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	return s
}
func (s scanner) Next(frame wdte.Frame) (wdte.Func, bool) {
	ok := s.s.Scan()
	if !ok {
		err := s.s.Err()
		if err != nil {
			return wdte.Error{Err: err, Frame: frame}, false
		}
		return nil, false
	}
	return wdte.String(s.s.Text()), true
}
func (s scanner) Reflect(name string) bool {
	return name == "Stream"
}
func Lines(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("lines")
	if len(args) == 0 {
		return wdte.GoFunc(Lines)
	}
	r := args[0].(reader)
	return scanner{s: bufio.NewScanner(r)}
}
func Words(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("words")
	if len(args) == 0 {
		return wdte.GoFunc(Words)
	}
	r := args[0].(reader)
	s := bufio.NewScanner(r)
	s.Split(bufio.ScanWords)
	return scanner{s: s}
}
func Scan(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	frame = frame.Sub("scan")
	if len(args) < 2 {
		return wdteutil.SaveArgs(wdte.GoFunc(Scan), args...)
	}
	var r reader
	var sep wdte.String
	switch a0 := args[0].(type) {
	case reader:
		r = a0
		sep = args[1].(wdte.String)
	case wdte.String:
		r = args[1].(reader)
		sep = a0
	}
	seb := []byte(sep)
	s := bufio.NewScanner(r)
	s.Split(func(data []byte, eof bool) (int, []byte, error) {
		start := bytes.Index(data, seb)
		if start < 0 {
			if eof {
				if len(data) == 0 {
					return 1, nil, nil
				}
				return len(data), data, nil
			}
			return 0, nil, nil
		}
		return start + len(seb), data[:start], nil
	})
	return scanner{s: s}
}
type runeStream struct {
	r io.RuneReader
}
func (r runeStream) Call(frame wdte.Frame, args ...wdte.Func) wdte.Func {
	return r
}
func (r runeStream) Next(frame wdte.Frame) (wdte.Func, bool) {
	c, _, err := r.r.ReadRune()
	if err != nil {
		if err == io.EOF {
			return nil, false
		}
		return wdte.Error{Frame: frame, Err: err}, true
	}
	return wdte.Number(c), true
}
func (r runeStream) Reflect(name string) bool {
	return name == "Stream"
}