<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Georgia">Not sure which version VM you are looking at,
but long ago, it was:<br>
<br>
primitiveValueWithArgs<br>
<br>
| argumentArray blockContext blockArgumentCount
arrayArgumentCount initialIP |<br>
argumentArray _ self popStack.<br>
blockContext _ self popStack.<br>
blockArgumentCount _ self argumentCountOfBlock: blockContext.<br>
self assertClassOf: argumentArray is: (self splObj:
ClassArray).<br>
successFlag ifTrue: [<br>
arrayArgumentCount _ self fetchWordLengthOf:
argumentArray.<br>
self success: (arrayArgumentCount = blockArgumentCount<br>
<b> </b><b> and: [(self fetchPointer: CallerIndex
ofObject: blockContext) = nilObj])</b><b>].
<<<re-entrant detection</b><b><br>
</b></font><b>.</b>..<br>
<br>
So, your snippet looks close, but not quite there.<br>
<br>
Cheers,<br>
Bob<br>
<br>
<div class="moz-cite-prefix">On 12/15/13 11:25 AM, gettimothy wrote:<br>
</div>
<blockquote
cite="mid:142f713b47e.-1807232396217826968.4737877899933405100@zoho.com"
type="cite">
<pre wrap=""> </pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<div
style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;">Please
shoot this down, if it is incorrect. (no details necessary, just
a yes,no is sufficient)<br>
<br>
In the <a moz-do-not-send="true" target="_blank"
href="http://www.mirandabanda.org/cogblog/category/cog/page/14/">discussion
</a>on the re-entrant problem for BlockContexts regarding this
code:<br>
<br>
<font face="serif"> | factorial |<br>
factorial := [:n| n = 1 ifTrue: [1] ifFalse:
[(factorial value: n - 1) * n]].<br>
(1 to: 10) collect: factorial</font><br>
<br>
This statement: "The block can’t be reentered without
overwriting the sender field, preventing return to the first
caller. "<br>
<br>
Does <b>not</b> mean that the bock is reentered, the sender
field is over-written and when we get to n=10 stage things go
kablooie.<br>
What happens is the coders detect this condition and the
primitive code will <b>not allow</b> a sender to be
over-written. <br>
The error that is thrown is <b>purposeful and defensive</b><br>
<br>
I don't know what I am looking at yet, but I think that error
check happens here:<br>
<br>
Interpreter >> primitiveValueWithArgs<br>
| argumentArray blockContext blockArgumentCount
arrayArgumentCount initialIP |<br>
argumentArray _ self popStack.<br>
blockContext _ self popStack.<br>
blockArgumentCount _ self argumentCountOfBlock:
blockContext.<br>
<b> "If the argArray isnt actually an Array we ahve to unpop
the above two"<br>
(self isArray: argumentArray) ifFalse: [self unPop:2.
^self primitiveFail].<br>
</b>.....<br>
<br>
<br>
Sound about right?<br>
<br>
thx.<br>
<br>
tty<br>
</div>
</blockquote>
<br>
</body>
</html>