tailr (version 0.1.2)

can_transform_rec: Recursive call for testing if an expression can be transformed into a looping tail-recursion.

Description

Recursive call for testing if an expression can be transformed into a looping tail-recursion.

Usage

can_transform_rec(expr, fun_name, fun_call_allowed, cc)

Arguments

expr

The expression to test

fun_name

The name of the recursive function we want to transform

fun_call_allowed

Whether a recursive call is allowed at this point

cc

Current continuation, used to escape if the expression cannot be transformed.

Value

TRUE, if the expression can be transformed. Invokes cc otherwise.