HDTenEightyP/NetNews huggingface dataset:
From: graham@maths.su.oz.au (Graham Matthews)
Subject: Re: Implementation Question
Organization: School of Mathematics and Statistics, University of Sydney
Date: Wed, 2 Sep 1992 23:58:04 GMT

Graham:
>  I was wondering about a small implementation problem I am having.
>  Imagine I have two classes A and B defined as follows,
>  
>  	class A
>  		instance variables a, b, c;
>  	end class;
>  
>  	class B
>  		subclass of class A;
>  		instance variables e, f;
>  	end class;
>  
>  (by "instance variable" i mean that an instance of class A will
>  have three "fields"/"slots" (pick your terminology!) named a, b and
>  c).
>  
>  Now my problem is as follows. How do OO implentations handle the 
>  space allocation for an instance of class B? Does an instance of B
>  have to have space allocated for all the instance variables in B as 
>  well as all the instance variables in all the classes of which B is 
>  a sub-class (in this case class A). I ask this for three reasons :-
>
>  a) I have many examples where B is a subclass of A but one rarely
>  utilises this feature. All the time is spent computing with instances
>  of B as instances of the sub-class B and not as instances of the 
>  super-class A. So I do not want to allocate space for any instance 
>  variables (in this case those in class A) which I am rarely if ever 
>  going to use.

kanderso@bbn.com writes:
>But there must be some A behavior that B needs, otherwise B would not need
>to be a subclass of A.  It sounds like you want your B class to inherit
>from a class "essential A" which has the A behavior you need, without the slots.

No not really. The example I have in mind is a module and an abelian
group. Now a module *is* an abelian group, but one hardly ever computes 
with it as such - users are aware of the is-a relationship but hardly
ever make any use of it. They always want to compute with modules and
sub-types of it such as vector spaces, and are not at all interested
in its abelian group structure.

graham
>  b) I have example code where the representation of B is not the
>  same as A. That is mathematically B is a sub-type of A but for
>  various reasons the implementation of B does not have any of the 
>  slots of A.
>  
kanderso@bbn.com writes:
>You can separate the "mathematical subtypeness" from implementation using
>a level of indirection:
>class A
>       instance variables implementation;
>end class;
>class B
>       subclass of A;
>end class;
>A's and B's can forward to an object in instance variable implementation
>that implements the real behavior.

I am not sure I understand what you mean here. What do you mean by
"forward to an object in instance variable implementation"?

graham
--
Graham Matthews                 And it's true we are immune
Pure Math, Uni.Sydney, Oz       When fact is fiction and T.V. is reality
graham@maths.su.oz.au
Newsgroups: comp.lang.clos
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.clos,comp.object
Subject: Re: Looking for information on CLOS based distributed object systems
Date: 3 Sep 1992 03:04:20 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: gandalf.think.com

In article <01050159.cgf6gc@devlab.IISA.COM> kpt@iisa.com writes:
>I'm looking for information on CLOS based distributed object systems.
>It seems, from what little information I have available, that every
>O-O language except CLOS has been used to develop such systems.  Is
>this true or have I missed something?  If it is true then what has
>lead to this state of affairs?

Symbolics has announced that they're converting their Statice OODBMS from
Flavors to CLOS, and investigating porting it to CL on conventional
architectures.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.clos
From: rpg%inferno@lucid.com (Richard P. Gabriel)
Subject: Implementation Question
Organization: The Ohio State University Department of Computer and Information Science
Date: Wed, 2 Sep 1992 20:51:41 GMT

Sorry my friend, I have the trademark on The Right Thing, along with
Worse is Better. Perhaps I'll include a case study of Self in my
upcoming paper on Worse is Better. 

			-rpg-

Newsgroups: comp.lang.clos
From: graham@maths.su.oz.au (Graham Matthews)
Subject: Re: Type declarations Re: Generic Macro Proposal
Organization: School of Mathematics and Statistics, University of Sydney
Date: Wed, 26 Aug 1992 04:09:29 GMT

john@linus.mitre.org writes:
>Joe Konstan writes:
>  First, it seems important to have declarations that declare an exact
>  type instead of just a general type.  Thus,
>    (DECLARE (EXACT-TYPE CLASS-1 OBJECT))
>  should indicate that object is treated as an instance of class-1,
>  and not as an instance of a subclass.
>and Graham Matthews (graham%maths.su.oz.au@uunet.uu.net) replies:
>  Why not take this the whole hog and treat your object heirarchy as
>  an ordered set (which it is in the single inheritance model - not
>  sure about multiple inheritance) and allow the programmer to write a
>  type spec like
>	FUNCTION F( <= TYPE_A, > TYPE_B )
>  etc
>A type hierarchy with single inheritance is NOT an ordered set, it's
>only partially ordered.  

