Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] What about polymorphic methods?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Prevost <j.prevost@c...>
Subject: Re: [Caml-list] What about polymorphic methods?
>>>>> "jg" == Jacques Garrigue <> writes:

    jg> With the CVS version, you would have to write

    jg>    method left_iter : 'b. ('a -> 'b) -> 'b list = fun f -> ...
    jg>    method right_iter : 'b. ('a -> 'b) -> 'b list = fun f -> ...

    jg> Of course, 'b is no longer a parameter of the class.  Note
    jg> that polymorphic methods can only be called on objects whose
    jg> type is (at least partially) known, so you may have to add a
    jg> few extra type annotations to your code.

They're coming back?  Woohoo!

What will the restrictions on typing be, precisely?

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: