Sideways Methods? 
Author Message
 Sideways Methods?

What is a sideways method? These are present in some of the HD
OLE/Automation interface sources...

- DM



Thu, 29 Nov 2001 03:00:00 GMT  
 Sideways Methods?

Quote:

> What is a sideways method? These are present in some of the HD
> OLE/Automation interface sources...

Defining a method as 'sideways' removes the warning message:

"This method on some-generic is visible to sibling libraries because
its argument types are all based on imported classes."

This warning will occur when you have a generic function exported from
one library and add a method to it in another library specialised on
only imported classes. It serves as a warning that although the method
is not exported in any manner it is still visible to other libraries.

An example that I encountered was specialising print-object on the
<date> type to display dates:

In Library my-lib:

define method print-object( o :: <date>, s :: <stream> ) => ()
  // Display my date in some manner...
end method print-object;

Because this was in my own library and all the types specialised on
were imported classes I get the above warning. By marking the method
as 'sideways' the warning goes away and I'm noting in the code that I
know what I'm doing (I think :-).

Chris.



Thu, 29 Nov 2001 03:00:00 GMT  
 Sideways Methods?
...

Quote:
> It serves as a warning that although the method
> is not exported in any manner it is still visible to other libraries.

       The generic function (and *all* its associated methods) is visible anywhere
the the identifier is imported.  You may not be able to directly retrieve all the methods, but they're still around indirectly.

        I think more to the point is that if one of the sibling libraries defines an
"overzealous" sealed domain the "sideways" method may possibly be in conflict.  

http://www.harlequin.com/products/ads/dylan/doc/drm/drm_75.htm#HEADIN...
[ example code should have a few "open" adjectives sprinkled in the appropriate
  places.]

        This isn't necessarily a problem or even avoidable.  It is a "potential" problem so you get the warning.  I'm not sure if the "sideways" adjective
will take extra measures to confirm the problem  at "link time" or just
communicates to the compiler that "I know, don't bother me with the warning message" and reader beware.  You still could get a runtime/initialization
time error.

[ In general, sideways methods should be avoided. However, where unavoidable then
  aggressive domain sealing should be avoided. For previous example any attempt
  to seal "print-object" should avoid that which might involve this sideways
  method. ]

---

Lyman



Thu, 29 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Writing sideways

2. Clipper function which can print sideways on EPSON printers

3. SCROLL() Won't Work Sideways

4. accessing a instance method from a class method

5. How do I call a method from another method within the same class

6. Class methods vs Instance methods

7. Class method vs instance method???

8. Class method vs instance method???

9. Class methods in ab???.clw files and derived methods

10. "methods" method

11. same method as class and instance methods?

12. Getting method! for free from method

 

 
Powered by phpBB® Forum Software