Skip to content

Commit

Permalink
Fixed stevedekorte#39: Object tailCall() removed from both documentat…
Browse files Browse the repository at this point in the history
…ion and source
  • Loading branch information
superbobry committed Apr 27, 2010
1 parent 39882fd commit 7527124
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 96 deletions.
15 changes: 0 additions & 15 deletions docs/reference/Core/Core/Object/index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1195,21 +1195,6 @@ <h1>Object Proto</h1>
) )
</code> </code>
</div> </div>
<a name="Object-tailCall"></a><b>
tailCall(expression)
</b>
<p>
<div class=slotDescription>
Does a tailCall on the currently executing Block. Example:
<pre>
Io> a := method(x, x = x + 1; if(x > 10, return x); tailCall(x))
==> method(x, updateSlot("x", x +(1));
if(x >(10), return(x));
tailCall(x))
Io> a(1)
==> 11
</pre>
</div>
<a name="Object-thisContext"></a><b> <a name="Object-thisContext"></a><b>
thisContext thisContext
</b> </b>
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/docs.json

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions libs/iovm/source/IoBlock.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ IO_METHOD(IoBlock, setProfilerOn)
IoObject *IoBlock_activate(IoBlock *self, IoObject *target, IoObject *locals, IoMessage *m, IoObject *slotContext) IoObject *IoBlock_activate(IoBlock *self, IoObject *target, IoObject *locals, IoMessage *m, IoObject *slotContext)
{ {
IoState *state = IOSTATE; IoState *state = IOSTATE;
intptr_t poolMark;
IoBlockData *selfData = DATA(self); IoBlockData *selfData = DATA(self);
List *argNames = selfData->argNames; List *argNames = selfData->argNames;
IoObject *scope = selfData->scope; IoObject *scope = selfData->scope;
Expand Down Expand Up @@ -245,9 +244,6 @@ IoObject *IoBlock_activate(IoBlock *self, IoObject *target, IoObject *locals, Io
IoObject_isReferenced_(blockLocals, 0); IoObject_isReferenced_(blockLocals, 0);
IoObject_isReferenced_(callObject, 0); IoObject_isReferenced_(callObject, 0);


//tailCall:
poolMark = IoState_pushRetainPool(state);

LIST_FOREACH(argNames, i, name, LIST_FOREACH(argNames, i, name,
IoObject *arg = IoMessage_locals_valueArgAt_(m, locals, i); IoObject *arg = IoMessage_locals_valueArgAt_(m, locals, i);
// gc may kick in while evaling locals, so we need to be safe // gc may kick in while evaling locals, so we need to be safe
Expand Down Expand Up @@ -281,18 +277,6 @@ IoObject *IoBlock_activate(IoBlock *self, IoObject *target, IoObject *locals, Io
state->stopStatus = IoCall_rawStopStatus(callObject); state->stopStatus = IoCall_rawStopStatus(callObject);
} }


IoState_popRetainPool_(state, poolMark);

/*
if(IOSTATE->tailCallMessage)
{
m = IOSTATE->tailCallMessage;
IOSTATE->tailCallMessage = NULL;
locals = blockLocals;
goto tailCall;
}
*/

IoState_stackRetain_(state, result); IoState_stackRetain_(state, result);


#ifdef IO_BLOCK_LOCALS_RECYCLING #ifdef IO_BLOCK_LOCALS_RECYCLING
Expand Down
1 change: 0 additions & 1 deletion libs/iovm/source/IoObject.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ IoObject *IoObject_protoFinish(void *state)
{"removeAllProtos", IoObject_removeAllProtos}, {"removeAllProtos", IoObject_removeAllProtos},
{"protos", IoObject_protosMethod}, {"protos", IoObject_protosMethod},
{"proto", IoObject_objectProto}, {"proto", IoObject_objectProto},
{"tailCall", IoObject_tailCall},
{"setIsActivatable", IoObject_setIsActivatableMethod}, {"setIsActivatable", IoObject_setIsActivatableMethod},
{"isActivatable", IoObject_isActivatableMethod}, {"isActivatable", IoObject_isActivatableMethod},
{"argIsActivationRecord", IoObject_argIsActivationRecord}, {"argIsActivationRecord", IoObject_argIsActivationRecord},
Expand Down
20 changes: 0 additions & 20 deletions libs/iovm/source/IoObject_flow.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -238,23 +238,3 @@ IO_METHOD(IoObject, if)


return IOBOOL(self, condition); return IOBOOL(self, condition);
} }

IO_METHOD(IoObject, tailCall)
{
/*doc Object tailCall(expression)
Does a tailCall on the currently executing Block. Example:
<pre>
Io> a := method(x, x = x + 1; if(x > 10, return x); tailCall(x))
==> method(x, updateSlot("x", x +(1));
if(x >(10), return(x));
tailCall(x))
Io> a(1)
==> 11
</pre>
*/

IOSTATE->tailCallMessage = m;
IoState_return(IOSTATE, IONIL(self));
return self;
}

4 changes: 0 additions & 4 deletions libs/iovm/source/IoObject_flow.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ IO_METHOD(IoObject, stopStatus);


IO_METHOD(IoObject, if); IO_METHOD(IoObject, if);
IO_METHOD(IoObject, if2); IO_METHOD(IoObject, if2);

// tail call

IO_METHOD(IoObject, tailCall);
4 changes: 0 additions & 4 deletions libs/iovm/source/IoState.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ struct IoState
double timeLimit; double timeLimit;
double endTime; double endTime;


// tail calls

IoMessage *tailCallMessage;

// exiting // exiting


int shouldExit; int shouldExit;
Expand Down
35 changes: 0 additions & 35 deletions samples/misc/tailtest.io

This file was deleted.

0 comments on commit 7527124

Please sign in to comment.