I was thinking of one branch of the tree here. In general it is indeed
partially ordered.

>Still, such declarations might be useful, and
>you can already make them in Common Lisp:
>  (DEFUN FOO (X)
>    (DECLARE (TYPE (AND SYMBOL (NOT NULL)) X)
>    ...))
>This declares that the type of X is "exactly" SYMBOL.

This is not what I proposed. This allows on = on the order, and I
am suggesting to extend this to <, etc

>However, the
>declarer must know the exact nature of the hierarchy, whereas Joe
>Konstan's EXACT-TYPE declaration doesn't require that every
>subclass/subtype be enumerated in the declaration.

No this is not true. To use a type spec like, "t1<t2" one needs
only know that all types/classes less than t1 satisfy some condition.
In algebraic programming this is often the case, with group < ring <
field...

graham
--
Graham Matthews                 And it's true we are immune
Pure Math, Uni.Sydney, Oz       When fact is fiction and T.V. is reality
graham@maths.su.oz.au
Newsgroups: comp.lang.clos
From: kanderso@bbn.com
Subject: Re: Implementation Question
Organization: The Ohio State University Department of Computer and Information Science
Date: Wed, 2 Sep 1992 07:09:17 GMT

  To: comp.lang.clos@cis.ohio-state.edu
  Date: Wed, 2 Sep 1992 11:58:45 GMT
  Organization: School of Mathematics and Statistics, University of Sydney
  From: Graham Matthews <graham@maths.su.oz.au>
  Sender: commonloops-request@cis.ohio-state.edu
  Subject: Implementation Question
  
  I was wondering about a small implementation problem I am having.
  Imagine I have two classes A and B defined as follows,
  
  	class A
  		instance variables a, b, c;
  	end class;
  
  	class B
  		subclass of class A;
  		instance variables e, f;
  	end class;
  
  (by "instance variable" i mean that an instance of class A will
  have three "fields"/"slots" (pick your terminology!) named a, b and
  c).
  
  Now my problem is as follows. How do OO implentations handle the 
  space allocation for an instance of class B? Does an instance of B
  have to have space allocated for all the instance variables in B as 
  well as all the instance variables in all the classes of which B is 
  a sub-class (in this case class A). I ask this for three reasons :-
  
Generally, in classed based OOP, like Smalltalk, Lisp, and C++, a B gets all
of an A's slots.  In a delegation based language like Self, a B can have a
prototypical A as a parent.  A B would then get its A's behavior without a
copy of its slots.  In a classed based language you can simulate such
delegation. 

  a) I have many examples where B is a subclass of A but one rarely
  utilises this feature. All the time is spent computing with instances
  of B as instances of the sub-class B and not as instances of the 
  super-class A. So I do not want to allocate space for any instance 
  variables (in this case those in class A) which I am rarely if ever 
  going to use.

But there must be some A behavior that B needs, otherwise B would not need
to be a subclass of A.  It sounds like you want your B class to inherit
from a class "essential A" which has the A behavior you need, without the slots.
  
  b) I have example code where the representation of B is not the
  same as A. That is mathematically B is a sub-type of A but for
  various reasons the implementation of B does not have any of the 
  slots of A.
  
You can separate the "mathematical subtypeness" from implementation using a
level of indirection:

class A
       instance variables implementation;
end class;

class B
       subclass of A;
end class;

A's and B's can forward to an object in instance variable implementation
that implements the real behavior.

  I can think of one solution using associative arrays, but this must
  be a standard problem with a set of standard solutions.

