apoch / epoch-language

Home of the Epoch Programming Language Project
Other
72 stars 3 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 don.ap...@gmail.com on 15 Feb 2012 at 8:22

GoogleCodeExporter commented 9 years ago
Personally, i prefer var. Its so much shorter than auto. (no really, it is)

Original comment by ryoohki@gmail.com on 15 Feb 2012 at 8:27