HDTenEightyP/NetNews huggingface dataset:
From: belk@dxcern.cern.ch (Andy Belk)
Subject: Re: method inheritance in NeXT ObjC classes
Organization: CERN European Lab for Particle Physics
Date: Mon, 12 Oct 1992 10:56:51 GMT

Hi all.
        Just as an aside, this (List->Stack) is a fairly good example of
when subclassing is not necessarily what is really desired.

A Stack usually has push and pop operations, and in this case also a display
method, but one can argue that doing List operations on a stack may cause
problems. For example, one can do things that mess up the LIFO idea of a
stack:

Stack s;
Integer i = 5;
[s init];
[s push: i--];
[s push: i--];
[s push: i--];
[s push: i--];
[s push: i--];
[s removeObjectAt: 5];   // Ok, you can do it, but should you be able to ?
[[s pop] display];

etc.


Here's my version of Stack.h and Stack.m (yes, I did the ObjectiveC example
too, and I don't have Queue or Stack classes either - but I do have access to
a NeXT and its List class ...):

--------------------------- Stack.m -------------------------------

#import <objc/Object.h>
#import <objc/List.h>

@interface Stack : Object
{
  List *sList;
}

+ new;              // Probably should use init and alloc now
- free;
- get;              // returns last object on stack (and removes it)
- put: anObject;    // Store this object on the top of the stack
- (unsigned)size;   // current stack size

@end;

--------------------------- Stack.m -------------------------------

// Use a list with index to make a stack and a queue
// Modified 30th September to use a List rather than inheriting from one -
// Stacks should not look like lists, IMHO. This is an example of delegation
// as compared to inheritance.

#import <stdio.h>
#import "Stack.h"

@implementation Stack: Object

+ new
{
  self = [super new];  // It's VITALLY important to create an object
  sList = [List new];  // before playing with its instance variables !
  [sList init];
  return self;         // MUST return self here or instance will be wrong class
}

// The "-" in front of report means that it's an instance method,
// i.e., how a particular object should respond.

- free
{
  [sList free];         // Note the List object gets freed by me
  return [self free];
}

- put: anObject
{
  [sList addObject: anObject];
  return self;
}

- get
{
  id anObject = [sList lastObject];
  [sList removeLastObject];
  return anObject;
}

- (unsigned)size
{
  return [sList count];
}

@end

------------------------------------------------------------------------
-- 
					    ...   Anyd   ...
From: fred@poly2.nist.gov (Frederick R. Phelan Jr.)
Newsgroups: comp.lang.objective-c
Subject: What is Objective C?
Date: 17 Oct 92 00:04:43 GMT

HI,

What is Objective C?  From scanning a few posts I can tell
that it is not the same as C++.

Is there a FAQ for this group?  Thanks in advance.

Cheers!

Fred Phelan
---
Fred Phelan
fred@poly2.nist.gov
/*___________________________________________________
   ____ __  ___  __    ___       ___        ___ 
  /__  /_/ /__  / /   /__/ /__/ /__   /    /__/ /\  /  
 /    / ( /__  /_/   /    /  / /___  /___ /  / /  \/
___________________________________________________*/

Newsgroups: comp.lang.objective-c
From: wave@waits.media.mit.edu (Michael B. Johnson)
Subject: Re: Does IB impose a rigid design?
Organization: MIT Media Laboratory
Date: Thu, 15 Oct 1992 09:13:17 GMT

Jim Mackraz writes
> Robert D. Nicholson writes
> > Does NeXT's Interface Builder impose a rigid design on applications?
> > 
> > If it does is this a good thing or a bad thing?
> > 
> 
> It strongly imposes a particular "GUI-centric" philosophy to the architecture  
> of the application.  While I believe that taking a "user-centric" approach to  
> software design is good, making the application revolve around the GUI  
> architecturally is bad, in my opinion.
> 


Hmm, I guess I'd have to disagree.  In 3.0, you can finally make palettes
of subclasses of things other than Views, which should allow me to write
almost complete applications completely inside interface builder, just by
dragging my objects off a palette, dropping them into the files window,
connecting them up to each other and frobbing their insides with their 
custom inspectors (loaded, along with the object, as part of a palette).