I presume someone more theoretical than i could argue that the notion of
inheritance in current OOP languages is too crude to correctly handle all
the issues involved in sharing state, behavior, and typeness.
From: jeff@aiai.edinburgh.ac.uk (Jeff Dalton)
Newsgroups: comp.lang.clos
Subject: Re: Generic Macro Proposal (was Re: Beginner's Question - CLOS)
Date: 25 Aug 92 17:41:01 GMT
Article-I.D.: subnode.11109.9208251741
Organization: The Ohio State University Department of Computer and Information Science

> In article <graham.714740051@galois> graham@maths.su.oz.au (Graham Matthews) writes:
> >Why not take this the whole hog and treat your object heirarchy as an
> >ordered set (which it is in the single inheritance model - not sure
> >about multiple inheritance) and allow the programmer to write a type
> >spec like
> >
> >	function f( <= type_A, > type_B )
> 
> This is meaningful even with multiple inheritance, because the the class
> hierarchy is a DAG, so there's a partial order, which is all you need.

I think it's like this: There's a partial order if < means subclass,
but not if it means "more specific".  (You might have A < B in the cpl
of one class and B < A in the cpl of another.)  In single inheritance,
there's a partial order in both cases.  But I'm not sure what Graham
meant < to be.
From: jeff@aiai.edinburgh.ac.uk (Jeff Dalton)
Newsgroups: comp.lang.clos
Subject: Re: Beginner's Question - CLOS
Date: 25 Aug 92 17:50:53 GMT
Article-I.D.: subnode.11241.9208251750
Organization: The Ohio State University Department of Computer and Information Science

> When someone cares only about performance of the resulting code, you
> just warn them to design good algorithms and wave goodbye.
> 
> 			-rpg-

Do you ever advise people to compile their code?
Newsgroups: comp.lang.clos
From: cb@maths.bath.ac.UK
Subject: Beginner's Question - CLOS
Organization: The Ohio State University Department of Computer and Information Science
Date: Wed, 26 Aug 1992 14:05:13 GMT



>It sounds like you don't need C++ as much as a Petri net compiler that
>takes your nice object oriented specification and spits out fast code, like
>a big PROG, for example.
>
>k

I could do that, but part of the reason I started doing this was
to show that petri-nets are a good example of something that maps
well into object-oriented simulation.  As far as the programming
of it goes, it is real nice to represent Places and transitions as
objects and have the actions on them represented as methods.  However,
if it's that much faster to compile the petri net spec into non-object-based
code, then its pretty hard to argue that object-oriented simulation is
a good thing.


Chris
Newsgroups: comp.lang.clos
From: graham@maths.su.oz.au (Graham Matthews)
Subject: Re: Beginner's Question - CLOS
Organization: School of Mathematics and Statistics, University of Sydney
Date: Wed, 26 Aug 1992 04:14:32 GMT

cb@maths.bath.ac.UK writes:
>It still takes 13 hours to run and that's on a MIPS 3000 machine.
>How much slower is that than the C++ or C version? Timings are meaningless
>without some basis for comparison.

(Barry Margolin) writes:
>Consider why you implemented it in Lisp in the first place.  Because
>implementing complex applications like these is more feasible with
>Lisp/CLOS than most other languages.  Perhaps you might have gotten a
>program that runs twice as fast using C++,but it might have taken twice as
>long to get it working in the first place; could you have afforded to take
>that long?  (Well, you're in academia, so there may be less deadline
>pressure than in industry, so answer as if you were in industry)

Please think a little folks. If you are intending to run a program
thousands (or even hundreds of times) then taking twice as long to
write the program to produce a product twice as fast is sensible.

graham
--
Graham Matthews                 And it's true we are immune
Pure Math, Uni.Sydney, Oz       When fact is fiction and T.V. is reality
graham@maths.su.oz.au
From: Thomas_E_Morgan@cup.portal.com
Newsgroups: comp.lang.clos
Subject: At the boundary of the MOP?
Date: Tue,  1 Sep 92 15:04:29 PDT
Organization: The Portal System (TM)
Distribution: world

I'd appreciate some comments on something which may be at
the boundaries of the MOP.

I have been doing some work which involves taking over the
slot storage for metaclass instances.  The purpose in doing
so is to experiment with a fully versioned environment, where
the values of slots, as well as the slots hemselves are 
versioned.  Behaviors get version too, for that
matter. 

I have been using the July 92 PCL as the basis for this, and of 
course things aren't quite working - versioning of slot 
*values* is fine, but something isn't quite right in my
take over of the management of the slot storage for the metaclass 
instances.

I'm quite sure that I can get this to go (things like this 
worked, allowing for names, in the May 90 PCL), but I am 
curious to hear what the opionions of skillful MOP'ers are.

