jastrachan | 29 Nov 19:16 2004
Picon

Re: variable declaration syntax: use cases and thoug hts


On 29 Nov 2004, at 17:58, Robert Yokota wrote:
> Do we need to make a distinction between variables and values in this
> discussion?   As I understood it, in dynamically typed languages, 
> values
> always have a type, but variables are dynamically typed because they 
> assume
> the type of whatever value is asigned to them, and this type may not be
> known at compile time.

Agreed.

The only difference to this is if a variable has an associated type 
(i.e. statically typed) then we can generate compile time errors if you 
are accessing a non-existent method, field or property.

So

var foo = someMethod()
foo.anyRandomMethodIsFine()

however

String foo = someMethod()
foo.anyRandomMethodIsNotFine() // compile error, no such method on 
String

James
-------
http://radio.weblogs.com/0112098/


Gmane