POV-Ray : Newsgroups : povray.off-topic : A Haskell question... : Re: A Haskell question... Server Time
10 Oct 2024 21:16:49 EDT (-0400)
  Re: A Haskell question...  
From: Warp
Date: 4 Feb 2008 14:05:49
Message: <47a7620c@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Warp wrote:

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

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

-- 
                                                          - Warp


Post a reply to this message

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