Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed stevedekorte#39: Object tailCall() removed from both documentat…

…ion and source
  • Loading branch information...
commit 7527124c0fbb87bf26dbfdc7bf9eaa3b5f162cd5 1 parent 39882fd
@superbobry authored
View
15 docs/reference/Core/Core/Object/index.html
@@ -1195,21 +1195,6 @@
)
</code>
</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>
thisContext
</b>
View
2  docs/reference/docs.json
1 addition, 1 deletion not shown
View
16 libs/iovm/source/IoBlock.c
@@ -210,7 +210,6 @@ IO_METHOD(IoBlock, setProfilerOn)
IoObject *IoBlock_activate(IoBlock *self, IoObject *target, IoObject *locals, IoMessage *m, IoObject *slotContext)
{
IoState *state = IOSTATE;
- intptr_t poolMark;
IoBlockData *selfData = DATA(self);
List *argNames = selfData->argNames;
IoObject *scope = selfData->scope;
@@ -245,9 +244,6 @@ IoObject *IoBlock_activate(IoBlock *self, IoObject *target, IoObject *locals, Io
IoObject_isReferenced_(blockLocals, 0);
IoObject_isReferenced_(callObject, 0);
- //tailCall:
- poolMark = IoState_pushRetainPool(state);
-
LIST_FOREACH(argNames, i, name,
IoObject *arg = IoMessage_locals_valueArgAt_(m, locals, i);
// gc may kick in while evaling locals, so we need to be safe
@@ -281,18 +277,6 @@ IoObject *IoBlock_activate(IoBlock *self, IoObject *target, IoObject *locals, Io
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);
#ifdef IO_BLOCK_LOCALS_RECYCLING
View
1  libs/iovm/source/IoObject.c
@@ -207,7 +207,6 @@ IoObject *IoObject_protoFinish(void *state)
{"removeAllProtos", IoObject_removeAllProtos},
{"protos", IoObject_protosMethod},
{"proto", IoObject_objectProto},
- {"tailCall", IoObject_tailCall},
{"setIsActivatable", IoObject_setIsActivatableMethod},
{"isActivatable", IoObject_isActivatableMethod},
{"argIsActivationRecord", IoObject_argIsActivationRecord},
View
20 libs/iovm/source/IoObject_flow.c
@@ -238,23 +238,3 @@ IO_METHOD(IoObject, if)
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;
-}
-
View
4 libs/iovm/source/IoObject_flow.h
@@ -21,7 +21,3 @@ IO_METHOD(IoObject, stopStatus);
IO_METHOD(IoObject, if);
IO_METHOD(IoObject, if2);
-
-// tail call
-
-IO_METHOD(IoObject, tailCall);
View
4 libs/iovm/source/IoState.h
@@ -145,10 +145,6 @@ struct IoState
double timeLimit;
double endTime;
- // tail calls
-
- IoMessage *tailCallMessage;
-
// exiting
int shouldExit;
View
35 samples/misc/tailtest.io
@@ -1,35 +0,0 @@
-#!/usr/bin/env io
-
-writeln("start")
-
-ackWithLoop := method(m, n,
- loop(
- //writeln(m, " ", n)
- if (m < 1, return n + 1)
- if (n < 1) then(
- m = m - 1
- n = 1
- ) else (
- n = ackWithLoop(m, n - 1)
- m = m - 1
- )
- )
-)
-
-//ackWithLoop(3, 4) println
-
-ackWithTailcalls := method(m, n,
- writeln(m, " ", n)
- if(m < 1, return n + 1)
- if(n < 1) then(
- m = m - 1
- n = 1
- tailCall(m, n)
- ) else(
- n = ackWithTailcalls(m, n - 1)
- m = m - 1
- tailCall(m, n)
- )
-)
-
-ackWithTailcalls(3, 4) println
Please sign in to comment.
Something went wrong with that request. Please try again.