4 ms·
New Years Resolution: Learn (e)Lisp?
- cannedprimates 16y agoWhat's wrong with the Giraffe Book? http://oreilly.com/catalog/9781565922617 http://oreilly.com/catalog/9781565922617
- gordonguthrie 16y agoI only found out about it after I had started writing this one. I have never seen a physical copy of it. I also think the fairly brutal way that the Learn X The Hard Way format forces you through typing in working code is a good way for people to learn how to 'read' a new/weird syntax <-- not meant derogatively, just strangely unfamiliar.
- samuel1604 16y agofunny to see this, it is actually my new year resolution
- mahmud 16y agoIf you MUST learn elisp, at least use its Common Lisp package; it adds features and makes some sane changes to elisp that make it into a modern Lisp: http://dto.github.com/notebook/require-cl.html http://dto.github.com/notebook/require-cl.html
- gordonguthrie 16y agoThere are some difficulties with that - certainly for beginners. http://www.gnu.org/software/emacs/elisp/html_node/Coding-Conventions.html http://www.gnu.org/software/emacs/elisp/html_node/Coding-Con... 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.
- mahmud 16y agoAll 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.
- gordonguthrie 16y agoYou 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. Of course, if you signed up for the mailing list as a Lisp expert, we could nag you about questions like this :) http://groups.google.com/group/learn-elisp-for-emacs http://groups.google.com/group/learn-elisp-for-emacs
- bitdiddle 16y agofor sure the issue of dynamic scope is important. I often wonder how even more successful emacs would have become had Guile worked out.
- eeperson 16y agoThere is an intention to make lexical scoping the default in Emacs. Maybe even as soon as the next version (Emacs 24).
- bitdiddle 16y agoI'm really confused by this. Lisp has hardly any syntax at all, it's just lists.
- bitdiddle 16y agoGreat resolution, but I'm surprised by this. Type C-h i in most emacsen and you should see a great elisp tutorial as well as the full elisp manual. All you need is the space bar to read it.
- gordonguthrie 16y agoI have never been able to navigate the help in Emacs - I am sure it tells you how to do it in the help - but I have never got that far.
- defroost 16y agoYou wrote: "I wanted to learn eLisp but there are no decent beginners' book" Actually there is a fantastic Emacs Lisp book by Robert J. Chassell called "An Introduction to Programming Emacs Lisp" http://www.gnu.org/software/emacs/emacs-lisp-intro/emacs-lisp-intro.pdf http://www.gnu.org/software/emacs/emacs-lisp-intro/emacs-lis...
- gordonguthrie 16y agoIMO a beginners book should be more basic than "An Introduction To Programming Emacs Lisp". Saying "no decent beginner's book" sounds a bit snippy and up myself so I have edited the Gist.
- melling 16y agoOn StackOverFlow, before I quit, I was building up a suite of elisp questions. I though this format provided an excellent way to learn and throw down some breadcrumbs. Note on Unix/Mac, you can use Emacs as your scripting language: #!/usr/bin/emacs --script This should be a good start: Hello World: http://stackoverflow.com/questions/2170528/writing-hello-world-in-emacs http://stackoverflow.com/questions/2170528/writing-hello-wor... CGI: http://stackoverflow.com/questions/1532311/cgi-programming-in-elisp http://stackoverflow.com/questions/1532311/cgi-programming-i... AWK Example: http://stackoverflow.com/questions/2260294/awk-print-2-1-in-emacs-lisp http://stackoverflow.com/questions/2260294/awk-print-2-1-in-... Extract URLs: http://stackoverflow.com/questions/1642184/extracting-urls-from-an-emacs-buffer http://stackoverflow.com/questions/1642184/extracting-urls-f... Parse CSV/Gen HTML: http://stackoverflow.com/questions/1541682/lisp-script-to-parse-csv-and-generate-html-table http://stackoverflow.com/questions/1541682/lisp-script-to-pa... Wrap Selection like Textmate: http://stackoverflow.com/questions/1558178/wrap-selection-in-open-close-tag-like-textmate http://stackoverflow.com/questions/1558178/wrap-selection-in... MySql (Unanswered): http://stackoverflow.com/questions/1532365/mysql-queries-from-elisp http://stackoverflow.com/questions/1532365/mysql-queries-fro... Generate a Quiz: http://stackoverflow.com/questions/2264286/generating-a-quiz-in-emacs-lisp http://stackoverflow.com/questions/2264286/generating-a-quiz... Open Browser: http://stackoverflow.com/questions/1532365/mysql-queries-from-elisp http://stackoverflow.com/questions/1532365/mysql-queries-fro... Finally, I thought having the same questions answered in Common Lisp would be useful. Generate a Quiz: http://stackoverflow.com/questions/2264267/generating-a-quiz-in-common-lisp http://stackoverflow.com/questions/2264267/generating-a-quiz...
- gordonguthrie 16y agoYeah, I was thinking of asking a community wiki on Stackoverflow about what should be in the table of contents.
- hsmyers 16y ago1. Make it easier for people to comment on your text--- some sort of wiki perhaps? 2. Beginners forget, so telling them that you won't repeat information (key strokes to evaluate an expression) isn't going to help. 3. In the line 'The way in which you evaluate the expression determines where the output goes. Alos notice that the previous examples used integers like 1 and 2 and returned an integer value. This expression uses floating point numbers like 1.0 and returns a float as the result. ' Alos should be Also... 4. If you can get to a feature in the editor with key-strokes list them. If you can get there using the menu say so. If you can get there both ways mention that.
- gordonguthrie 16y agoI would like to make it like PHP documentation where you can add comments directly to the HTML pages - but that means mastering the Sphinx Document Building system as well.