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
|