On 10/27/07, Ralf Hemmecke wrote: > > Let me cite the documentation from stream.spad.pamphlet > > ++ A stream is an implementation of an infinite sequence using > ++ a list of terms that have been computed and a function closure > ++ to compute additional terms when needed. > > First, a stream is an infinite sequence. If we get > > (6) -> s:=construct([1,2,3])$Stream(Integer) > (6) -> > (6) [1,2,3] > Type: Stream > Integer > (7) -> s.4 > 7) -> > >> Error detected within library code: > elt: no such element > > Then there is either something wrong with the code or with the > documentation. >
I think it is the documentation. Given the exports of Stream, it obviously should say only "potentially infinite". > Second, according to the documentation a Stream is a pair (A,B) where A > is a list of precomputed functions and B is a function that computes the > next value. > > If you would like to know the difference between Stream and Generator, > then think of a Generator as the B part above. > Ok. > ... > > The larger question remains however: When to use a domain to directly > > model something that is "set-like" and when to define a higher-order > > domain whose objects are "set-like"? To me this is not clear in either > > Spad or Aldor. > > I don't think you gain very much if you only consider set-like domains. > If, however, you are looking at finite fields, for sure, you will think > of a domain, since it is more important that there are some operations > that connect the elements. > So you say it is natural to define "PrimeField 7" as a domain itself rather than defining a general domain of "PrimeFields" and constructing "PrimeField 7" as an element of that domain? Yes, I think that makes sense. But there are of course some operations that connect elements of any well defined set, no? If it is only a matter of degree, then I still think it is rather confusing that Axiom (and Aldor) provides these two rather different alternative implementation of something that is essentially the same. I suppose what I am saying is that (maybe) there should really be no distinction between domains and members of domains (objects) - that all objects should also be domains in and of themselves. But of course that is not the way Axiom was designed. Regards, Bill Page. _______________________________________________ Axiom-math mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/axiom-math
