overloading ( was reference initialization )

From: Toby Moth (tmoth@nortelnetworks.com)
Date: Thu May 11 2000 - 16:16:51 MET DST

  • Next message: Nicolas GEORGE: "Re: ncurses interface for caml?"

    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



    This archive was generated by hypermail 2b29 : Thu May 11 2000 - 19:53:40 MET DST