Sudarshan Gaikaiwari wrote:
> Hi
> 
> I worked on operator overloading for Unicon while I was at NMSU.
> 
> I believe my changes are checked into the Unicon cvs repository on
> sourceforge.
> Operator overloading is not turned on be default (yet) rightly as you will
> see from the explanation below.
> 
> To turn on operator overloading get the sources from cvs and
> 
> 1. go to src/h/define.h and uncomment OVLD
> 2. build both icont and iconx.
> 
> See the attached file uniconovld.icn for an example of how to use the
> operator overloading feature. I have also attached a file that has the map
> of operators to method names.

This is *really* interesting.  I've had a number of occasions where 
overloading would be nice!  It's going to be fun playing with this
when I get some time.

A natural extension (to me, anyway) would be to modify the parser to
allow actual operators as method names - removing the need for the map. 
  As in:

    method ||(a)
        return this.stringValue() || string(a)
    end

Did you by any chance look at this?  Do you have a feel how hard this
would be to implement?  Is anyone interested in doing so?

And of course, given that syntax, how hard could it be to add
procedures also?:

    procedure ||(a,b)
        returm string(a)||string(b)
    end


--
Steve Wampler     [EMAIL PROTECTED]
The gods that smiled upon your birth are laughing now. -- fortune cookie

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to