anonymous-recursion Questions

9

I'm in a Scheme class and I was curious about writing a recursive function without using define. The main problem, of course, is that you cannot call a function within itself if it doesn't have a n...
Jitters asked 10/10, 2011 at 21:37

7

Solved

I'm doing an academic exercise (for personal growth). I want to find programming languages that allow you to define functions that are capable of accepting themselves (i.e., pointers to themselves)...

2

Solved

In the book The little schemer, we find this function that only supports lists with length smaller than or equal to 1: (((lambda (mk-length) ; A. (mk-length mk-length)) (lambda (mk-length) (la...

2

Solved

In The Little Schemer book, in Chapter 9, while building a length function for arbitrary long input, the following is suggested (on pages 170-171), that in the following code snippet (from page 168...

2

Solved

I'm reading The Little Schemer and feel confused about the following code: ((lambda (len) (lambda (l) (cond ((null? l) 0) (else (+ 1 (len (cdr l))))))) eternity) (define eternity (lambda ...
Remindful asked 23/10, 2013 at 14:31

1

Solved

I've been looking into how languages that forbid use-before-def and don't have mutable cells (no set! or setq) can nonetheless provide recursion. I of course ran across the (famous? infamous?) Y co...
Cassatt asked 28/4, 2013 at 0:27

1

Solved

I've spent a day reading page 166's length≤1 in the book The Little Schemer; there's the following code: (((lambda (mk-length) (mk-length mk-length)) (lambda (mk-length) (lambda (l) (cond ((n...

3

Solved

I was trying to solve the maximal subsequence sum problem and came up with a neato solution msss :: (Ord a, Num a) => [a] -> a msss = f 0 0 f gmax _ [] = gmax f gmax lmax (x:xs) = let g =...

5

Solved

I surfed into this site a few days ago on "Anonymous Recursion in C#". The thrust of the article is that the following code will not work in C#: Func<int, int> fib = n => n > 1 ? fib(n...
Drowsy asked 30/3, 2011 at 14:54
1

© 2022 - 2024 — McMap. All rights reserved.