Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
6 votes

Types in Lisp and Scheme

Typed Racket is very different from Haskell. Type systems in Lisp and Scheme, and indeed type systems in traditionally untyped language ecosystems in general, have a fundamental goal that other type ...
Jack's user avatar
  • 4,489
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 ...
Jörg W Mittag's user avatar
5 votes

Can Lisp keywords be protected?

In Common Lisp, all symbols in the package COMMON LISP are protected by the standard. It says that redefining the package or the symbols in the package has undefined consequences. Which means, ...
Rainer Joswig's user avatar
3 votes

How useful are Lisp macros?

Here's one I use for debugging (in Clojure): user=> (defmacro print-var [varname] `(println ~(name varname) "=" ~varname)) #'user/print-var => (def x (reduce * [1 2 3 4 5])) #'user/x => (...
Jonas Kölker's user avatar
3 votes

Can Lisp keywords be protected?

Symbols are not protected because they don't need to be. Some languages have reserved names because their syntax cannot tolerate having a class named "class", even though technically you could avoid ...
coredump's user avatar
  • 5,965
2 votes

Can Lisp keywords be protected?

Why aren't lisp keywords protected? Because they aren't keywords, they are just library functions like any other. Where can this be useful, It means that you, as a user, have the same power as ...
Jörg W Mittag's user avatar
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 ...
JacquesB's user avatar
  • 59.7k
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 ...
user102008's user avatar
1 vote

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))) ...
Rainer Joswig's user avatar
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 ...
Doc Brown's user avatar
  • 208k
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 ...
John R. Strohm's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible