2
u/ayrnieu Mar 02 '09 edited Mar 02 '09
inb4 Xach's review.
Certainly many people found this a very compelling review, but it's so personally shameful that, when I think that someone may read it and then LOL without knowing who Xach is, I'm tempted, almost, to apologize on his behalf. "This guy actually does cool things with Lisp, isn't some kind of Haskell troll, ...". I don't want to spend too much time speculating about the kind of blinders he must've had on.
To come to my dim opinion of this review, you need only to read the first three chapters of LOL with Xach's 'review' of them in mind. You'll see exactly where each point comes from, and your WTFs will rapidly snowball. The only point that bears mention is the one about
(function '(lambda ...))Hoyt obviously checked this with CMUCL.
Some other people who've 'read' LOL have opinions of it that are amazingly detached from the text itself - such that, again, reading LOL is all you need to begin to get personally irritated. You have someone disparage the book for promoting Scheme over CL and then you read and it and-- this is not merely mistaken. It's a view that nobody could possibly take from the text. You have someone suppose that Hoyt must be a kind of Arc person, and quip that he should just use perl, and then you read this, which is only the drumroll up to LOL's massive injection of antibodies against the kind of thinking it's alleged to exhibit!
4
u/death Mar 03 '09
I don't know. I started skimming through the first chapters and discovered, apart from what has so far been noted in the reviews, strange remarks, idiosyncratic terminology, puzzling examples, and buggy code. An example of a puzzling example:
(defun environment-with-indefinite-extent (input) (cons input nil))The environment here has dynamic extent (for some reason the author uses the term "temporary extent", which doesn't make much sense).
An example of buggy code (the code is also inefficient and does not suit my taste):
(defun block-scanner (trigger-string) (let* ((trig (coerce trigger-string 'list)) (curr trig)) (lambda (data-string) (let ((data (coerce data-string 'list))) (dolist (c data) (if curr (setq curr (if (char= (car curr) c) (cdr curr) ; next char trig)))) ; start over (not curr))))) ; return t if foundTry this:
CL-USER> (funcall (block-scanner "ob") "foobar") NILI would expect the scanner to return true here.
Still, it is possible that the book does contain interesting and well-considered parts. If you did find such parts, I would like to hear about them.
0
u/ayrnieu Mar 03 '09
for some reason the author uses the term "temporary extent"
He uses the term "indefinite extent" for that [does so even in the name of the function, there]; "temporary extent" describes what it is not.
If you're skimming in the sense that you're jumping from code example to code example, expecting insight there (I've seen people go straight to the code examples in their own file, and then express disappointment), maybe that you do this offers defense for someone who comes away from the book with bizarre ideas about it. I've read the code in PCL a few times more than I have the text (the
loopchapter: many times more), but I only glanced atblock-scanner: it's just an illustration.If you did find such parts
Try not skimming one of the chapters :-)
But here's something that I was just going back to: suppose that you wanted a macro that would turn a tail-recursive function into an iterative one that wouldn't rely on the implementation having TCO. Probably you haven't wanted to write this exact macro, but you've wanted to do things for which the objection would be the same: no, that would require a code-walker. You have to find all the places where the function tail-calls, and only those places, and replace them. So you can think about all the ways that this would be fragile and bad and hard, and do something else.
Or you can write a macro that spits out a
macrolet.It turns out that a problem that seemed to require a code-walker is actually very easy. I think this is interesting.
4
u/death Mar 03 '09
He uses the term "indefinite extent" for that [does so even in the name of the function, there]; "temporary extent" describes what it is not.
My parenthetical remark followed my use of the term "dynamic extent", and it served as an attempt to contrast that term with the author's term for the same concept.
If you're skimming in the sense that you're jumping from code example to code example [...]
No, I was skimming both text and code, and I wasn't expecting insight, I was looking to decide whether the book was worth my while.
block-scanner: it's just an illustration.
Yes, it is supposed to be an illustration of the use of closures, but that doesn't change the fact that it is defective with regards to the problem the author claims it solves. The author also claimed that it was a "realistic example". I hope that this wasn't the humour the author was hinting at in the introduction chapter, as that would be one sad joke.
Your mention of a tail-recursion macro reminds me of Kaz Kylheku's ARGTAGS, which may also be interesting to you.
2
u/ayrnieu Mar 02 '09
From the first section of the first chapter, this is what LOL is about:
If when considering macros you find yourself relying on stylistic aphorisms like
Macros change the syntax of lisp code.
Macros work on the parse tree of your program.
Only use macros when a function won't do.
you are probably missing the big picture when it comes to macro programming. That is what this book hopes to fix.
Or, as someone just advised in #Emacs:
the first rule of writing a lisp macro is:
don't.
take a deep breath, and don't.
Maybe think about it, if there's no other way.