Skip to content

Instantly share code, notes, and snippets.

View sunho's full-sized avatar
🐈
math is beutiful

Sunho Kim sunho

🐈
math is beutiful
View GitHub Profile
switch p := param.(type) {
case string:
ps = append(ps, p)
case *anchor:
i.anchor = p
case int:
ps = append(ps, fmt.Sprint(p))
case bool:
ps = append(ps, fmt.Sprint(p))
}
fmt.Errorf("Can't find anchor on action %s", i.Action)
func (it *instructionTranslator) transferInstructionSets(sets []*bytecode.InstructionSet) []*instructionSet {
iss := []*instructionSet{}
for _, set := range sets {
it.transferInstructionSet(iss, set)
}
return iss
}
package classes
const (
ObjectClass = "Object"
ClassClass = "Class"
IntegerClass = "Integer"
FloatClass = "Float"
StringClass = "String"
ArrayClass = "Array"
HashClass = "Hash"
func (vm *VM) newThread() *thread {
s := &stack{RWMutex: new(sync.RWMutex)}
cfs := &callFrameStack{callFrames: []callFrame{}}
t := &thread{stack: s, callFrameStack: cfs, sp: 0, cfp: 0}
s.thread = t
cfs.thread = t
t.vm = vm
return t
}
path, _ := filepath.Abs("$GOPATH/src/github.com/goby-lang/goby")
fmt.Sprintf("/usr/local/Cellar/goby/%s", Version)
if len(gobyRoot) == 0 {