Re: [squeak-dev] Re: Bug with valueWithReceiver:arguments:
Posted by
Eliot Miranda-2 on
Oct 27, 2008; 11:55pm
URL: https://forum.world.st/squeak-dev-Bug-with-valueWithReceiver-arguments-tp78494p78499.html
Well I actually wrote the fix as
primitiveExecuteMethod
"receiver, args, then method are on top of stack. Execute method against receiver and args"
newMethod := self popStack.
primitiveIndex := self primitiveIndexOf: newMethod.
self success: argumentCount - 1 = (self argumentCountOf: newMethod).
successFlag
ifTrue: [argumentCount := argumentCount - 1.
self executeNewMethod.
"Recursive xeq affects successFlag"
successFlag := true]
ifFalse: [self unPop: 1]
to agree with the perform code. The fix is to ensure that successFlag is true.
On Sun, Oct 26, 2008 at 10:45 PM, John M McIntosh
<[hidden email]> wrote:
Er, my only comment on this is that although
in C it's defined as
sqInt success(sqInt);
but it's written as
success: successValue
successFlag := successValue & successFlag.
which resolves as
sqInt success(sqInt successValue) {
register struct foo * foo = &fum;
foo->successFlag = successValue && foo->successFlag;
}
or
sqInt success(sqInt successValue) {
foo->successFlag = successValue && foo->successFlag;
}
or
sqInt success(sqInt successValue) {
successFlag = successValue && successFlag;
}
so what does
[ ... ^ self success: true]
actually return?
On Oct 26, 2008, at 7:13 PM, Eliot Miranda wrote:
Perhaps #primitiveExecuteMethod should end with an explicit [ ... ^ self success: true] in its true-branch (this is just a thought, I have as yet not
--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
===========================================================================