-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathprim_setup.go
51 lines (44 loc) · 1.34 KB
/
prim_setup.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2014 SteelSeries ApS. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This package implements a basic LISP interpretor for embedding in a go program for scripting.
// This file contains the built-in primitive functions.
package golisp
var DebugTrace = false
var LispTrace = false
var quasiquoteLevel = 1
func init() {
InitLisp()
}
func InitLisp() {
InitEnvironments()
InitBuiltins()
}
func InitEnvironments() {
Global = NewSymbolTableFrameBelow(nil, "SystemGlobal")
Global.BindToProtected(Intern("nil"), EmptyCons())
Global.BindToProtected(Intern("system-global-environment"), EnvironmentWithValue(Global))
}
func InitBuiltins() {
RegisterTypePredicatePrimitives()
RegisterMathPrimitives()
RegisterBinaryPrimitives()
RegisterRelativePrimitives()
RegisterSpecialFormPrimitives()
RegisterMacroPrimitives()
RegisterMutatorPrimitives()
RegisterListManipulationPrimitives()
RegisterListAccessPrimitives()
RegisterListFunctionsPrimitives()
RegisterListSetPrimitives()
RegisterAListPrimitives()
RegisterSystemPrimitives()
RegisterBytearrayPrimitives()
RegisterStringPrimitives()
RegisterDebugPrimitives()
RegisterFramePrimitives()
RegisterConcurrencyPrimitives()
RegisterEnvironmentPrimitives()
RegisterIOPrimitives()
RegisterChannelPrimitives()
}