Sign in to follow this  
randomguy123451

OPTIONALLY dynamic types using "var"/variant/dynamic keyword

Recommended Posts

though in almost all cases i specify data type of my variable, but in case of one or two variable (in few programs) i might not want to specify the data type.
is there:
1) a dynamic data type facility available (or in roadmap) in angelscript [this is independent question from question 2]
These days fully statically typed languages like C# and Scala have acquired "dynamic" keyword , which have SOME extremely important USECASES.
Groovy language itself also allows you since beginning to specify the data type or OPTIONALLY not specify the data type and be fully dynamically typed
among small languages (compared to lua), the jewelscript supports that
int i; //data type specified fully
var j; //dynamic type using var keyword.

if it is not available in angelscript, then whether exposing the C++ class "boost::any" or "boost::variant" to angelscript will be of any help.

2) is there type inferencing facility available [ this is independent question from question 1]

Share this post


Link to post
Share on other sites
_orm_ shared an implementation of a var type. I haven't had time to look at it myself, but maybe you'll find it interesting.

[url="http://www.gamedev.net/topic/611668-true-variant-datatype/"]http://www.gamedev.net/topic/611668-true-variant-datatype/[/url]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this