|
![](/i/fill.gif) |
Warp wrote:
> I will never understand why they decided to drop 'typedef' when they
> designed Java in the first place. It's so handy in C++.
Well, in Java everything is a class. So it's not 100% obvious where
you'd *put* a typedef. (I suppose it could be something that's local to
a class or something...)
>> It's interesting to note that in scripting languages, all that could be a
>> one-liner. In Javascript:
>> var theMap = {"foo": [["one", "two"], ["three", "four"]]};
>
> Yeah, but that's only possible in languages with weak typing (I think
> that's the term?) In other words, in languages where you don't have to
> specify types explicitly, as they are inferred from the values.
Two cases here:
- JavaScript is dynamically typed. Types become known only at runtime.
Types are checked only at runtime. Many scripting languages follow this
model. (Smalltalk immediately springs to mind here.)
- Haskell is statically typed, but types are [usually] inferred
automatically. Types are checked at compile-time only. Types are not
known at runtime at all. [With the exception of types belonging to a
class of some kind.]
Obviously nobody cares, but:
theMap = fromList [("foo", [["one", "two"], ["three", "four"]])]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |