>> Basically, I'd like to write >> >> F(G,H,K) >> >> similar to what is done in the univariate case (see >> http://www.risc.uni-linz.ac.at/people/hemmecke/AldorCombinat/combinatsu26.html#x40-580008.13 >> >> Actually that is not a problem for bi- tri-, ... n-variate species. >> But that would mean n implementations of basically equivalent code. >> As you might guess, I don't want to double code and rather write generic >> code for that situation. Aldor doesn't let me specify this at compile time. >> Since Python is interpreted, you might be more lucky. > > I see. So the issue is that Aldor classes/categories can't take > variable number of parameters?
No. There is Tuple for such issues. In fact -> is a type constructor in Aldor with the following definition. ((A: Tuple Type) -> (R: Tuple Type)): with == add; which later allows you to write functions of the form f: (A, B, C) -> (D, E) and -> is an infix type constructor that allows any numer of arguments before and after it. So if I define X(T: Tuple PrimitiveType): with == add; then X is a type constructor that can be uses like X() X(String) X(Integer) X(String, Integer) etc. But Aldor would not allow me to write X(TextWriter) since the domain TextWriter is not of type PrimitiveType. So there is type-safety here. The problem actually is if you have a functor F: PrimitiveType->PrimitiveType which I want to apply to every element of the tuple, then there is no way to express that in Aldor. Well, actually, there is, but it's not nice and the compiler doesn't like it. It is basically an identification problem. Second, the construction of elements of such a type is somehow impossible. > I guess I avoid the problem by having > my species be objects/elements instead of classes/domains/categories. Well, somehow I seem to have seen it. You said something like L.define(E+X*L) or something like that. I think I have to look more closely to your define method. Ralf ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Aldor-combinat-devel mailing list Aldor-combinat-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/aldor-combinat-devel