I’m working through The Reasoned Schemer and had some trouble seeing clearly how results are returned when using run n. After Googling a bit, I found a clear walkthrough of the logic on an obscure message board. I’m reposting here to make sure it doesn’t disappear.
The key insight is that the n in run n refers not to the number of goals that should be tried, but rather the number of answers that should be returned, if available. Full text below:
Posted: Mon Jan 14, 2008 2:19 pm
Hi all,
I’m currently re-reading the Reasoned Schemer, but am having a bit of
difficulty understanding how values are computed for recursive
functions. For example, in chapter 2, the recursive function lolo and
section 24 asks what is the value of the following:(run 5 (x)
(lolo ((a b) (c d) . x)))The first value (), is obvious to me. The variable x is fresh, so it
is associated with () via the nullo check on line 4 of the method.Here’s my explanation for how the second value is derived. Since we
are asking for another value, and the expressions are evaluated within
the conde, we refresh x and try the next line. At this point, the caro
associates the fresh variable x with the cons of the fresh variable a
and the fresh variable d-prime (introduced by the caro). Then, listo
is called on a. Since a is fresh, this call associates a with ().
Since this question succeeds, we try the answer. The cdro associates x
with the cons of fresh variable a-prime (introduced by the cdro) and
the fresh variable d. Then, lolo is called on d, and so d (being
fresh), is associated with ().Since a-prime and a co-share, and a is (), and d and d-prime co-share,
and d is (), x can be successfully associated with the cons of () and
(), so the result is (()).Here’s where I get confused. This invocation of run 2 has actually
produced #s 3 times, once to produce () and twice to produce (())
(once in each of the calls to listo and the recursive call to lolo).
However, we have *asked* for only two goals to be met, in order to
produce two values. If I invoke “run 3 …,” however, which conde
lines in which recursive frames are being evaluated, and having their
associations preserved? Or rather, how is the result expanding beyond
(())?At the high level, I understand why the answer is (() (()) (() ()) (()
() ()) (() () () ())). But I’m still missing something at the lower
level that makes it harder for me to understand how some of the more
advanced examples, like the adder, work.Thanks,
Joe
=====================Posted: Tue Jan 15, 2008 3:30 pm
(run 2 (q) g1 g2 g3) does *not* specify that at most two goal
invocations should succeed, or that at most two #s goals should be
tried. Rather, run 2 specifies that we want two answers (if there are
two answers to be had), regardless of how many goals must be tried,
must succeed, or must fail in order to get those answers.Hope this helps.
–Will


Michael Ellsberg’s (Mixergy) Advice on Copywriting
Today we’re going to take a detour from the regular topics at eigenjoy and talk about a topic a lot of hackers need help with: copywriting.
If you’re reading this blog you probably need help copywriting.
A common trend I’ve seen with hackers is that while we’re strong on technical prowess, we’re short on communicating why our work is important. We can whip up a beautiful rails app in a few hours and craft elegant functional combinators but we struggle to explain why our product is worth someone’s attention (and money).
You may be thinking: wait a minute, copywriting is sleazy and I don’t want to stoop to that. I would argue that while some direct response marketing is scummy, copywriting, in the broader sense, is a lot more than cheap tricks. Being able to craft empathetic and direct copy can mean the difference between failure and success with your product.
Enter Michael Ellsberg.
I first took note of Michael when I read his excellent Forbes article building a social economy through helping others. (He also expounds on this idea in his talk to the Thiel Fellows. Highly recommended.)
Michael Ellsberg at the Thiel Fellowship Retreat from Michael Ellsberg on Vimeo.
Michael was recently interviewed by Andrew Warner on Mixergy and they spent a bit of time talking about how to become a better copywriter.
Michael’s advice was this: create a new email address and sign up for the email lists by master copywriters. This allows you to read and learn their techniques for free. In the interview, Michael also mentioned a number of classic books in the field of copywriting.
I’ve collected links to each of these resources and I’ve listed them for you below.*
Direct Response Copywriters
Please note! These folks range from the soft-sell to the extreme-hard-sell (e.g. Dan Kennedy). Please be aware that I’m not necessarily endorsing these hard-edge techniques, but rather, I want to make you aware of the full range of tools you have in your toolbox.
Copywriting Books
Hope this helps!
P.S.
Since we’re on the topic of copywriting, I’d suggest you checkout Marc-André Cournoyer’s Copy Writing for Geeks. It’s a great intro for hackers who want to quickly improve their writing skills.
* Note: None of these are affiliate links, I have no financial incentive with any of these folks.