[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] [GNU Smalltalk feature] Subclassing with new syntax

From: Paolo Bonzini
Subject: [Help-smalltalk] [GNU Smalltalk feature] Subclassing with new syntax
Date: Thu, 27 Sep 2007 23:26:00 -0700

Issue status update for Post a follow up:

Project:      GNU Smalltalk
Version:      <none>
Component:    Base classes
Category:     feature requests
Priority:     normal
-Assigned to: +Assigned to: bonzinip
Reported by:  elmex
Updated by:   bonzinip
-Status:       active
+Status:       fixed

I think elmex's issue is really about the inability to specify
variable subclasses
of any shape; for example

st> MyString withAll: #($a $b)
Object: MyString error: should not be implemented in this class, use
#new instead

Will the aforementioned pragma have a way to make classes traditional
variable classes as well?

That's already supported with for example <shape: #pointer>.  Shapes
were introduced in gst 2.2 and the converter automatically converts
variableSubclass: and friends to the appropriate shape pragma.  See
also the tutorial.


Previous comments:

Thu, 27 Sep 2007 08:45:17 +0000 : elmex


I've been wondering how to subclass classes
like String and Dictionary. How do I do it with
the new syntax? Using:

String subclass: MyString []

didn't seem to work.


Thu, 27 Sep 2007 08:57:35 +0000 : bonzinip

It works:

st> String subclass: MyString []
st> MyString

but you have to set the shape:

st> MyString shape

I might add a <shape: #inherit> pragma.  It's good that the default is
nil, because each class should set its shape manually (or tell that
it's fine to use the superclass shape).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]