Advantage of pimpl *other* than compiler firewall?

Apart from implementing compiler firewalls, what significant
advantages are there to using the pimpl idiom?

Why I ask: I'm currently studying some code that uses pimpl
extensively, but which happens to be organized in a way that it
obviates any possible compiler firewall advantages.  Specifically, the
"visible class" and "pimpl class" (to use the terminology in Herb
Sutter's "Exceptional C++) are declared in the same header file.  A
typical header file looks something like this:

// File C.h

class CImpl
{
public:
   virtual void SetX( int x ) = 0;
   virtual int GetX() = 0;
};

class C
{
public:
   virtual void SetX( int x );
   virtual int GetX();
private:
   auto_ptr<CImpl> pimpl;
};

class CImplDef : public CImpl
{
public:
   virtual void SetX( int x);
   virtual int GetX();
private:
   int m_x;
};

I've left out a few details (eg. constructors/destructor, assignment
operators), but basically this is the general layout for dozens of
header files - abstract base class for the implementation, the class
the client uses, and a specified implementation, all declared in the
same header.

Since CImplDef's privates are visible to anyone using class C (by
virtue of appearing in the same header file), in this case pimpl's
compiler firewall benefit has been voided.  So what *other* advantages
are there to using pimpl?

-Gerry Beauregard

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
g
8/23/2003 8:03:11 AM
comp.lang.c++.moderated 10708 articles. 0 followers. allnor (8507) is leader. Post Follow

11 Replies
362 Views

Similar Articles

[PageSpeed] 22
Hi,

Gerry Beauregard wrote:
> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?

It is fairly straightforward to implement "swap" algorithm on pimpled 
classes. Atomic swap is one of the building blocks useful in 
exception-aware code.

Related to this is another feature: when you use pimpl polymorphically 
(as in your example), it is possible to switch implementations in 
runtime. See also the "strategy pattern".

Of course, none of these two was necessarily exploited in the code you 
posted, so my answer is about what *can* be done, and not about what 
actually *was* done.

-- 
Maciej Sobczak
http://www.maciejsobczak.com/

Distributed programming lib for C, C++, Python & Tcl:
http://www.maciejsobczak.com/prog/yami/


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Maciej
8/23/2003 2:48:31 PM
Gerry Beauregard wrote:

> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?
> 
> Why I ask: I'm currently studying some code that uses pimpl
> extensively, but which happens to be organized in a way that it
> obviates any possible compiler firewall advantages.  Specifically, the
> "visible class" and "pimpl class" (to use the terminology in Herb
> Sutter's "Exceptional C++) are declared in the same header file.  A
> typical header file looks something like this:
> 
> // File C.h
> 
> class CImpl
> {
> public:
>    virtual void SetX( int x ) = 0;
>    virtual int GetX() = 0;
> };

Hmmm, the 'virtual' makes me question whether this is really a PIMPL and
not an exchangable plugin like e.g. streambuffers.
 
> class C
> {
> public:
>    virtual void SetX( int x );
>    virtual int GetX();
> private:
>    auto_ptr<CImpl> pimpl;
> };

Have you tried compiling this with just a declaration of class CImpl?
auto_ptr<>'s needs it perhaps. Furthermore, it should rather be 
  auto_ptr<CImpl> const pimpl;
which strengthen's my above doubt on the PIMPLness of this construct.

Even worse here, the virtual C::SetX() calls the virtual CImpl::SetX().
WTF?

> class CImplDef : public CImpl
> {
> public:
>    virtual void SetX( int x);
>    virtual int GetX();
> private:
>    int m_x;
> };

This makes no sense. The PIMPL in its One True Form(tm) is just like the
type of an object: it will never change during its lifetime. Therefore no
need for dynamic dispatch via virtual functions.

Furthermore, 

> I've left out a few details (eg. constructors/destructor, assignment
> operators), but basically this is the general layout for dozens of
> header files - abstract base class for the implementation, the class
> the client uses, and a specified implementation, all declared in the
> same header.

