-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.go
34 lines (29 loc) · 993 Bytes
/
shell.go
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
26
27
28
29
30
31
32
33
34
/*
* Droscheme - a Scheme implementation
* Copyright © 2012 Andrew Robbins, Daniel Connelly
*
* This program is free software: it is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. You can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License (LGPLv3): <http://www.gnu.org/licenses/>.
*/
package droscheme
import (
)
// (ds builtin)
func BuiltinEnv() *Env {
return DinteractionZKenvironment(list0()).(*Env)
}
// (eval expr env)
func Eval(expr Any, env *Env) (value Any, err error) {
defer PanicToError(values0())
return Deval(list2(expr, env)), nil
}
func ReadPort(port Any) (value Any, err error) {
defer PanicToError(values0())
return Dread(list1(port)), nil
}
func Load(filename string, env *Env) (value Any, err error) {
defer PanicToError(values0())
return Kload(Void(), list1(ToString(filename)), env), nil
}