epoch-language icon indicating copy to clipboard operation
epoch-language copied to clipboard

C# "var" or C++11 "auto" feature

Open GoogleCodeExporter opened this issue 10 years ago • 1 comments

Introduce a keyword (probably "var") which indicates that a variable's type 
should be inferred from its initializer.


var this_will_be_an_integer = 42
var this_will_be_a_real = 3.14159
var this_will_be_a_string = "test"
var this_will_be_a_boolean = false
var this_will_be_a_compile_error = "some", "aggregate", "type"


// Given:
foo : integer x -> return y = x + 1

var this_will_be_a_function = foo

Original issue reported on code.google.com by [email protected] on 15 Feb 2012 at 8:22

GoogleCodeExporter avatar Apr 21 '15 05:04 GoogleCodeExporter

Personally, i prefer var. Its so much shorter than auto. (no really, it is)

Original comment by [email protected] on 15 Feb 2012 at 8:27

GoogleCodeExporter avatar Apr 21 '15 05:04 GoogleCodeExporter