On Wed, 2007-04-11 at 10:25 -0700, Erick Tryzelaar wrote:
> skaller wrote:

> 2. views/active patterns
> 
> see 
> http://blogs.msdn.com/dsyme/archive/2007/04/06/detailed-release-notes-for-1-9-1-8.aspx.
>  
> 
> This lets you extend pattern matching so that you can create virtual 
> constructors to match against.

Felix has had 'virtual' fields for ages. For any data type X
you can just define:

        fun get_field: X -> int = ...

and then given

        val x: X = ..

write

        x.field

which translates to

        get_field x

It's true you can't pattern match on structs though.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
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
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to