Ver Fonte

приступил к демо10

kpmy há 10 anos atrás
pai
commit
4c4d906316
2 ficheiros alterados com 7 adições e 6 exclusões
  1. 1 1
      fw.go
  2. 6 5
      rt2/rules/with.go

+ 1 - 1
fw.go

@@ -28,7 +28,7 @@ func close() {
 func main() {
 	flag.Parse()
 	if name == "" {
-		name = "XevDemo10"
+		name = "XevDemo11"
 	}
 	global := &stdDomain{god: true}
 	modList := rtmod.New()

+ 6 - 5
rt2/rules/with.go

@@ -4,23 +4,24 @@ import (
 	"fw/cp/node"
 	"fw/rt2"
 	"fw/rt2/frame"
+	"fw/rt2/scope"
 )
 
 func withSeq(f frame.Frame) (seq frame.Sequence, ret frame.WAIT) {
 	n := rt2.NodeOf(f)
-	rt2.DataOf(f)[0] = n.Left() //if
+	rt2.RegOf(f)[0] = n.Left() //if
 	rt2.Push(rt2.New(n.Left()), f)
 	seq = func(f frame.Frame) (frame.Sequence, frame.WAIT) {
-		last := rt2.DataOf(f)[0].(node.Node)
-		done := rt2.DataOf(f)[last].(bool)
-		rt2.DataOf(f)[last] = nil
+		last := rt2.RegOf(f)[0].(node.Node)
+		done := scope.GoTypeFrom(rt2.ValueOf(f)[last.Adr()]).(bool)
+		rt2.ValueOf(f)[last.Adr()] = nil
 		if done && last.Right() != nil {
 			rt2.Push(rt2.New(last.Right()), f)
 			return frame.Tail(frame.STOP), frame.LATER
 		} else if last.Right() == nil {
 			return frame.End()
 		} else if last.Link() != nil { //elsif
-			rt2.DataOf(f)[0] = last.Link()
+			rt2.RegOf(f)[0] = last.Link()
 			rt2.Push(rt2.New(last.Link()), f)
 			return seq, frame.LATER
 		} else if n.Right() != nil { //else