Hmmm, you left out the most interesting parts, because those define whether
this really is a PIMPL. Does CImpl perhaps have a clone() method ('named
copy ctor') ? Can't the definition of CImplDef not be moved outside the
header (some people are reluctant to define a class outside a header
"because that's how it's always done") ? Is there perhaps a ctor of class
C that takes a (hopefully auto-) pointer to a CImpl ?

> Since CImplDef's privates are visible to anyone using class C (by
> virtue of appearing in the same header file), in this case pimpl's
> compiler firewall benefit has been voided.  So what *other* advantages
> are there to using pimpl?

I sincerely doubt that this is a PIMPL, as already stated. To me, it rather
seems as if someone applied %PATTERN% because %PATTERN% is cool, but
without understanding what is really going on. Also possible that the
person in question simply did not know the PIMPL pattern and simply
invented this independently and called it 'pimpl' but with a slightly
different intent - after all it IS a pointer to the implementation of C.

If I were you, I'd look at the history of that file in you sourcecode
management system for the author and their comments. Maybe that will shed
some light on the issue.

happy hacking

Uli

-- 
Questions ?
see  C++-FAQ Lite: http://parashift.com/c++-faq-lite/  first !


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Ulrich
8/23/2003 5:46:11 PM
Gerry Beauregard wrote:

> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?
> 
> Why I ask: I'm currently studying some code that uses pimpl
> extensively, but which happens to be organized in a way that it
> obviates any possible compiler firewall advantages.  Specifically, the
> "visible class" and "pimpl class" (to use the terminology in Herb
> Sutter's "Exceptional C++) are declared in the same header file.  A
> typical header file looks something like this:
> 
> // File C.h
> 
> class CImpl
> {
> public:
>    virtual void SetX( int x ) = 0;
>    virtual int GetX() = 0;
> };
> 
> class C
> {
> public:
>    virtual void SetX( int x );
>    virtual int GetX();
> private:
>    auto_ptr<CImpl> pimpl;
> };
> 
> class CImplDef : public CImpl
> {
> public:
>    virtual void SetX( int x);
>    virtual int GetX();
> private:
>    int m_x;
> };
> 
> I've left out a few details (eg. constructors/destructor, assignment
> operators), but basically this is the general layout for dozens of
> header files - abstract base class for the implementation, the class
> the client uses, and a specified implementation, all declared in the
> same header.
> 
> Since CImplDef's privates are visible to anyone using class C (by
> virtue of appearing in the same header file), in this case pimpl's
> compiler firewall benefit has been voided.  So what *other* advantages
> are there to using pimpl?

The example you've shown looks pretty pointless to me. But I wondered 
about the class CImplDef and guess that you did not showed us the whole 
story ;-). Does CImpl declare a virtual function called clone()? If so, 
this might be an body/handle implementation with a polymorph body.

The advantage of such a construct is that the handle behaves like a 
polymorph class without the need to handle with pointers and dynamic 
memory allocation (from the class users point of view). Slicing is 
avoided too.

But in that case the functions of C don't have to be virtual nor have 
CImpl and CImplDef to be declared in the header.

Just a wild guess.

regards
Torsten


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Torsten
8/23/2003 5:47:59 PM
"Gerry Beauregard" <g.beauregard@ieee.org> wrote in message
news:9a7f3df5.0308220747.11b38882@posting.google.com...
> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?

1) having mostly one pointer in your class makes heap-allocations, well,
fewer which speeds up this part of the code
2) swaps get the same benefit

regards

Thorsten Ottosen, Dezide Aps



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Thorsten
8/23/2003 5:59:25 PM
>
> Since CImplDef's privates are visible to anyone using class C (by
> virtue of appearing in the same header file), in this case pimpl's
> compiler firewall benefit has been voided.  So what *other* advantages
> are there to using pimpl?
>

In fact, you loose the main advantage of pimpl by doing it that...

A compromise could be to have the base class in the header but
derived ones in sources files if you want to support multiple
derived classes (that may be defined elsewhere).

For others advantages, you may have the following:

- You may uses reference counting instead of copying the
main object.
- It may be usefull to uses to have another hierarchy of classes
for the implementation if you can have different combination
of main and implementation classes.

But typically, you should uses the pimpl idiom and hide the
implementation. You should try to move the code in CPP
files and if it still compiles leave it there.

In some case, you may be able to only move derived
implementation classes (without doing many changes).


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Philippe
8/23/2003 8:06:52 PM
Many thanks for the excellent responses!