Certainly, the way IB is usually used is just for building the GUI portion,
but with 3.0, there is finally the opportunity to get beyond that.


--

-->  Michael B. Johnson
-->  MIT Media Lab      --  Computer Graphics & Animation Group
-->  (617) 253-0663     --  wave@media-lab.media.mit.edu
-->  NeXT Mail accepted at  wave@nordine.media.mit.edu
Newsgroups: comp.lang.objective-c
From: frank@fnbc.com (Frank Mitchell)
Subject: Re: Help! @interface, @implementation etc
Organization: First National Bank Of Chicago, Chicago IL, USA
Date: Wed, 7 Oct 92 18:14:15 GMT

In article <AB2c2qg402@terem.perm.su> kaf@terem.perm.su (Kostarev A.) writes:
> Hi Guys:
> 
> In "[FAQ] A Simple Sample Objective-C Programm" (Bill Shirley)
> we have found several unknown
> construction : @interface, @implementation etc..
> We have read "Object-Oriented Programming" An Evolutionary Approach
> (August 1986), but can't find this constructions.
> 
> Can somebody say what means these keywords and where can we
> find full formal descriptions of additional possibilities.
> 
> --------
> Alexey F. Kostarev
> Igor N. Avtaev

Sorry, I've never read "Object-Oriented Programming", so I'm not sure if it 
covers Objective-C -- which is a distinct language from C++, although both 
are based on C.

