Re: Minimal working example (Re: set_buffer_mode)

"Stephen R. van den Berg" <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
Per Hedbor () @ Pike (-) importm?te f?r mailinglistan wrote:
>> .. various variable naming themes ..

>It would, by the way, be rather easy to allow indexing of
>private/protected variables if the class that is doing the indexing is
>the class they are in. 

You mean, if the class is defined in the same file?

>If we want to allow that.

That won't help much, I think, I need it between different files.

>Adding 'friend' is somewhat harder, since it is probably not a good
>idea to simply use the classname, so the class has to have been
>specified before the class the friend statement is in for it to work
>correctly.

Erm, I'd expect the evaluation and declaration order be similar to
whenever we make a reference to another class.
I just rechecked how C++ handles it; that might be too convoluted to
immitate.

How about something like:

==================in file: file1.pike==========
class a {
  friend .file2.c;
  private int b;
}
==============================================
==================in file: file2.pmod==========
class c {
  void d(a e) {
    e.b = 12;
  }
}
==============================================

This would suit my needs perfectly.
-- 
Stephen.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.