5
votes
Accepted
Are lessons on tail recursion transferable to languages that don't optimize for it?
In fact, I'm nearly 100 pages in and have yet to see a single for or while loop - it's all been recursion.
Spoiler alert: you won't be seeing any loops in the book, for the simple reason that the ...
2
votes
Are lessons on tail recursion transferable to languages that don't optimize for it?
The SCIP book is about the fundamentals of programming and programming languages. It is not about lessons which you will apply to one specific programming language, rather it is about understanding ...
2
votes
Accepted
Using define in a conditional expression in Scheme
define can only be used at either the top-level, or at the beginning of a body. It cannot be used in other places where expressions can be used. Here is the relevant quote from R5RS:
Definitions are ...
2
votes
Scheme's define in Common Lisp
You don't have to use LET when using DEFUN: you can define local variables in the parameter list:
(defun foo (a)
(let ((b (expt a 3)))
(+ a b)))
is also
(defun foo (a &aux (b (expt a 3)))
...
1
vote
Scheme's define in Common Lisp
Yes, of course this is possible: CL is a language which excels in creating new languages: that's what Lisps are for.
You could start with something like binding. This is a macro which works so that
(...
1
vote
How does Lamé's Theorem give us an order-of-growth estimate for Euclid's Algorithm?
In my edition of SICP (first edition from 1987), the final sentence in that paragraph contained indeed O(log n), not Theta(log n), which fits to your observation - the provided proof literally just ...
1
vote
Are lessons on tail recursion transferable to languages that don't optimize for it?
For example, the sum of integers from n to m is 0 if n > m, and n plus the sum of integers from n+1 to m otherwise. You can write code for this using tail recursion. If tail recursion is part of ...
1
vote
"preempts no lexical conventions" in a Scheme PL report
What they're saying is that a conforming implementation must provide a syntactic mode that complies exactly with the lexical conventions of the report. It may ALSO provide ways to change the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
scheme × 61lisp × 20
functional-programming × 8
haskell × 8
programming-languages × 5
common-lisp × 5
sicp × 5
racket × 5
clojure × 4
self-improvement × 3
list × 3
tail-call × 3
c# × 2
.net × 2
data-structures × 2
learning × 2
scala × 2
standards × 2
recursion × 2
lambda × 2
macros × 2
binding × 2
keywords × 2
lambda-calculus × 2
continuation × 2