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

Started by
2 comments, last by WitchLord 12 years, 6 months ago
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]
Advertisement
You might want to take a look at the scriptany and scripthandle add ons.
Thanks rolleyes.gif

You might want to take a look at the scriptany and scripthandle add ons.
_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.

http://www.gamedev.net/topic/611668-true-variant-datatype/

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement