Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualcr88192

Posted 27 March 2013 - 03:59 PM

Good old Variants.. you never know what they really are. Delphi had those too (along with the more standard data types) but they are just confusing to use.

 

I guess a question can be asked here:

is a language with both static types and variants:

A, a statically typed language with variants as a sub-type;

B, a dynamically typed language with optional explicit type-specialization.

 

or, does it depend more on what magic goes on within the implementation?... (more values as tagged or untagged?...)

or, on the declaration syntax?... ("var x; var y:int;" vs "var x; int y;").

or, edge-case behavior (say, "long" only able to directly encode +-(2^61) and having to sometimes escape-code values outside this range, or very large/small doubles sometimes losing several bits of precision?... as a result of internal conversions to/from variant).

 

(in my case, this is one of those unanswered questions regarding whether to classify my script-language as statically or dynamically typed... then again, compared with other similar languages, it would probably be classified as statically typed, despite the frequent use of dynamic types in many places...).

 

 

I guess this sort of fits in with whether one indicates the type of a variant in a variable name:

is a variant the absence of type, or instead its own type within a collection of other types?...

 

(well, along with the whole matter of whether objects or variants are the conceptual root-type for the type-system, ...).


#1cr88192

Posted 27 March 2013 - 03:44 PM

Good old Variants.. you never know what they really are. Delphi had those too (along with the more standard data types) but they are just confusing to use.

 

I guess a question can be asked here:

is a language with both static types and variants:

A, a statically typed language with variants as a sub-type;

B, a dynamically typed language with optional explicit type-specialization.

 

or, does it depend more on what magic goes on within the implementation?... (more values as tagged or untagged?...)

or, on the declaration syntax?... ("var x; var y:int;" vs "var x; int y;").

or, edge-case behavior (say, "long" only able to directly encode +-(2^60) and having to sometimes escape-code values outside this range, or very large/small doubles sometimes losing several bits of precision?... as a result of internal conversions to/from variant).

 

(in my case, this is one of those unanswered questions regarding whether to classify my script-language as statically or dynamically typed... then again, compared with other similar languages, it would probably be classified as statically typed, despite the frequent use of dynamic types in many places...).

 

 

I guess this sort of fits in with whether one indicates the type of a variant in a variable name:

is a variant the absence of type, or instead its own type within a collection of other types?...

 

(well, along with the whole matter of whether objects or variants are the conceptual root-type for the type-system, ...).


PARTNERS