This is Notes.rtf in view mode; [Download] [Up]
No No's
o If a function takes float make sure you pass it floats, integers
will not be automagically promoted to float by smalltalk. For
instance this will not work
DPS moveTo: 10 anArg: 10.
but this will
DPS moveTo: 10.0 anArg: 10.0.
o Remember methods in objective-c that look like moveTo:: are
replaced with moveTo:anArg: in smalltalk since GNU smalltalk
doesn't yet support ':' as a selector value.
o Objective-c objects are not garbaged collected so you need to
explicitly free them yourself. Hopefully this will be fixed as soon as
I figure out how GNU smalltalk's garbage collection facility works.
o Objective-c classes like STObject, STView that are meant to be
subclassed in smalltalk must have the following fixes evaluated
before trying to use them.
Fix for setOOP
setOOP: arg0
| anId aSelector rValue |
anId _ id.
aSelector _ OCInterface getUid: 'setOOP:'.
Behavior defineCFunc: 'msgSend'
withSelectorArgs: 'cObjectMsgSend1: anId sel: aSelector argSmalltalk: arg0'
forClass: OCInterface class
returning: #cObject
args: #(cObject cObject smalltalk).
rValue _ OCInterface cObjectMsgSend1: anId sel: aSelector argSmalltalk: arg0.
((OCInterface id: id equalTo: rValue) = 1)
ifTrue: [ ^self ]
ifFalse: [ ^OCObject newFromId: rValue. ].
and the following fix for the designated initalizer (usually init, initFrame, ...)
init
super init.
self setOOP: self.
The fix for setOOP: allows arg0 to be passed to the objective-c method
setOOP: as OOP (C Pointer to a smalltalk object). The init fix just makes
sure that the OOP ivar (stObject) in the objective-c object is setup so that
messages sent to the objective-c object are passed over to the smalltalk object.
o
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.