Constructions beginning with `@' are Objective-C compiler directives.

@interface ThisClass : ThatClass
	means that the following statements (until a @end) declare instance 
variables and methods for a class named ThisClass, which is a subclass of
ThatClass.

@interface ThisClass
	means that the following statements (until a @end) define the methods
that ThisClass responds to.

An excellent introduction to Objective-C can be found in _NeXTSTEP_Concepts_,
by the staff of NeXT Computer, Inc.  In the United States it is published by 
Addison-Wesley.  I don't know if it is available in the CIS, although I've 
heard NeXT sells machines in Russia.

Perhaps someone can suggest a more widely available (and less machine-specific)
reference.  Anybody?

--
Frank Mitchell,	Business Systems Analyst, First National Bank of Chicago
email:frank@fnbc.com (NeXTmail)

"In a way, staring into a computer screen is like staring into an eclipse. 
It's brilliant and you don't realize the damage until its too late."
-- Bruce Sterling, LA Times, 2/20/92
Newsgroups: comp.lang.objective-c
From: jeffh@victoria.umhc.umn.edu (Jeff Hallgren)
Subject: Re: method inheritance in NeXT ObjC classes
Reply-To: jhall@tahiti.umhc.umn.edu (Jeff Hallgren)
Organization: University of Minnesota
Date: Tue, 13 Oct 1992 04:03:20 GMT

In article <1992Oct12.105651.17220@dxcern.cern.ch> belk@dxcern.cern.ch  
(Andy Belk) writes:
> Hi all.
>         Just as an aside, this (List->Stack) is a fairly good example of
> when subclassing is not necessarily what is really desired.
> 
[ lots of stuff deleted]

	I agree. I tried subclassing Storage and List sometime back and 
eventually decided that was a mistake (note: it was my situation) It was
much cleaner to simply "use" the List and make my won class by subclassing
Object.

PS Don't forget to send the objects on the List a free message also...
Jeff

Jeff Hallgren/Lab Info Systems
U of Minn Hosp & Clinic
jhall@tahiti.umhc.umn.edu
From: guy@infotec.ch (Guy)
Subject: Re: Help! @interface, @implementation etc
Organization: Infotec S.A.
Date: Fri, 9 Oct 1992 10:44:35 GMT

>Perhaps someone can suggest a more widely available 
> (and less machine-specific) reference.  Anybody?
>Frank Mitchell.

How about "Objective-C Object-Orientated Programming Techniques" 
by Lewis J. Pinson and Richard S. Wiener, published by 
Addison-Wesley 1991 ISBN 0-201-50828-1.

It compares the Stepstone and NeXT implementations of Objective C 
and gives lots of example code. Class libraries from each are 
covered.

Hope that this is useful.

Guy Roberts, Infotec SA. guy@infotec.ch.
-- 
Guy Roberts(guy@infotec.ch) Infotec S.A.
phone: 022/738 44 33        8 avenue de Frontenex
fax:   022/786 50 61        Geneva, Switzerland.
Newsgroups: comp.lang.objective-c
From: jordan@aero.org (Larry M. Jordan)
Newsgroups: comp.lang.objective-c
Subject: Access Control
Date: 14 Oct 1992 21:46:03 GMT
Organization: The Aerospace Corporation
NNTP-Posting-Host: uniblab.aero.org

It's been a while since I've read "Object-Oriented Programming: An Evolutionary
Approach".  And I imagine the present language specification has changed
somewhat since then.  My question: Does Objective-C provide any kind of 
"access control"? (i.e. as C++ does with public,private, protected or 
Oberon-2 with Module export?)

--Larry
From: mcintyre@predator.endicott.ibm.com (Dave McIntyre)
Newsgroups: comp.lang.objective-c
Subject: Re: Help! @interface, @implementation etc
Date: 8 Oct 92 20:32:30 GMT
Reply-To: mcintyre@owgvm0.vnet.ibm.com (Dave McIntyre)
Organization: IBM Federal Systems Company, Owego, NYI

In article <1992Oct7.181415.3185@fnbc.com>, frank@fnbc.com (Frank
Mitchell) writes:
|> In article <AB2c2qg402@terem.perm.su> kaf@terem.perm.su (Kostarev A.)
writes:
||> > In "[FAQ] A Simple Sample Objective-C Programm" (Bill Shirley)
|> > we have found several unknown
|> > construction : @interface, @implementation etc..
|> > We have read "Object-Oriented Programming" An Evolutionary Approach
|> > (August 1986), but can't find this constructions.
||> 
|> Sorry, I've never read "Object-Oriented Programming", so I'm not sure if it 
|> covers Objective-C -- which is a distinct language from C++, although both 
|> are based on C.

The book mentioned is the original presentation of Objective-C by Brad Cox.
The language syntax used in that early book is slightly different than that
which is currently used.  A new version of the book has been published, which
is much improved:

Object-Oriented Programming: An Evolutionary Approach
	Brad J. Cox and Andrew J. Novobilski
	Addison-Wesley, 1991.
	ISBN 0-201-54834-8

I would be careful about reading Next manuals unless you are actually going
to be programming on a Next machine.  The Next version of the language is
non-standard, and won't necessarily be compatible with compilers produced
for other platforms by Stepstone and others.
Newsgroups: comp.lang.objective-c,comp.sys.next.programmer
From: benz@infko.uni-koblenz.de (Hartmut Benz)
Subject: Re: method inheritance in NeXT ObjC classes
Organization: Universitaet Koblenz (FB Informatik)
Date: Tue, 13 Oct 1992 11:38:44 GMT

Andy Belk writes
> Hi all.
>         Just as an aside, this (List->Stack) is a fairly good example of
> when subclassing is not necessarily what is really desired.
> 
> A Stack usually has push and pop operations, and in this case also a display
> method, but one can argue that doing List operations on a stack may cause
> problems. For example, one can do things that mess up the LIFO idea of a
> stack:
> 
> Stack s;
> Integer i = 5;
> [s init];
> [s push: i--];
> [s push: i--];
> [s push: i--];
> [s push: i--];
> [s push: i--];
> [s removeObjectAt: 5];   // Ok, you can do it, but should you be able to ?
> [[s pop] display];
> 
> etc.
[rest deleted]

An excerpt from Object.rtf from the NextDocumentation:

.... For example, an Object subclass might renounce the copy method by reimplementing it to include an error: message as follows:

- copy
{
    [self error:"  %s objects should not be sent '%s' messages\n",
            [[self class] name], sel_getName(_cmd)];
}

This code prevents instances of the subclass from recognizing or forwarding copy messageslthough the respondsTo: method will still report that the receiver has access to a copy method. .....

--
			Tschoe'wa
_______________________________________
Hartmut Benz                          | benz@infko.uni-koblenz.de
D-5400 Koblenz, Germany               |       (NeXTmail ok)
Newsgroups: comp.lang.objective-c
From: demarco@fsd.cpsc.ucalgary.ca (Vince Demarco)
Subject: Re: method inheritance in NeXT ObjC classes
Organization: University of Calgary
Date: Sun, 11 Oct 1992 19:37:11 GMT


The problem is in the push and pop, you do a [myStack addObject:etc]
it should shave

[self addObject: [[Integer new] set: input];
etc


Also in your code don't use the new methods anymore, use alloc and
init.

Hope this helps

Newsgroups: comp.lang.objective-c
From: frank@fnbc.com (Frank Mitchell)
Subject: Re: Help! @interface, @implementation etc
Organization: First National Bank Of Chicago, Chicago IL, USA
Date: Wed, 7 Oct 92 18:25:30 GMT

Whoops!  The perils of cut-and-paste.  I meant to say:

@implementation ThisClass
	means that the following statements (until a @end) define the methods
that ThisClass responds to.

--
Frank Mitchell,	Business Systems Analyst, First National Bank of Chicago
email:frank@fnbc.com (NeXTmail)
From: jamison@vms.cis.pitt.edu (W Jamison)
Newsgroups: comp.lang.objective-c
Subject: method inheritance in NeXT ObjC classes
Date: 11 Oct 92 17:02:40 GMT
Organization: University of Pittsburgh
Originator: jwj@unixd1.cis.pitt.edu

I have been trying to define a class called Stack that is a subclass 
of the NeXT Common Class List.  When I compile and run the program,
I receive the following error message:

	error: Stack does not recognize selector +addObject: IOT trap

Am I wrong in thinking that Stack should recognize the methods
for its superclass List?

I have included the @interface and @implementation files for the
subclass Stack I have written below.  Can anyone tell me what I
have overlooked?  

					Wes Jamison
					University of Pittsburgh
						at Greensburg
// file Stack.h
/* Interface File */

#import <objc/List.h>
#import "Integer.h"

@interface  Stack: List
{
	/* no new instance variables for subclass */
}

/* factory methods for class */

+new;

/* instance methods for class */

-push: (int)input;
-(int) pop;
-display;

@end

/* Implementation File */

#import <stdio.h>

@implementation  Stack:List

/* Details of factory methods  */

+new
{
	self = [super new];
	return self;
}
	
/* Details of instance methods */

-push: (int)input
{
	id myStack;

	[myStack addObject:[[Integer new] set: input]];
	return self;
}

-(int)pop
{
	int output;
	id myStack, myInteger;
	
	myInteger = [myStack removeLastObject];	
	output = [myInteger show];
	[myInteger free];	            
        return output;
}

-display
{
	id myInteger, myStack;
	int i;
	
	
	for (i = 0; i <= [myStack count]; i++)
		{
		myInteger = [myStack objectAt: i];
		printf("%d\n",[myInteger show]);
		}
		printf("\n");	
}	
@end

	
Newsgroups: comp.lang.postscript
From: cracauer@wavehh.hanse.de (Martin Cracauer)
Subject: HELP! My Page- Definitions are wrong
Organization: Private
Date: Wed, 14 Oct 92 12:31:16 GMT

Hi, there!

I am developing an applications for generating tabulars. The output contains 
several pages in one file.

As I know, the structure of the code matches the rules in 'Document Structuring
Conventions' in the Postscript Reference Manual.

So far, everything is o.k. Our Laserjet prints all pages, the linotype attached 
to a mac, too.

If I do a preview on screen using the NeXT Previewer or Ghostview/ Ghostscript, I 
can see all pages. I can zoom them, too.

Now the error: If I am previewing the last page in my file, I can not get back to 
other pages or zoom it. A postscript error occurs.

I know, that both previewers can do this, because I have got many postscript 
documents containing several pages. All document exept my own are handled 
correctly :-(

I looked at the structure of the working documents, but I can not see any 
difference that could be the reason for this behavior.

My suggestion is, that I have to do something in the pager trailer (so far, I do 
not use one).

Please: If you have got an idea, what I am doing wrong, mail me. 

I will summarise you answers, If you want.

This is an example of my postscript files. I deleted uninteresing code. If you need 
to see the whole file, please let me know.



------------------------ begin of file --------------------

%!PS-Adobe-3.0
%%Creator: Topmedia 0.02
%%EndCommments
%%BeginProlog
%%BeginResource: procset alles

[ some procedure definitions ]


%%EndResource

[ definitions for functions to include eps-file as describben in PS Language
Reference Manual ]

%%EndProlog

%%BeginSetup

[ building fonts with some news character-codes and some function-definitions ]

%%EndSetup

%%Page: 1 1
%%BeginPageSetup
/pgsave save def
%%EndPageSetup

[ the code for page 1 ]

[ calling a procedure for showing an eps-file, defined in %prolog ]

pgsave restore
showpage

%%Page: 2 2
%%BeginPageSetup
/pgsave save def
%%EndPageSetup

[ the code for page 2 ]

[ calling a procedure for showing an eps-file, defined in %prolog ]


pgsave restore
showpage

%EOF
-------------------------- end of file ----------------------
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer, cracauer@wavehh.hanse.de
Waldstrasse 200, W-2000 Norderstedt, Germany
Tel.: +49 / 522 18 29, Fax.: +49 / 522 85 36
From: mccauley@ecn.purdue.edu (Darrell McCauley)
Newsgroups: comp.lang.postscript
Subject: need slide background image
Date: 12 Oct 92 04:29:26 GMT
Followup-To: poster
Organization: Ag Engineering Dept, Purdue University

I'm looking for a PostScript code to create a "nice" backgrounds
for some color transparencies that I am producing. I would be
grateful if someone shares some PostScript code to do this
(I'm using LaTeX/PSTricks/eslides.sty/dvips to prepare my presentation).
-- 
James Darrell McCauley                    Dept of Ag Engineering, Purdue Univ
internet: mccauley@ecn.purdue.edu         West Lafayette, Indiana 47907-1146
bitnet: mccauley%ecn@purccvm              UUCP: pur-ee!mccauley
From: bradlee@cg-atla.UUCP (Rob Bradlee)
Newsgroups: comp.lang.postscript
Subject: Re: Version of concatenate which does use VM
Date: 14 Oct 92 12:21:37 GMT
Reply-To: bradlee@cg-atla.UUCP (Rob Bradlee)
Distribution: comp
Organization: Agfa Compugraphic Division

In article <907@rtbrain.rightbrain.com> glenn@rightbrain.com writes:

>That reminds me.  You asked a question a few weeks ago about one of
>the examples in my book, and I wrote a long message about it, but there
>wasn't a single response to it, so I wondered if it got out there at all.
>Did anybody see it?  Does anybody care? :-)
>
>Glenn
>
Sorry I didn't email you or followup.  Yes, I definitely cared about your response
and much appreciated it.  (Your reply coincided with a work crisis).
Based on your response I decided to leave my inherited code alone 
(i.e. let it do errordict /typecheck get exec not errordict begin typecheck end).
I apologize for not properly responding.

And while I have you here, I have another question which you might find 
interesting.  What about the technique of using non-name keys in dictionaries.
For instance if you wanted to execute a different proc for every resolution you
could create a dict with the resolution (as an integer) as the key:

	3 dict begin
	300 {} def
	600 {} def
	1200 {} def
	end

However, I think you run into some syntax problems with this approach.  Have you ever
successful used it?

-- 
Rob Bradlee  w:(508)-658-5600 X5153 
Agfa Corporation.                      ...!{decvax}!cg-atla!bradlee
200 Ballardvale St.                        bradlee@cg-atla.agfa.com
Wilmington, Mass. 01887
From: glenn@rightbrain.com (Glenn Reid)
Newsgroups: comp.lang.postscript
Subject: Re: Version of concatenate which does use VM
Date: 14 Oct 92 08:29:03 GMT
Reply-To: glenn@rightbrain.com
Distribution: comp

Rob Bradlee writes
> I was using Glenn Reid's concatenate routine (from "Thinking in  
PostScript")
> in some system PostScript (outside the server loop).  However, each 
> invocation consumes some VM, so I wrote a version that takes the  
destination
> string or array as a passed in parameter.

Nice work, Rob.

That reminds me.  You asked a question a few weeks ago about one of
the examples in my book, and I wrote a long message about it, but there
wasn't a single response to it, so I wondered if it got out there at all.
Did anybody see it?  Does anybody care? :-)

Glenn

--
 Glenn Reid        		NeXTmail: glenn@rightbrain.com
 RightBrain Software		415-326-2974 (NeXTfax 326-2977)
 Palo Alto, California		Electronic Frontier Foundation, member #054
Newsgroups: comp.lang.postscript
From: "Ken Rawlings" <krawling@cherry.ucs.indiana.edu>
Subject: Re: text formatters written in PostScript?
Organization: Indiana University, Bloomington
Date: Fri, 16 Oct 1992 05:31:48 -0500

>In article <1992Oct15.001223@eklektix.com>, rcd@raven.eklektix.com (Dick Dunn) writes:
>>At this point, most of us are probably asking "why PostScript???"  That is,

	It's _highly_ device independent, is not tied to any one computer, 
does linerar graphical transformations on the fly, handles fonts beautifully, 
is a _true_ computer language, is fun to program in, is stack oriented,
is reentrant, is object oriented, and is loosely typed. 

	That answer your question?   :-)

In article <1bkhvdINNdku@gap.caltech.edu> carl@SOL1.GPS.CALTECH.EDU writes:
>No, we're not.  We realize that were such a program available, one could simply
>download the program and the text to the PostScript printer and let IT do the
>formatting.  If we use more than one operating system in our work, it wouldn't
>be necessary to port the code for the formatter to each operating system.

	My sentiments exactly. 

	There is such a program avaliable and it works quite well,
although there is a catch(see below). It's called "Gonzo Justification
Power Tool" by a man that is quickly becoming the closest thing I have
to a hero: Dan Lancaster. 

	Basically, you send it to the printer as a persistant
download, then when you want to have it format some text you prolog the
text with: 

		gonzo begin
		dumpascii starttemplate

	Of course the templates are totally redifinable(using our
favorite language!) and in fact it works quite well if you want to do
anything remotely interesting with the text. 

	The catch? It's on GEnie, and the way I understand it, it cannot
be placed on a public archive or redistributed. However, the $2.50 spent
downloading it is _well_ worth the money, and Dan certainly deserves
whatever his cut is of it. (I think this is why none of the great stuff
on the PSRT is on any of the archives)

	Speaking of GEnie: If you have any interest at all in using
PostScript as more than just a way of "dirtying up an otherwise clean
sheet of paper", the PostScript Language Roundtable is definitely worth 
looking into. 

-kdr

-- 
: Ken Rawlings                   |the slave thinks he is released from bondage:
: CompSci/Indiana University     |                only to find                :
: krawling@silver.ucs.indiana.edu|         a stronger set of chains           :
From: mppa3@syma.sussex.ac.uk (Alan Richardson)
Newsgroups: comp.lang.postscript
Subject: PS -> PCL mode switching on HPLJII
Date: 7 Oct 92 07:51:53 GMT
Organization: University of Sussex


  Hi! My problem concerns mode switching on a HP LaserJet II
with an Adobe PostScript cartridge.

  At present, to switch between PCL and PostScript modes I have to
use the printer control panel which as you can guess is a pain.
Ideally I want to do this remotely using software. I can get from
PCL to PS OK by sending a short escape sequence. However the 
PostScript file we have on our system intended to change from
PS to PCL doesn't appear to work; it is:


     serverdict begin 0 exitserver
     statusdict begin 1 setsoftwareiomode
     end


  I don't have access to the cartridge manual so I can't figure out why
the printer stays in PS mode. Any help with this problem would be
terrific.

  Cheers!
-- 
Alan Richardson,                             * "You don't have to be *
School of Maths & Physical Sciences,         *  old to be wise"      *
Univ. of Sussex, Brighton BN1 9QH, ENGLAND   * ******Judas Priest*****
UK: mppa3@uk.ac.sussex.syma         elsewhere: mppa3@syma.sussex.ac.uk