POV-Ray : Newsgroups : povray.off-topic : A question about Java generics (not a flame) : Re: A question about Java generics (not a flame) Server Time
7 Sep 2024 13:25:49 EDT (-0400)
  Re: A question about Java generics (not a flame)  
From: Orchid XP v8
Date: 9 May 2008 13:54:36
Message: <48248fdc@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.