ID:1694297
 
Keywords: auto, inference, type
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
I'd like to propose the addition of type inference into the DM language (specifically, for objects). Something along the lines of C++11's auto keyword or JavaScript's built-in variable handling.

// Instead of this...
var mob/m = new (src.loc)
world << m.loc

// You could have a new keyword (auto) for this:
auto m = new /mob(src.loc)
world << m.loc

// Or even a new operator that does the same:
var m := new /mob(src.loc)
world << m.loc

// This new syntax would also eliminate the need for the : operator, which is commonly abused:
var m = new /mob(src.loc)
world << m:loc
+1, considering I'm guilty of using this very frequently in C++11 with for() loops.
++