Too easy! 5 minutes:
// An OO experiment
interface AA {
setx: int -> void;
sety: int -> void;
getx:1 -> int;
gety:1 -> int;
sum: 1 -> int;
}
fun X (var x:int, var y:int) : AA = {
proc setx(a:int) { x = a; }
proc sety(a:int) { x = a; }
fun getxx => x;
fun getx() => x;
fun gety () => y;
fun sum () => x + y;
return (setx=setx, sety=sety, getx=getx, gety=gety, sum=sum);
}
Implementation: interface is nothing more than a record typedef.
A couple of lines in the parser to implement.
--
john skaller
[email protected]
http://felix-lang.org
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language