POV-Ray : Newsgroups : povray.off-topic : A Haskell question... : Re: A Haskell question... Server Time
11 Oct 2024 03:15:27 EDT (-0400)
  Re: A Haskell question...  
From: Orchid XP v7
Date: 4 Feb 2008 16:47:24
Message: <47a787ec$1@news.povray.org>
>>>   Doesn't Haskell support encapsulation?
> 
>> Last time I checked, Java has the same limitation.
> 
>   You said:
> 
>>> struct Point {int x; int y;}
>>    data Point = Point {x, y :: Int}
>>
>> Caution: Note that the names "x" and "y" must be unique within the
>> entire module. For this reason, you'd probably use longer names.
> 
>   I understand to mean that the names 'x' and 'y' in your code above
> actually garbage the global namespace.

No - the namespace of the current module. And in Java it would be the 
same - the names are local to this class file.

>   In the original C code they are local to 'Point' and do not affect
> anything outside it.

That's true...

-- 
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.