>From a few of the posts, it sounds like I may have left out some
crucial details that might explain why the code is organized as it is.

So here's what the header and cpp files really look like.  (I've
changed the class names, and left out #includes, #pragmas, etc., and
most of the comment blocks, but otherwise this is the real deal).  In
the sources, there are many subclasses of the Node class.   For every
Node class (Node and every class derived from Node), there's only one
implementation.

.......

// File Node.h

 class NodeList;
 class __declspec(novtable) NodeImpl  
 {
 public:
  virtual ~NodeImpl() {}
  virtual bool IsComplete() const = 0;
  virtual void SetComplete(bool flag) = 0;
 };

 class Node  
 {
 public:
  virtual ~Node() {}

  // This method will ensure the correct copy constructor is called
for
  // the derived types.
  virtual Node& Clone() const { return *(new Node(*this)); }

  // Search for the given 'type' and append to the list argument.
  virtual bool FindNodeType(MFNode& list, const type_info& type);

  bool IsComplete();
  void SetComplete(bool flag);
 protected:
  NodeImpl& GetNodeImpl() const;
 private:
  mutable boost::shared_ptr< NodeImpl > m_NodeImpl;
 };

 class NodeImplDef : public NodeImpl  
 {
 public:
  NodeImplDef::NodeImplDef() : m_complete(false) {}
  virtual ~NodeImplDef() {}
  virtual bool IsComplete() const     { return m_complete; }
  virtual void SetComplete(bool flag) { m_complete = flag; }
 protected:
  bool m_complete;
 };

+++++++++++

// File Node.cpp

NodeImpl& Node::GetNodeImpl() const
{
 if (!m_NodeImpl)
  m_NodeImpl.reset(&(factory::NodeFact::Instance().CreateNodeImpl()));
 return *m_NodeImpl;
}

bool Node::IsComplete() { return GetNodeImpl().IsComplete(); }
void Node::SetComplete(bool flag) { GetNodeImpl().SetComplete(flag); }

bool Node::FindNodeType(MFNode& nodeList, const type_info& type)
{
 if (typeid(*this) == type)
 {
  nodeList.AddValue(this);
  return  true;
 } 
 return false; 
}

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
g
8/24/2003 11:42:54 PM
On 24 Aug 2003 19:24:48 -0400, llewelly <llewelly.at@xmission.dot.com> wrote:

 >But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
 >auto_ptr<CImpl>'s destructor's point of instantiation, the
 >destructor will call delete on an incomplete class, which is
 >undefined behavior.

Use a boost::shared_ptr.

Or roll your own; the trick used by boost::shared_ptr is that the
smart-pointer in addition to a pointer to the object holds a pointer
to a destructor function, only declared in the .h file.


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
alfps
8/25/2003 9:14:17 AM
"llewelly" <llewelly.at@xmission.dot.com> wrote in message
news:8665kouhtp.fsf@Zorthluthik.local.bar...
 > "Philippe Mori" <philippe_mori@hotmail.com> writes:
[snip]
 > > But typically, you should uses the pimpl idiom and hide the
 > > implementation. You should try to move the code in CPP
 > > files and if it still compiles leave it there.
 > [snip]
 >
 > But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
 >     auto_ptr<CImpl>'s destructor's point of instantiation, the
 >     destructor will call delete on an incomplete class, which is
 >     undefined behavior.

there a difference between declaration of a member and its instantiation.
as long as the class in complete at the point of instantation, it's ok.

see also

http://www.boost.org/libs/smart_ptr/smart_ptr.htm#common_requirements

regards

Thorsten Ottosen, Dezide Aps



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Thorsten
8/25/2003 9:14:52 AM
"Thorsten Ottosen" <nesotto@cs.auc.dk> writes:

> "llewelly" <llewelly.at@xmission.dot.com> wrote in message
> news:8665kouhtp.fsf@Zorthluthik.local.bar...
>  > "Philippe Mori" <philippe_mori@hotmail.com> writes:
> [snip]
>  > > But typically, you should uses the pimpl idiom and hide the
>  > > implementation. You should try to move the code in CPP
>  > > files and if it still compiles leave it there.
>  > [snip]
>  >
>  > But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
>  >     auto_ptr<CImpl>'s destructor's point of instantiation, the
>  >     destructor will call delete on an incomplete class, which is
>  >     undefined behavior.
>
> there a difference between declaration of a member and its instantiation.
> as long as the class in complete at the point of instantation, it's
> ok.

