Ilya Zakharevich on Sun, 05 Feb 2006 00:50:30 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PATCH 2.2.11+] Support for :: in identifiers


On Sat, Feb 04, 2006 at 04:50:29PM +0100, Bill Allombert wrote:
> > >        GP2C semantics [ x:int, v:vec ]. For the time being the type
> > >        information is discarded.
> > 
> > AFAICS, this syntax should not be broken by the patch.  On the other
> > hand, given that ":" may be useful, should not the type info be less
> > contradicting possible future syntax extensions (the first things
> > which comes to my mind is something like x.:int)?

> The current GP2C syntax allows to use : on any object as a cast:
> 1:int, 1.:gen, [1,2]:gen, log(x):real, x[2]:pol, (x\y):small etc. 
> are all valid.

I do not see how this relates to what I wrote.  Let me reiterate:

  Given that : has a lot of established mathematical (and CS) meaning,
  I think that it makes sense to reserve it for future use.
  Meanwhile, one can use something less conflicting for a type cast.
  E.g., something like .: or :. as in

    1:.int 1.:.gen [1,2]:.gen, log(x):.real, x[2]:.pol, (x\y):.small etc

Hope this helps,
Ilya