What I am trying to do is make it possible to get people to start writing 'code that works' up to the point that they want to stop learning and start writing their own code.
If you know how a language/build setup works in general, then you can work out why in your particular case something isn't working.
If you literally can't read a languages syntax (and for most programmers Lisp is as unreadable as the Cyrillic script is to someone used to the Latin script) then 'do this and it will work' is key to a smooth learning process.
Once people have got over that, then they can take the training wheels off the bike themselves.
All they would need to do is add this to the beginning for every file "(require 'cl)".
The CL package is already bundled with Emacs, and a good chunk of emacs packages and libraries are written in it. It's not Common Lisp, just some syntatic sugar to make Elisp more like CL and every other mainstream language out there. IMO, your readers will have more difficulty understanding dynamic-scope than remembering to add a line. CL provides lexical scoping with lexical-let.
You need to stop thinking about 'what my readers will have difficultly understanding' and start thinking about 'what the author doesn't know'.
I know as much eLisp as is covered in the book so far - so I have no idea of the difference between lexical and dynamic scope in eLisp.
Doing a quick scan of the site-lisp on my 'proper' dev machine (ie not the Virtual Box image I am writing the book on) I find that the following (uncompiled) files require cl:
* mh-acros.el
* rst.el
* js2.el
* css-mode.el
* html-helper-mode.el
So it is clear that the convention "don't use cl" is being honoured in the breach for fairly standard bits of code - so as an idea it needs to be considered.
There is some lisp code printed out. I look at it. I have no idea what it is. What does a bracket mean? what does a single quote mean? what does a comma mean? How do I loop or iterate? What does a variable look like? What does a function look like?
If all you have ever programmed in is Fortran, Algol, Pascal, C++, Java, PHP, Python, Perl, Ruby and Erlang then Lisp looks like line noise/obsfucated Perl (delete as appropriate).
The fastest way to get familiar with Lisp syntax is to read _The Little Schemer_. Unlike other books people are suggesting, it's a quick read. It steps through the evaluation of Lisp code, building up from the absolute basics.
It uses Scheme, a different Lisp dialect, but for your purposes that doesn't matter. An earlier version ("The Little Lisper") used Common Lisp.
I understand totally. I had the great fortune to learn lisp after Fortran and Pascal and Pl/1, but before all the others.
lisp is a functional language (more or less) so recursion is preferred to iteration.
The beauty of lisp is that it's syntax and semantics are merged in some sense. A smart eight grader can learn scheme and be productive in an afternoon.
I don't mean to discourage you, we can always use new books, new approaches and so forth but I would recommend you go through the Chassells tutorial (reference above) that I mentioned is bundled in emacs and also look at the PLT scheme literature and/or Abelson and Sussman's SICP work as background research for your book.
I think elisp alone is a great way to learn both lisp and emacs, as well as a whole lot of computer science as well. Common Lisp is probably the most practical for the working programmer but elisp is ideal for working with emacs.
> A smart eight grader can learn scheme and be productive in an afternoon.
With all due respect "I hae ma doots" - show me such a beast as this eight grader. (as a non-American I don't even know what an eight grader is? a 14 year old, a 12 year old?)
> PLT scheme literature and/or Abelson and Sussman's SICP work
This is at the heart of the problem with Lisp in my mind. I am working on eLisp and I am getting advice to make it like Common Lisp (require 'cl) and read Scheme books.
I don't know what eLisp looks like.
I don't know how different the various dialects of Lisp are from each other.
The Chassels tutorial clearly helps the non-Lisper to write working eLisp in Emacs (and sections are referenced throughout all the existing lessons in Additional Reading) but adding more Lisp dialects into the mix at this stage isn't helping.
"With all due respect "I hae ma doots" - show me such a beast as this eight grader. (as a non-American I don't even know what an eight grader is? a 14 year old, a 12 year old?)"
I'm referring to the teach scheme[1] project of Felleisen et. al.
"I don't know what eLisp looks like.
I don't know how different the various dialects of Lisp are from each other."
I see, sorry, I misunderstood. So you're learning elisp by writing a book. Great idea, truly, I always found teaching a subject a good way to learn it better. Writing a book is also good for that. All the best and happy new year!
http://dto.github.com/notebook/require-cl.html