Scheme PHP [Source Code]
rember-f
function rember_f
($test, $s, $l)
{return 
    is_nulll($l) ? []
    : ($test(car($l), $s) ? cdr($l)
    : cons(car($l), rember_f($test, $s, cdr($l))));
}
function rember_f
($test)
{return 
    function ($s, $l) use ($test) {
    return
        is_nulll($l) ? []
        : ($test(car($l), $s) ? cdr($l) 
          : cons(car($l), rember_f($test)($s, cdr($l))));
    };
}
eq?-c [1], [2], [3]
function is_eq_c
($a)
{return 
    function ($x) use ($a)
    {return
        is_eq($x, $a);
    };
}
eq?-salad
$is_eq_salad = is_eq_c('salad');
rember-eq?
$rember_is_eq = rember_f('is_eq');
insertL-f
function insert_left_f
($test)
{return
    function ($new_s, $old_s, $l) use ($test)
    {return 
        is_nulll($l) ? []
        : ($test(car($l), $old_s) ? cons($new_s, cons($old_s, cdr($l)))
          : cons(car($l), insert_left_f($test)($new_s, $old_s, cdr($l))));
    };
}
insertR-f
function insert_right_f
($test)
{return 
    function($new_s, $old_s, $l) use ($test)
    {return
    is_nulll($l) ? []
    : ($test(car($l), $old_s) ? cons($old_s, cons($new_s, cdr($l)))
      : cons(car($l), insert_right_f($test)($new_s, $old_s, cdr($l))));
    };
}
seqL
function seq_l
($new_s, $old_s, $l)
{return 
    cons($new_s, cons($old_s, $l));
}
seq_r
function seq_r
($new_s, $old_s, $l)
{return 
    cons($old_s, cons($new_s, $l));
}
seqS
function seq_s
($new_s, $old_s, $l)
{return 
    cons($new_s, $l);
}
seqrem
function seqrem
($new_s, $old_s, $l)
{return
    $l;
}
insert-g
function insert_g
($seq)
{return 
    function($new_s, $old_s, $l) use ($seq)
    {return 
        is_nulll($l) ? []
        : (is_eq(car($l), $old_s) ? $seq($new_s, $old_s, cdr($l)) 
          : cons(car($l), insert_g($seq)($new_s, $old_s, cdr($l))));
    };
}
atom-to-function
function atom_to_function
($operator)
{return
    is_eq($operator, '+') ? 'plus'
    : (is_eq($operator, 'x') ? 'x'
      : 'power');
}
value
function value
($nexp)
{return
    is_atom($nexp) ? $nexp
    : atom_to_function(operator($nexp))
        (value(first_sub_exp($nexp)),
            value(second_sub_exp($nexp)));
}
multirember-f
function multirember_f
($test)
{return 
    function($s, $l) use ($test)
    {return 
        is_nulll($l) ? []
        : ($test($s, car($l)) ? multirember_f($test)($s, cdr($l))
          : cons(car($l), multirember_f($test)($s, cdr($l))));
    };
}
multirember-eq?
$multirember_is_eq = multirember_f('is_eq');
eq?-tuna
$is_eq_tuna = is_eq_c('tuna');
multirember&co [4]
function multirember_co
($s, $l, $col)
{return 
    is_nulll($l) ? $col([], [])
    : (is_eq($s, car($l)) ? 
      multirember_co($s, cdr($l),
          function ($new_l, $seen) use ($col, $l)
          {return // new-friend
              $col($new_l, cons(car($l), $seen));
          })
      : (multirember_co($s, cdr($l),
          function ($new_l, $seen) use ($col, $l)
          {return // latest-friend
              $col(cons(car($l), $new_l), $seen);
          })));
}
a-friend
function a_friend
($s_1, $s_2)
{return 
    is_nulll($s_2);
}
last-friend
function last_friend
($new_l, $seen)
{return 
    length($new_l);
}
multiinsertLR
function multiinsert_left_right
($new_s, $old_L, $old_R, $l)
{return
    is_nulll($l) ? []
    : (is_eq($old_L, car($l)) ?
      cons($new_s, cons($old_L,
            multiinsert_left_right($new_s, $old_L, $old_R, cdr($l))))
      : (is_eq($old_R, car($l)) ?
        cons($old_R, cons($new_s,
            multiinsert_left_right($new_s, $old_L, $old_R, cdr($l))))
        : (cons(car($l),
            multiinsert_left_right($new_s, $old_L, $old_R, cdr($l))))));
}
multiinsertLR&co
function multiinsert_left_right_co
($new_s, $old_L, $old_R, $l, $col)
{return 
    is_nulll($l) ? $col([], 0, 0)
    : (is_eq($old_L, car($l)) ?
      multiinsert_left_right_co($new_s, $old_L, $old_R, cdr($l),
            function ($new_l, $n_L, $n_R) use ($col, $new_s, $old_L)
            {return
                $col(cons($new_s, cons($old_L, $new_l)), add1($n_L), $n_R);
            })
      : (is_eq($old_R, car($l)) ?
        multiinsert_left_right_co($new_s, $old_L, $old_R, cdr($l),
            function ($new_l, $n_L, $n_R) use ($col, $new_s, $old_R)
            {return
                $col(cons($old_R, cons($new_s, $new_l)), $n_L, add1($n_R));
            })
        : (multiinsert_left_right_co($new_s, $old_L, $old_R, cdr($l),
            function ($new_l, $n_L, $n_R) use ($col, $l)
            {return
                $col(cons(car($l), $new_l), $n_L, $n_R);
            }))));
}
even?
function is_even
($n)
{return 
    is_eqn($n, x(division($n, 2), 2));
}
evens-only*
function evens_only_star
($l)
{return
    is_nulll($l) ? []
    : (is_atom(car($l)) ? 
        is_even(car($l)) ? cons(car($l), evens_only_star(cdr($l)))
        : evens_only_star(cdr($l))
      : cons(evens_only_star(car($l)), evens_only_star(cdr($l))));
}
evens-only*&co
function evens_only_star_co
($l, $col)
{return 
    is_nulll($l) ? $col([], 1, 0)
    : (is_atom(car($l)) ?
        is_even(car($l)) ? evens_only_star_co(cdr($l),
            function ($new_l, $product, $sum) use ($col, $l)
            {return 
                $col(cons(car($l), $new_l), x(car($l), $product), $sum);
            })
        : evens_only_star_co(cdr($l),
            function ($new_l, $product, $sum) use ($col, $l)
            {return 
                $col($new_l, $product, plus(car($l), $sum));
            })
      : evens_only_star_co(car($l), 
            function ($a_l, $a_product, $a_sum) use ($col, $l)
            {return
                evens_only_star_co(cdr($l), 
                    function($d_l, $d_product, $d_sum) 
                    use ($col, $l, $a_l, $a_product, $a_sum)
                    {return
                        $col(cons($a_l, $d_l), 
                             x($a_product, $d_product), 
                             plus($a_sum, $d_sum));
                    });
            }));
}
the-last-friend
function the_last_friend
($new_l, $product, $sum)
{return
    cons($sum, cons($product, $new_l));
}
  1. Curry-ing
  2. Moses Schönfinkel
  3. Haskell B. Curry
  4. "collector"/"continuation"