Re: using a zip as a sequence?

"Paul Dufresne" <[email protected]> Wed, 26 Oct 2005 19:36:52 -0400
Newsgroups gmane.comp.lang.goo.general
Message-ID <[email protected]>
I have had to put back:
(use goo/boot)
(use goo/fun)
(use goo/class)
(use goo/macros)
(use goo/types)
(use goo/math)
at the beginning because exported was unknown.
This is probably too much to fix this but...

(1st myzip) now works, but I still cannot map a function over a zip:

goo/user 0<=3D (use /home/paul/zip.goo)
[Loading module /home/paul/zip.goo...
]
warning: 'unzip' from /home/paul/zip.goo clobbers local binding.
warning: '<zip>' from /home/paul/zip.goo clobbers local binding.
warning: 'zip' from /home/paul/zip.goo clobbers local binding.
goo/user 0=3D> #f
goo/user 0<=3D (set myzip (zip #(1 2 3 4) #( 5 6 7 8) ) )
goo/user 0=3D> #{<zip> zip-dat: #(#(1 2 3 4) #(5 6 7 8))}
goo/user 0<=3D (1st myzip)
goo/user 0=3D> #(1 5)
goo/user 0<=3D (snd myzip)
ERROR: Unbound variable snd.
Type ",restart N" to restart execution:
1. Return to interpreter level 1.
2. Return to interpreter level 0.
3. Exit the top-level interpreter.
goo/user 1<=3D (2nd myzip)
goo/user 1=3D> #(2 6)
goo/user 1<=3D (set myfun (fun (x) x))
goo/user 1=3D> #{Met ((x <any>))}
goo/user 1<=3D (map myfun #( 4 5 6) )
goo/user 1=3D> #(4 5 6)
goo/user 1<=3D (map myfun myzip)
ERROR: No applicable methods on #{Gen fab ((t #{T< <col>}) (s <int>) =3D>
<col>)} when called with (#{Class <zip> (<seq>)} 4).
Type ",restart N" to restart execution:

--=20
http://www.fastmail.fm - Same, same, but different=85


_______________________________________________
Googoogaga mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/googoogaga