Am I beyond the pale here?  This question has also made me 
curious about exactly where the limits of the MOP design are, 
and how those limits might be described.  (Something better
than: "Whatever you can do, by changing the behaviors of
the GF's in the AMOP book"
  
If anyone has one, I would also appreciate any working example
of taking over slot storage for metaclass instances.

   ...Tom M  
Newsgroups: comp.lang.clos
From: rharris@rdrc.rpi.edu
Subject: Re:  The class STANDARD-OBJECT
Organization: The Ohio State University Department of Computer and Information Science
Date: Tue, 25 Aug 1992 13:44:33 GMT

> Lucid's implementation would then meet all your criteria if only
> CLOS::SLOTTED-CLASS had a direct element that was a direct superclass
> of STANDARD-OBJECT and FUNCALLABLE-STANDARD-OBJECT, no?
Yes, if we can agree on a name for this class, and a meaning for the
class STANDARD-OBJECT.

> This is
> a point outside the standardization rignt now,
Maybe so.  Are you referring only to the ANSI Common Lisp document,
or also to either CLtL2 or Chapters 5 and 6 of The Art of the 
Metaobject Protocol?


>> The classes STANDARD-OBJECT and FUNCALLABLE-STANDARD-OBJECT are meant to be
>> "maximal elements" of some set of classes.  The disagreement is over which
>> set.  There are really three sets of classes that are relevant:
>>   (1) The set of all subclasses of STANDARD-CLASS,
>>   (2) The set of all subclasses of FUNCALLABLE-STANDARD-CLASS, and
>>   (3) The union of (1) and (2).

The most important issues of my previous message were:
 (A) Which of the three classes defined in my previous message 
     does STANDARD-OBJECT refer to?, and 
 (B) What is the name of the other class (the one not named
     STANDARD-OBJECT or FUNCALLABLE-STANDARD-OBJECT)?


The sentence (CLtL2, p. 774) "The class named STANDARD-OBJECT is an instance
of the class STANDARD-CLASS and is a superclass of every class that is an
instance of STANDARD-CLASS except itself" appears imply that if both
class (1) and class (3) exist, then class (1) must be called STANDARD-OBJECT
and class (3) must not be an instance of STANDARD-CLASS.  (Class (3) is
a superclass of class (1) by definition, and class (1) cannot also be a 
superclass of class (3)).  It also allows either class (1) or class (3)
to be called STANDARD-OBJECT as long as the other class does not exist.

Has anyone else written programs that have methods that specialize on 
STANDARD-OBJECT which might be called with arguments that are instances of
FUNCALLABLE-STANDARD-OBJECT?


  Richard Harris
Newsgroups: comp.lang.clos
From: jonl%kuwait@lucid.com (Jon L White)
Subject: The class STANDARD-OBJECT
Organization: The Ohio State University Department of Computer and Information Science
Date: Tue, 25 Aug 1992 17:27:14 GMT

re: Also, it would be good to define a class whose direct subclasses are 
    STANDARD-CLASS and FUNCALLABLE-STANDARD-CLASS (PCL has no such class;
    in Lucid's CLOS this class is called CLOS::SLOTTED-CLASS).

Lucid's implementation would then meet all your criteria if only
CLOS::SLOTTED-CLASS had a direct element that was a direct superclass
of STANDARD-OBJECT and FUNCALLABLE-STANDARD-OBJECT, no?  This is
a point outside the standardization rignt now, but would be trivial
to implement.

Incidentally, sometime in early 1991, a patch for Lucid's CLOS exported
SLOTTED-CLASS -- it can properly be referenced as CLOS-SYSTEM:SLOTTED-CLASS


-- JonL --
Newsgroups: comp.lang.clos
From: jmorrill@bbn.com (Jeff Morrill)
Subject: Re: Beginner's Question - CLOS
Reply-To: jmorrill@BBN.COM
Organization: The Ohio State University Department of Computer and Information Science
Date: Tue, 25 Aug 1992 10:45:55 GMT

  
  > I think this concern over dispatch time is insane. It might have made
  > sense 20 years ago (that is, when C was invented) when computers were
  > < .1 mips and cost more than 5 years of a hacker's salary, but not
  > today when computers are > 20 mips and cost 1/5 of a hacker's salary.
  
I agree with RPG that this discussion seems a little penny-wise and pound foolish.

Here are some numbers to make this discussion more concrete.  The speed
of method dispatch is measured in "operations per second" and seems to be
accurate to about 5%.  

                                   XL-400        Sparc 1    Sparc 2
# dispatch args   # methods   |  Genera 8.0.1   Lucid 4.0  Allegro 4.1
-----------------------------------------------------------------------
       1              1       |     112,000      136,000     520,000
       1              3       |     133,000      131,000     503,000
       2              2       |      58,000       89,000     246,000

Forgive me for not being fair to the vendors by not performing the
benchmarks on a single machine, but I don't have the resources.
Indeed, I think the differences are due mainly to the hardware
rather than to the individual CLOS implementations.

I would add that in my experience, the cost of SLOT-VALUE (and reader
methods) is often the limiting factor in terms of performance.  Doesn't
anyone care about slot value?

                                   XL-400        Sparc 1    Sparc 2
                             |  Genera 8.0.1   Lucid 4.0  Allegro 4.1
-----------------------------------------------------------------------
 slot reader method          |      98,000       152,000    553,000
 with-slots (1 access)       |      77,000        24,000    170,000
 naked slot-value            |      34,000        53,000    139,000

So you see that if the ratio of slot access to method dispatch is
about 1:1, then the burden of performance is on slot-value.  In
my programs, the ratio of slot access to method dispatch is about
4:1, so its no contest.  Method dispatch is nothing in comparison with
what usually goes into the body of the method.

It would be interesting to see some numbers for C++.  Sure it's faster,
it doesn't have to do as much because the object-oriented essence
of the program can be optimized into oblivion.

jeff morrill
From: daniel.edelson@goudurix.inria.fr (Daniel Edelson)
Newsgroups: comp.lang.c++
Subject: Re: Garbage Collection for C++
Date: 28 Aug 92 08:19:14 GMT
Reply-To: Daniel R. Edelson <edelson@sor.inria.fr>
Organization: INRIA -- Institut National de Recherche en Informatique et Automatique -- Rocquencourt, France

In article <DAVEG.92Aug27002517@synaptx.synaptics.com>, daveg@synaptics.com (Dave Gillespie) writes:

|> Simple, conservative non-moving GC can be added with
|> minimal effect to the rest of the language, and minimal danger of
|> toppling it.
|> 
|> Dave Gillespie

While it is an excellent technique, its worst case behavior is 
unacceptable, e.g., one false pointer into a very large strongly
connected data structure.... It's valuable and worth using, and 
significantly better than anything else that's currently available,
but does not appear to be a panacea. Its presence does not mean
that we should stop looking for other solutions.

Daniel.Edelson@inria.fr
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: Destruction of temporaries
Date: 1 Sep 92 05:12:54 GMT
Article-I.D.: alice.23598
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Murray Hill NJ

In article <rmartin.715267769@thor> rmartin@thor.Rational.COM (Bob Martin) writes:

> Ideed.  But I think the warning is still useful.

The unfortunate reality is that I have seen a number of development
projects that have an inflexible rule -- no warnings allowed!  That is,
they will not allow their people to ship any code that generates warnings.

Thus, giving a compiler warning for a construct is equivalent to
banning it for those projects.

Warnings had better be right almost all the time.
-- 
				--Andrew Koenig
				  ark@europa.att.com
From: pete@genghis.borland.com (Pete Becker)
Newsgroups: comp.lang.c++
Subject: Re: GOTO, was: Tiny proposal for na
Date: 2 Sep 92 15:55:10 GMT
Organization: Borland International
Originator: pete@genghis.borland.com

In article <4192@papaya.bbn.com> cbarber@bbn.com (Chris Barber) writes:
>
>My way:
>
>void foo(void)
>{
>    FILE *fp = NULL ;
>    char *data = NULL ;
>
>    if ((fp = fopen("foo", "r")) == NULL)
>        goto cleanup ;
>
>    data = malloc(DATASIZE) ;
>
>    if (DoStuff(fp, data) == ERROR)
>        goto cleanup ;
>
>    DoMoreStuff(data) ;
>
> cleanup:
>    if (fp)
>        (void)fclose(fp) ;
>    if (data)
>        free(data) ;
>}
>

C++ version:

void foo()
{
	ifstream input( "foo" );
	DataObject data;
	if( data.doStuff( input ) == ERROR )
		return;
	data.doMoreStuff();
}

	Let the compiler do the work...
	-- Pete
Newsgroups: comp.lang.c++
From: dliao@sal-sun111.usc.edu (David Liao)
Newsgroups: comp.lang.c++
Subject: Borland C++ 3.1 and AF - $395
Date: 28 Aug 1992 13:27:50 -0700
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: sal-sun111.usc.edu

  
                =========================================
                For sale:

                BORLAND C++ 3.1 and APPLICATION FRAMEWORK 

                $395.00 (shipping included)

                =========================================



Sorry to post this forsale thing here, but I need to get rid of my
Borland C++ 3.1 and Application Framework soon.  I had a problem with
my financial aid and I need to come up with some money before my tuition
deferment date.  I got Borland C++ 3.1 and AF last week from mail order
for $595 (retail $795.)  I got this package for my C++ programming class
this fall, but paying the tuition is more important now.  I haven't opened 
this package, since my programming class hasn't started yet.  I'm going
to sacrifice this for $395 (shipping included).  My friend told me this has
everything you need for developing C++ applications.  

Again sorry for posting it here...

dliao@aludra.usc.edu