aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/ystream.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-06-01 00:22:44 +0000
committerdos-reis <gdr@axiomatics.org>2010-06-01 00:22:44 +0000
commit5b0462a5f0b499c2c3177e36e52b476875141969 (patch)
treea698fd6d161395245e4b1bdc349724f503ec8c44 /src/algebra/ystream.spad.pamphlet
parenta1eeda981dd4d753a805ff4a13a4ef26d167a7fb (diff)
downloadopen-axiom-5b0462a5f0b499c2c3177e36e52b476875141969.tar.gz
* interp/g-util.boot: Add more opcodes.
* algebra/syntax.spad.pamphlet: Clean up. * algebra/variable.spad.pamphlet: Likewise. * algebra/ystream.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra/ystream.spad.pamphlet')
-rw-r--r--src/algebra/ystream.spad.pamphlet14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/algebra/ystream.spad.pamphlet b/src/algebra/ystream.spad.pamphlet
index 2f63b7bb..a085c647 100644
--- a/src/algebra/ystream.spad.pamphlet
+++ b/src/algebra/ystream.spad.pamphlet
@@ -38,20 +38,22 @@ ParadoxicalCombinatorsForStreams(A):Exports == Implementation where
++ a list of n streams and returns a list of n streams.
Implementation ==> add
+ import %head: ST A -> A from Foreign Builtin
+ import %tail: ST A -> ST A from Foreign Builtin
Y f ==
- y : ST A := CONS(0$I,0$I)$Lisp
+ y : ST A := %makepair(0$I,0$I)$Foreign(Builtin)
j := f y
- RPLACA(y,frst j)$Lisp
- RPLACD(y,rst j)$Lisp
+ %store(%head y,frst j)$Foreign(Builtin)
+ %store(%tail y,rst j)$Foreign(Builtin)
y
Y(g,n) ==
- x : L ST A := [CONS(0$I,0$I)$Lisp for i in 1..n]
+ x : L ST A := [%makepair(0$I,0$I)$Foreign(Builtin) for i in 1..n]
j := g x
for xi in x for ji in j repeat
- RPLACA(xi,frst ji)$Lisp
- RPLACD(xi,rst ji)$Lisp
+ %store(%head xi,frst ji)$Foreign(Builtin)
+ %store(%tail xi,rst ji)$Foreign(Builtin)
x
@