Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!olivea!uunet!lll-winken!aunro!alberta!brazeau.ucs.ualberta.ca!unixg.ubc.ca!ubc-cs!news.UVic.CA!sirius!peters From: peters@sirius.UVic.CA (Doug Peters) Newsgroups: comp.lang.smalltalk Subject: GNU Smalltalk-1.1 problems Message-ID: Date: 19 Jun 91 17:44:19 GMT Sender: news@sol.UVic.CA Distribution: comp.lang.smalltalk Organization: University of Victoria, Victoria, BC, Canada Lines: 67 Nntp-Posting-Host: yates.uvic.ca Is there a trick to this? Granted, I am almost a novice at Smalltalk, but I thought that I was asking GNU Smalltalk-1.1 to do some pretty basic things... For example, I have a Complex class (I chose to make this a subclass of Number because I wanted "isKindOf: Number" to still work) So I have a file called "Complex.st", which looks like: "------------------------------------------------>8" Number variableSubclass: #Complex instanceVariableNames: 're im ' classVariableNames: '' poolDictionaries: '' category: ''! !Complex methodsFor:'accessing'! re: aNumber im: anotherNumber re := aNumber. im := anotherNumber! ! !Complex class methodsFor: 'instance creation'! re:aNumber im:anotherNumber "<- this is line 15" | a | a := super new. a re:aNumber im:anotherNumber. "<- this is line 18" ^a! ! "------------------------------------------------>8" (it used to be a lot longer, but this gets the point across) anyway, st> FileStream fileIn:'Complex.st' ! produces: "Complex.st", line 15: parse error "Complex.st", line 15: Invalid message pattern "Complex.st", line 18: Error in expression "Complex.st", line 18: parse error "Complex.st", line 18: Invalid message pattern "Complex.st", line 19: Error in expression The same errors occur even if I change the class method to real:imag: (so much for polymorphism)... any hints (re:strategy _or_ implementation :-)? Another example: I want a Matrix class, so I st> ArrayedCollection variableSubclass: #Matrix st> instanceVariableNames: 'nrow ncol ' st> classVariableNames: '' st> poolDictionaries: '' st> category: ''! and I get: ArrayedCollection error: cannot create a variable subclass from a non-pointer variable parent class I am quite sure that that was the invocation in PP-ST80, and I am not even sure what the error message is telling me... again, any hints? Thanks in advance Doug Peters (peters@sirius.uvic.ca)