POV-Ray : Newsgroups : povray.off-topic : Why is Haskell interesting? : Re: Why is Haskell interesting? Server Time
4 Sep 2024 17:24:29 EDT (-0400)
  Re: Why is Haskell interesting?  
From: Darren New
Date: 2 Mar 2010 18:15:54
Message: <4b8d9c2a$1@news.povray.org>
Warp wrote:
>   (That doesn't mean you can't have a pointer pointing to a member of an
> object, in a portable way. However, that requires either for the member
> to be public or for the object to give you the pointer.)

Actually, just thinking about it a bit more, if the class returns a pointer 
to a member variable, and you can look in the header and see that pointer is 
in an array, then you have a well-defined way of accessing the other private 
data in the same array.

Like, if the class returns a FILE* from open(), and you look in the class 
declaration and there's something along the lines of
    FILE open_files[MAX_OPEN_FILES];
then chances are you can wander up and down that array as you like. :-)

I wouldn't say that particularly breaks encapsulation tho. Just a thought.

-- 
Darren New, San Diego CA, USA (PST)
   The question in today's corporate environment is not
   so much "what color is your parachute?" as it is
   "what color is your nose?"


Post a reply to this message

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