I'm aware of this. That's why I said 'If'. My point was, if CImpl gets
    put in another header file, and some TU which instantiates
    auto_ptr<CImpl>'s destructor does not #include CImpl's class
    definition, there will be silent misbehavior. Philippe's
    suggestion opens up that danger where it didn't exist. I've seen
    the compilation firewall idiom implemented with 
    auto_ptr<>, and then seen it undone by combining header files,
    precisely because of time spent tracking down bugs due to
    auto_ptr<>'s silent misbehavior. The resulting headers looked much
    like what the OP posted. Quite possibly, the OP's example *was*
    the compilation firewall idiom, until it was undone to avoid the
    evils of auto_ptr<>. And I did know that:

> http://www.boost.org/libs/smart_ptr/smart_ptr.htm#common_requirements

is often a better way to avoid those problems, though I think in some
    cases scoped_ptr<> is more appropriate.

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
llewelly
8/25/2003 10:30:40 PM
llewelly <llewelly.at@xmission.dot.com> wrote in message news:<8665kouhtp.fsf@Zorthluthik.local.bar>...

> But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
>     auto_ptr<CImpl>'s destructor's point of instantiation, the
>     destructor will call delete on an incomplete class, which is
>     undefined behavior.


You declare a destructor, non-inlined.  Place the destructor in your
..cpp file.  It is then the destructor's job to call destructors on all
data members.  As the destructor is in the .cpp file, it can see the
definition of the pimpl class, and will call the destructor on CImpl.

The benefit of switching to BOOST is that it will give you an error if
you forget to do this.

joshua lehrer
factset research systems
NYSE:FDS

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
usenet_cpp
8/26/2003 12:40:10 AM
Hi,

One reason why I have recently used pimpl is to benefit from a third party
implementation without adding dependencies to my core libraries. Let me
explain.

We used to have a coordinate transformation class that used a hierarchy of
transformations based on different rubber sheet algorithms. All this classes
reside in a module named A that is used in our product, but that it is also
used by another team, and we release it to them as a third party.

For our new release, we wanted to add a new transformation, but instead of
using a rubber sheet algorithm, we wanted to use a third party
implementation of a coordinate system transformation. We want to make this
implementation available to our customers, but we do not want to have that
dependency in the module that we release to other team because of legal
issues (which I do not know much about).

In order to remove the dependency, we used a pimpl, defining our
transformation class in module A, and a base class for the implementation in
module A. This allow us to create implementations using whatever algorithms
we had and put them in module A, and create a new module B that uses the
third party library and defines a new implementation using it. Now, we can
still use the new implementation in our application, and we can ship module
A with no dependencies in the third party lib.

This architecture has also removed some compile time dependencies, which I
am also happy about.

--
Regards,

Isaac Rodriguez
=======================
Software Engineer - Autodesk


