Menu
  • HOME
  • TAGS

How to get name of superclass according to class in smalltalk

smalltalk,squeak,gnu-smalltalk

Using instance class superclass , of course! Every class can answer its (unique) superclass. However, note that you have several capitalization mistakes that are not innocent. In Smalltalk, capitalization rules are meaningful, beyond case-sensitivity. Also, it is uncommon to cross the instance-class level to query something like this. Usually, only...

Smalltalk change variable value

gnu-smalltalk

You can use so-called keyword-messages. You end a method with a colon and put the variable name after that (probably multiple times). So if you have something like methodFoo(a, b, c) in a curly-brace language, in Smalltalk you typically write methodFoo: a withSomething: b containing: c or likewise. This can...

How to Check if objectA has all message as objectB in smalltalk?

smalltalk,squeak,gnu-smalltalk

You could for example ask the class of an object which selectors it's instances understand: objectA class allSelectors Then you could ask different objects and compare the results....

trying to retrieve element from an OrderedCollection

smalltalk,pharo,squeak,gnu-smalltalk

Given that your Car has an accessor for speed, you simply can do result := cars select: [ :each | each speed = 20. ]. That gets you all cars that have the speed 20. If you only want one, you should use detect: myCar := cars detect: [ :each...

gst regular expression mismatch of group generates exception

regex,smalltalk,gnu-smalltalk

The issue had been fixed in master after the above report was received. The commit can be seen here. A stable release is currently blocked by the glib event loop integration.