novice question: subtyping String class? 
Author Message
 novice question: subtyping String class?

I'd like to write some methods to add some awk-like features to Smalltalk's
string handling. (sub, gsub, etc.) I thought I'dsubclass String and then write
the methods for that, knowing that itwill inherit copyFrom:to: and the other
built-in String methods. But,once I define a variable-byte subclass of string,
I can't assign to it.

X Fstring new. " Flexible String "
X := 'abcdefg'

just redefines X as a regular String in the second line, and if I write
a method

set: aString
   self := aString

for FString, it doesn't work. I have a feeling that I'm musunderstanding
something basic here.

Bob DuCharme

Sun, 27 Jul 1997 23:23:51 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Novice Smalltalk question about File class

2. A Novice Class Question.

3. Class browser (Re: 3 novice questions)

4. Novice String Question

5. How to convert a string into a class (Beginner's question)

6. Novice RETRACT question (now SETOF/BAGOF question)

7. Graphics classes - novice drowning

8. How to call a class method from a string representing a class name

9. Novice with ADO, connect string

10. Some threading and COM question from a Dolphin novice

11. Novice J Question - Names/Nouns

12. Novice's J question


Powered by phpBB® Forum Software