Commit 26b3dca5 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-04-20 22:49:57 by beppe] Empty log message

Original author: beppe
Date: 2005-04-20 22:49:57+00:00
parent 9516babc
......@@ -43,7 +43,7 @@ let x : ref Int =
<p>
Another advantage is that it is possible to define the types for read only and write only channels, which can be specialized respectively in a covariant and contravariant way.
For instance if the body of a function performs on some integer reference passed as argument only read operations, then it can specify its input type as <code>fun ( x :{ get = []->%%T%% } )...</code>. In this case the function can accept as argument any reference of type <code>ref %%S%%</code>, with <code>%%S%%</code> subtype of <code>%%T%%</code>.
For instance if the body of a function performs on some integer reference passed as argument only read operations, then it can specify its input type as <code>fun ( x :{ get = []->%%T%% ; ..} )...</code>. In this case the function can accept as argument any reference of type <code>ref %%S%%</code>, with <code>%%S%%</code> subtype of <code>%%T%%</code>.
</p>
</box>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment