Commit 4fd9dd5e authored by Juergen Nickelsen's avatar Juergen Nickelsen
Browse files

reordered Function struct to save on padding space

parent 1ab862e8
......@@ -36,13 +36,13 @@ var ftypeS = [...]string{
}
type Function struct {
ftype funcType
builtin Builtin // for builtins only, obviously
name string // function/macro name
fi *FormInfo // nil for a Builtin
minargs int
maxargs int
doc string
name string // function/macro name
ftype funcType
special bool // for macros (always special) and builtins
trace bool
}
......@@ -434,7 +434,7 @@ func makeForm(name string, arglAndBody lob.Object, ftype funcType) *Function {
formInfo.bodyForms = MacroExpandBody(bodyForms)
formInfo.env = lob.Env
return &Function{
ftype, nil, name, formInfo, minargs, maxargs, docString,
nil, formInfo, minargs, maxargs, docString, name, ftype,
ftype == MACRO, false,
}
}
......@@ -449,8 +449,8 @@ func Init_funtype() {
for _, bd := range allBuiltins {
builtinCounter++
sym := lob.Intern(bd.name)
f := &Function{BUILTIN, bd.function, bd.name, nil,
bd.minargs, bd.maxargs, strings.TrimSpace(bd.doc),
f := &Function{bd.function, nil, bd.minargs, bd.maxargs,
strings.TrimSpace(bd.doc), bd.name, BUILTIN,
bd.isspecial, false}
sym.SetFunction(f)
sym.PutProp(lob.FuncDefinedIn, lob.NewString(bd.source))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment