[net.micro.mac] Rascal Fun

dubois@uwmacc.UUCP (Paul DuBois) (06/10/86)

Here's a little ditty that illustrates a Rascal oddity (or bug).
There are two modules, TestA and TestB.  The procedure TestProc is
defined in each (they are slightly different).  Presumably, with smart
linking, only one instance should get linked in, right?  Here's a
circumstance where they will both get pulled in, AND BOTH USED!  First
I call TestProc directly. Then I call it indirectly by calling a proc
in the other module that calls TestProc.

Compile TestB, then Compile, Link and Execute TestA, to replicate.

The output is 'xy'.  I would expect it to be 'xx'.

------
Program TestA;
Uses __QuickDraw ;
Link TestB : ;
Proc TestProc (); { DrawChar ('x'); };
Proc _Init (); { TestProc (); ITestProc (); };
--------
Program TestB;
Uses __QuickDraw ;
Proc TestProc (); { DrawChar ('y'); };
Proc ITestProc (); { TestProc (); };
------
-- 
Paul DuBois     UUCP: {allegra,ihnp4,seismo}!uwvax!uwmacc!dubois    |
                ARPA: dubois@easter                               --+--
                                                                    |
Doth the hawk fly by thy wisdom, and stretch her wings              |
toward the south?                        Job 39:26