Ralf Hemmecke <[EMAIL PROTECTED]> writes:

> >> I must say, no matter whether it is syntactic sugar or not, a
> >> definition of the form
> >>
> >> (*)     D(P : Polynomial (R : Ring)) : ... == ...
> >>
> >> would confuse me. How am I supposed to used that? Should I write
> > Boy, my first email this morn had a few more typos than I would have
> > liked.  Ill try to ensure I have at least one cup of coffee before
> > sitting down to write an email :)
> > In the scheme I was (trying, badly) to suggest would have looked as
> > follows:
> >         D(p : Polynomial (R : Ring)) : ... == ..
> > Notice the p is lowercased, hense denoting a domain value.
> 
> Oh, you would like to turn a convention into a language construct. I
> have programmed enough in Aldor to be able to say, that is a bad thing.
> Note that + or 1 can be used to denote identifiers in Aldor. Are they
> lower or upper case?

Im not going to try and defend the idea, as I feel I can work with
simpler notions.  But 1 and + would be considered value identifiers.

> 
> >> Now suppose I define
> >>
> >> define MyPolyCat:Category == Polynom(Integer) with ...
> >> MyPoly: MyPolyCat == add ...
> >>
> >> Now can I write
> >>
> >>    D MyPoly
> >>
> >> ??? (Note that it doesn't exactly match your pattern (*).)
> >> Or should I rather write
> >>
> >>    D(Integer, MyPoly)
> >>
> >> even with just the definition (*)?
> >>
> >> I cannot see that I would like such sugar.
> > Ok, sorry for the confusion.  Using your example, I would have
> > written:  D(P : Polynom(R : Ring)) ...
> > Then yes, you would write `D MyPoly'.
> 
> So then let's go on. How would MyPoly now tell you that it is defined
> over Integer? Its type is MyPolyCat (there is still no Integer). So in
> order to find out that the Argument I give you fits your pattern, you
> have to look inside the category hierarchy. OK, should be doable, but
> is more than just pattern matching. Still, I don't like it.
> 
> Suppose you would have something like
> 
> DAldor(R: Ring, D1: CatA(R), D2: CatB(R)): ...
> 
> Then your way would probably lead to
> 
> DSteve(D1: CatA(R: Ring), D2: CatB(R: Ring)): ...
> 
> That is needless doubly typing "Ring" and even worse, it is ambiguous.
> Who does tell me that this definition would be equal or different from
> 
> DSteve(D1: CatA(R: Ring), D2: CatB(S: Ring)): ...
> 
> I must say, if you modify the language in that direction, I am the
> first who doesn't follow your direction.

No, my way would be:

   DSteve(D1: CatA(R: Ring), D2: CatB(R)): ...

However, I need to explore the use tuples exclusively to lift types
otherwise hidden by sope into an enclosing context.  I suspected that
type patterns would be generally useful but I like the simplicity of
Martins approach and will try to work with that.

> 
> Ralf


Thanks,
Steve



_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to