[erlang-questions] The quest for the perfect programming language for massive concurrency.

Richard A. O'Keefe ok@REDACTED
Fri Jan 31 05:56:57 CET 2014


I'd like to point out that static type systems
are not always the help you might expect.
Here's a puzzle from Jon Skeet's blog:

	using System;

	class X {
	    static int M(Func<int?, byte> x, object y) { return 1; } 
	    static int M(Func<  X,  byte> x, string y) { return 2; }
	    const int Value = 1000;
	    static void Main() {
	        var a =               M(X => (byte)X.Value, null));
	        unchecked {
	            Console.WriteLine(a);
	            Console.WriteLine(M(X => (byte)X.Value, null));
	        }
	    }
	}
The expression M(X => (byte)X.Value, null) is the same sequence
of tokens in each case.  The same identifiers are in scope.  The
output is
	1
	2

The explanation makes my head hurt.





More information about the erlang-questions mailing list