Version française
Home     About     Download     Resources     Contact us    
Browse thread
overloading ( was reference initialization )
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Toby Moth <tmoth@n...>
Subject: overloading ( was reference initialization )
1. If you are thinking about overloading binary operators, such as +,
might it be possible to introduce a unary 'any' operator which gives any old
value of
the right type ?

let init_val = ( any : t )

Ideally, this value should exhibit some form of lazy behaviour, especially
when t is a reference type.
This might keep someone like Hongwei Xi happier.

2. Also, have there been any thoughts about overloading list
pattern-matching syntax,
so that we have a functional style for handling general container types ?

let ([]) : container->bool = fun c -> ...
let (::) : container->(element,container) = fun c -> ( ..., ... )

Obviously, I am not suggesting syntax here, only the kinds of functions that
one would
need to be able to bind to [] and ::.

Toby Moth