"Gerry Beauregard" <g.beauregard@ieee.org> wrote in message
news:9a7f3df5.0308220747.11b38882@posting.google.com...
> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?
>
> Why I ask: I'm currently studying some code that uses pimpl
> extensively, but which happens to be organized in a way that it
> obviates any possible compiler firewall advantages.  Specifically, the
> "visible class" and "pimpl class" (to use the terminology in Herb
> Sutter's "Exceptional C++) are declared in the same header file.  A
> typical header file looks something like this:



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Isaac
8/26/2003 7:06:44 PM
Reply:
Similar Artilces:

compile related issue
I cannot figure out why the output of the two versions of the decode function produce different results. I would REALLY appreciate it if someone could point me in the right direction here. Thanks in advance. (code follows) toBase= Compile[{{list,_Integer,2},{base,_Integer},{strings,_Integer}},Module[{shift=ConstantArray[0,strings],out},Transpose[MapThread[(out=Mod[##-base+shift,base];shift+=##;out)&,{Transpose[list]}]]],{{_,_Integer,1}}] split1=Compile[{{list,_Integer,2},{base,_Integer},{strings,_Integer},{ilow,_Integer},{ihigh,_Integer}},(Map[FromDigits[#,base]&,toBase[Tak...

Advantages of Desktop Linux
I have been working to get the "advocates" to focus in places where desktop Linux offers benefits in terms of usability: productivity, efficiency, and error-reduction. Mostly they have responded with fear and insults. But between all the screaming and insults and accusations, a few items have been mentioned: * Repositories: they offer pros and cons, but there are definite advantages here. * Some window management issues: windows snapping to each other, maybe some features of virtual desktop implementations. * Search by purpose of program (at least in Unity) Anythi...

Trying to compile dtach
I hope someone might have succeeded at this, where we have failed. Tryng to compile dtach, the source is available: http://prdownloads.sourceforge.net/dtach/dtach-0.7.tar.gz?download I am no great compilation expert and so have no idea why this is not working on AIX. I have it working on Linux. It seems to compile ok, and executes but: I get the same error with all command line options: # dtach -A /tmp/socket1 dc dtach: init_pty: No such file or directory dtach: /tmp/socket1: Connection refused The socket1 file is created. If someone has compiled this program sucessfully, any info would b...

Compiling wxWidgets on Mac
--Next_1130421439---0-203.199.83.146-21598 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =A0=0A I want to understand the following things=0A=0A1. How can I build w= xWidgets on a mac 10.=0A=0A2. What are the settings or command line argumen= ts rrequired for running a wxWidgets=0Aapplication on mac with a gcc compil= er.=0A or How to write a makefile for building wxWidgets apllication with a= gcc compiler=0A on Mac=0A --Next_1130421439---0-203.199.83.146-21598 Content-type: text/html; charset=iso-8859-1 C...

Compile python extension
Hi, I'm trying to build/install pysqlite on a Solaris 10 platform. I've got Sun Studio 11 on a AMD 64 platform and got this error. I'm a python newbie and just want to install trac. I've got ActiveState python: ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on Python 2.4.3 (#1, Apr 3 2006, 18:07:58) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information. And sqlite build with the following options ./configure --prefix=/opt/64/sqlite --enable-threadsafe --disable-tcl my environment looks lik...

problem compiling CL-GD with CMUCL 19b
Hi, I have a strange problem compiling CL-GD with CMUCL 19b on Linux 2.6.11-6mdk i686. I have installed all required libraries like libiconv, libpng, ... and also several ASDF installable libraries before without problem. The cl-gd-glue.so library builds with no problem, but then when I do : (asdf:oos 'asdf:compile-op :cl-gd) it complains with this : Error in function SYSTEM::LOAD-OBJECT-FILE: Can't open object "/home/neptun/.asdf-install-dir/site/cl-gd-0.4.8/cl-gd-glue.so": "libiconv.so.2: cannot open shared object file: No such file or directory" ...

SmartBooks - Small Power Advantage
This is a multi-part message in MIME format. ----------------10032688001664236177 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Several have posted hear in the past how SmartBooks with their ARM processors were going to blow Intel Atom based Netbooks away. It is interesting to read that the power advantage on a 10" Smartbook is only 5 to 10%. A small power efficiency bump for a machine with less performance. Quote: When you get to screen sizes of 4” and above, something happens that levels the playing field for Intel somewhat. Their CPU p...

Advantages
Ehhhh, someone sent me an email with an attachment regarding my post titled "Advantages". I inadvertently deleted it. Please send it again thanks. Andrew Carroll Carroll-Tech 720-273-6814 andrew@carroll-tech.net ...

Advantages and Disadvantages of the Spring Framework
Hi, Just wanted explore whether with using the spring framwork is a common experience. I can see same great advantages with using Spring however I have this nagging feeling that it isn't the magic solution that some people seem to make it out to be. My gut feeling is the Spring framework is something that only "experienced" java developers would appreciate and choose to use as it solves problems that that large commercial developers comes across often eg jdbc error handling is quite ugly but Spring JDBC templates solves this problem. However the downside of Spring is trying t...

Choosing a C\C++ Compiler
Hi all, There are two C/C++ compilers Microsoft Visual Studio NET.2003 and CodeWarrior Development tools for windows version 8.0 in my system. How can I select one of these compiler above to build stand-alone applications. Matlab version (6.5.1) Matlab compiler version (3.0.1) Thanks, T try this >>mex -setup Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? n Select a compiler: [1] Borland C++Builder version 6.0 [2] Borland C++Builder version 5.0 [3] Borland C++Builder version 4.0 [4] Borland C++Builde...

Compiler matlab
I would like to compile my matlab program in .exe. But I believed to understand(include) that it is not possible if the data are saved in the Workspace what is the case dan my program.Somebody can it confirm it On Wed, 26 May 2004 10:22:59 -0400, Manu wrote: >I would like to compile my matlab program in .exe. But I believed to >understand(include) that it is not possible if the data are saved in >the Workspace what is the case dan my program.Somebody can it confirm >it i am zizi aouf seltani am etudiant en 5 yeurs informatique i work with mattlab and my theme is:CADEMS for th...

Gnatbox Light single floppy firewall replacement?
My home firewall is an old 486 with 8M RAM and two ISA ethernet cards, using an old version of single-floppy Gnat Box Light V3.0.3 (from http://www.gnatbox.com). It's a nice BSD-based firewall with NAT and SPI, ICSA-certified, configured via any of local, browser, or PC app (GBAdmin). However, newer versions require much more RAM, and it's a bit clunky and difficult to configure. Is there a current single-floppy Linux that will run on this platform, supports NAT and SPI, is easy to configure, but has detailed configuration if needed for port forwarding etc.? I'm no Linux (or ot...

defmethod inside a conditional needs (with-compilation-unit () ...) around the load and the compile
Hi All, So, I have code which (after macroexpansion) ends up looking something like= this:=20 (WHEN (OR (NOT (FBOUNDP 'GDL-SLOTS::MIDPOINT)) (NOT (FIND-METHOD (SYMBOL-FUNCTION 'GDL-SLOTS::MIDPOINT) NIL (LIST (FIND-CLASS 'GDL::GDL-BASIS)) NIL))) (DEFMETHOD GDL-SLOTS::MIDPOINT ((#:G3175 GDL::GDL-BASIS) &REST #:G3171) .... ) The issue is that t...

[tao-users] Sequences of object references and compiler ambiguities.
I am new to TAO and no CORBA expert so excuse any stupid questions! I have some code that failes to compile and don't understand what construct I should be using to get it to compile correctly. Following is a test case (apologies for the length): test.idl ======== interface Test { }; typedef sequence< Test > TestSeq; interface Tester { struct Error { Test test_ref; }; typedef sequence< Error > ErrorSeq; exception TestError { ErrorSeq error_sequence; }; Test fetch(); void process( in TestSeq test_sequence ) rai...

comp.compilers group extremely political?
Do tell your experience with that group and the mods there, in this thread. On Wed, 24 Mar 2010 00:27:04 -0500, ng2010 wrote: > Do tell your experience with that group and the mods there, in this > thread. Egh, I am regularly reading and posting to comp.compilers. I don't remember any political statements made there. Do you have any examples? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de On 2010-03-24, ng2010 <ng2010@att.invalid> wrote: > Do tell your experience with that group and the mods there, in this > thread. I think Irvine moderates great...

Firewall for Windows
My machine runs WinXP, I use ADSL to connect to the Net, and I use WinXP's built-in firewall when I'm online. My friends have their machines online via ADSL too, but their machines don't have WinXP. One is Win 98SE, another one is Win ME. During the weekend, I scan both their machines for virus, using Norton AntiVirus 2003 professional, and you know what I found ? On the Win 98SE machine, there were 793 files infected with virus, 3 of them could NOT be fixed. On the Win ME machine, ther were 638 files infected with virus, 2 of them couldn't be fixed. I regularly scan my ma...

compiled CL libraries
So, quick question: are CL compilers able to compile a CL library into a native library so that external code can use it like any other native lib? On 10/08/2010 12:51 AM, namekuseijin wrote: > So, quick question: are CL compilers able to compile a CL library > into a native library so that external code can use it like any other > native lib? C code cannot just call Lisp functions because C is not Lisp. Some implementation (like ECL) can compile into libraries, though. So either C part needs to know how to call Lisp code, or you need to make some wrapper which exp...

advantage to using seperate scsi card for each disk?
Hello Is there any advantage to having a scsi u2w card for each disk? ie. if you have two disks, will they perform equally well on the same u2w card as they will if you have a seperate card for each disk? How about if you have 4 disks? ie. 4 disks on one channel versus 4 disks on 4 seperate cards? It would seem to me that if the data rate of the bus is higher than the disk, there is no advantage to having seperate cards. Once you have enough disks on the bus that there is a contention problem then you would want seperate channels. Just wondering, JD "john f. davis" <joh...

compile an applet to java 1.1 with netbeans
I'm using neabeans with java 1.4.2 and need to compile an applet to use java 1.1 How do I do this with netbeans? Thanks Ray On 1 May 2004 09:20:04 -0700, Ray Joslyn wrote: > I'm using neabeans with java 1.4.2 and need to compile an applet to > use java 1.1 You need to specify a -target option fopr the compile. Note, though, that if you want to check that you are only _using_ 1.1 functionality, you need to invoke the -bootclasspath option and point it to a 1.1 'rt.jar'. > ..How do I do this with netbeans? I have no idea. While in NetBeans, try.. <http://w...

Re: compiler or interpreter
As far as I understand it, SAS is a "block interpreter". What this means is that it complies not the full code but proceeds in blocks. HTH Diwakar Sharma |---------+-----------------------------------> | | kottamasu satish | | | <satish_gpss@YAHOO.CO| | | M> | | | Sent by: "SAS(r) | | | Discussion" | | | <SAS-L@listserv.uga.e| | | du> | | | ...

g008: arranging files as source/header pairs and the pimpl idiom
Discuss away! GUIDELINE ========= Each non-template class definition shall be split into a header/source file pair. REASON ====== This is the time-honoured way to organise source files so to do anything else will take developers by suprise. The rule enables developers to find what they are looking for more conveniently. Implications of the pimpl idiom ------------------------------- This rule can lead to a proliferation of header files for projects that make heavy use of the Handle/body idiom, described in Coplien. This idiom has become popularised by Sutter where it is referred to as the ...

What are the advantages of PocketPCs over Palms?
According to the information I've obtained so far, it seems that Palm's PDAs are faster, smaller, more stable, have better battery life, have better applications, and sync better with MS Office documents. Is there any reason to purchase a PocketPC instead of a PalmOS unit? I am trying to decide between PalmOne's Tungsten T and HP's iPaq 1945. I plan to use my PDA as an organizer, MS Word editor, and mp3 player. I also plan to buy a Bluetooth-enabled cell phone to access e-mail and a Bluetooth-enabled GPS for road navigation. Thanks, -Mike "El Senor" <ilov...

Emacs Windows binary + compilation error
Hi, I need to install Gnu emacs on a Windows XP box. All of the binaries for this seem to have disappeared from the Web (presumably as a result of the gnu break-in by a cracker -- but that was quite a while ago now, is it really true that they have not yet been able to generate new Windows emacs binaries?). So my first question is, please could you let me know whether such a binary is available anywhere. If the answer to this question is no, I'll need to compile emacs. I have the latest cygwin, and downloaded emacs-21.3.tar.gz from the gnu site. I run "configure". That see...

Please share with advantages and weak spots of TungstenC.
I'm planning to buy TUNGSTEN C after 4 years with PalmV 8Mb. Please share with advantages and weak spots of TungstenC. I have investigated the Internet, please don't use the articles. I heard about fragile plastic body. What about buttons? Are they strong enough? Thanks in advance ! best regards Andrei Estonia My thoughts for what they're worth... I can't stand the thumb-board. Just couldn't make the transition from graffiti. Personally, the Zire 71 is a better buy. That or an m515 if you can still find one. "akew" <akew@hot.e...

Compilation errors with aCC compiler
Hi, I am getting compilation error in folloing situation: Here, I am giving sample piece of code. a.h: ------- extern int g_switch; ------ in "a.c", g_switch = 0; it is giving following error: Error 173: "a.c", line 19 # Redefined symbol 'g_switch'; previously defined at ["../../include/a.h", line 3]. But this code is working fine in all other systems like Suse, Solaris and Windows. System information : HP-UX C3600 B.11.00 U 9000/785 2003506592 unlimited-user license aCC version : aCC: HP ANSI C++ B3910B A.03.55 Please let me know if any c...