Looking for good Lisp code to read [duplicate] - lisp

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Examples of excellent Common Lisp code?
I'm currently trying to get proficient in Common Lisp and to learn some of the tricks for writing compact, clear and beautiful code in it.
So, I want to know if you have any sources of good Common Lisp, preferably free and online but books are also OK.

The most admirable modern Common Lisp I've seen is in Edi Weitz's libraries. (Look within the outline area NerdStuff/Common Lisp/Code available on this server.) His CL-PPCRE library is worth studying in depth.

Large codebases can be schizophrenic, because there are often many contributors to the project. I would also say that contributors tend to want to add new features rather than re-write some code because it could be coded in a slightly more elegant way.
Paul Graham is attributed with good coding style. The link points to pages where his coding style in ANSI Common Lisp is commented upon.
Peter Norvig has also written about good Lisp coding style here.

Practical Common Lisp
Complete book (HTML) is free.
http://www.gigamonkeys.com/book/

Most open source Common Lisp (CL) environments ship with a lot of CL source code.
Take a look at CMUCL, CLISP and SBCL.
Cliki (the Common Lisp Wiki) has many open source CL packages.
Google Code Search is another large repository of CL code. Setting the language to "Lisp" will return both CL and non-CL files, like Emacs Lisp (.el) files. To narrow the results, set the Files text box to .lisp$ so only file names that end in .lisp are returned.

Paradigms of AI Programming. The code is online, though the book itself is not to be missed.
On Lisp is also very fine.

Related

Ironclad Cryptography Library for Emacs Lisp?

I love the Ironclad cryptography library for Common Lisp. Out of curiosity, has anyone implemented this library into their Emacs Lisp project? In researching this question, I suspected there would be too much work to make it compatible with a pure Emacs Lips project, but a hybrid Elisp and CL project might also be an option for what I need to do.
Some of the functionality of ironclad is built-in to Emacs via the secure-hash and md5 functions. http://www.gnu.org/software/emacs/manual/html_node/elisp/Checksum_002fHash.html has more information.
These functions are written in C. I don't know for sure, but it seems like Emacs Lisp's slow speed and small fixnums would be a real obstacle for doing this work directly in pure elisp.

Examples on Literate Programming with Racket scribble/lp

In addition to learning Racket I'm trying to learn literate programming. Unfortunately the Racket documentation is sparse to say the least with regards to scribble/lp. Could someone point me to some better resources on this subject or examples of literate programs written in Racket?
Thank you kindly.
Here's a small puzzle game in Racket, using the scribble/lp library: https://github.com/racket/games/blob/master/chat-noir/chat-noir-literate.rkt
Here is another shorter and self - explanatory example:
Project Repository Github.
Project Page using woven output.
It was written to cover some of the gaps in the Racket documentation.

Emacs without Lisp [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Should I learn to use Emacs with no intention to learn Lisp, if my other option is to get familiar with vi?
Yes. With all the resources out there (FAQ, Emacs wiki, and the Stack Exchange Emacs site) and custom (M-x custom). You don't need to know Lisp. You just cut/paste what you find.
You can drive a Ferrari/Yugo without knowing the internals of the combustion engine or how a Formula One transmission works...
Why not?
You can still learn vi (probably Vim or Elvis).
You can learn jEdit. Or nano and Pico. Or whatever other editor, environment, and language-host you fancy.
Why put such an arbitrary restriction on things? While your Emacs experience will be better if you learn at least basic Emacs Lisp (a .. derelict .. Lisp implementation), it's not required. But at the end of the day, it's a tool. Get as many useful tools as you can. "Useful" also really depends on context.
I have used Emacs for several years with next to no knowledge of Lisp and it served me well for all of the projects I used it for.
You can always simply assume that the configuration you're writing is not in Emacs Lisp and that it is just some funny configuration format - there a lot stranger examples out there (such as Sendmail).
I should warn you though that once I started learning Emacs Lisp my Emacs mastery expanded extremely rapidly - now that I understand the details of the language I can easily bend any configuration to my needs and more importantly I started writing my own extension to Emacs, which add to it even more capabilities.
If you decided to start with Emacs, I recommend to read first this great book - it taught me a lot of things for Emacs at the beginning and it assumes no Lisp knowledge. It won't teach you any Lisp either. Afterwards my advice would be read the official Emacs manual and start exploring the Emacs Wiki and #emacs on Freenode.
Learning Emacs truly is a journey that is not for the faint of heart, but it is journey that is most certainly worth it...
Configuring Emacs is a journey, and it's something that you're going to want to do. Being able to customize your developing environment is one of Emacs' greatest strengths. It's almost unavoidable. You pick up bits and pieces just by looking at other people's .emacs files.
Knowing just a little bit of Lisp goes a long way in Emacs.
You don't need to learn Lisp to use Emacs. Even basic customization of Emacs works fine without Lisp knowledge. If you need something beyond your capabilities, there are many helpful Emacs users.
Learning a bit Emacs Lisp will later enhance your understanding of Emacs.
Emacs Lisp is a relatively simple Lisp dialect. Basic Emacs Lisp is not that difficult to learn. As an experienced Lisp user I have to say that Emacs is available quite some time and the users have written some amazing things in Emacs (like Org-mode). Some of the Emacs extensions are very very well written and it is a pleasure to read the code.
Well, if you don't want to customize your Emacs, you won't need Lisp, either. And you can also do some basic modifications using the build-in customize functionality and by copy&pasting code of others. But truth being: I have written several hundreds of lines of code to customize Emacs to suit my needs. On the other side, as far as I know, vi is not as customizable as Emacs, so in the end it is probably more about what editor you like more and you should try both.
I know little Lisp and use Emacs to edit my C and OCaml programs on Windows and Linux.
I've been using Emacs for a year and a half, and really only picked up whatever Emacs Lisp came without trying. I have a heavily extended set of configurations (first in a .emacs file, and now in ~/.emacs.d/init.el and friends), which are totally a result of cutting and pasting from the excellent resources found online.
Aside from, of course, the EmacsWiki, you should see the fine Emacs Starters Kit and subscribe to Planet Emacsen --- preferably in a feed reader. It's prettier.
Having said that, after you have a working setup you might yield to the temptation to learn a little Emacs Lisp. I've just started the free Introduction to Programming In Emacs Lisp, which comes with Emacs and is best read from within Emacs Info. It assumes neither programming ability nor Lisp knowledge, and is a friendly introduction to the 'vibe' of Emacs Lisp which I find to be well-written in the extreme, friendly and concise, and worth 10x every minute I have spent with it.

Emacs exercises to become more comfortable and familiar with the editor itself as well as Lisp? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
There's a great project called the Ruby Koans, it's a series of tasks to exercise yourself in the Ruby language, stepping you through the standard library using the Ruby Unit Testing suite as a learning tool. It's a great project.
I'd love to see something similar for Emacs.
Can anyone recommend any Lisp exercises to be done inside of Emacs to both exercise Lisp and Emacs usage? Perhaps also while completing the Ruby Koans?
There used to be lesson in .el format (emacs lisp) at http://www.gnuvola.org/software/elisp-tutorial/.
You can find a copy of the tutorial here now.
I learned a lot from them. You read them in emacs in lisp interactive mode, and practice within the text.
The book, "Writing GNU Emacs Extensions", comes pretty close to what you're asking for.
But, if you don't want a book, there are three similar questions already in stackoverflow: What's the best way to learn lisp,
How to quickly get started at using and learning emacs, and Tips for learning elisp.
I don't know a "walk through" series that exists, but have found that the best way is to start thinking about little things you wish it did, and then trying to make it work (asking here helps). Even if Emacs already provides such functionality, you might find it more interesting to solve problems you want solved, rather than a bunch of throw-away lessons that hold little interest to you.
The The Little Schemer is a book of Lisp exercises. You need to be aware that some of them are impossible in Emacs Lisp, as it doesn't support closures.
It is also focused on teaching recursion to non-programmers, meaning that you won't cover the full range of Lisp statements (most exercises just use (cond ...) recursively.)
I really enjoyed it though.
A very old Oreilly book, Writing GNU Emacs Extensions, has some, if I remember correctly. You might also want to look at the "Emacs Lisp Intro" found in the info pages (you access them using M-x info.
Honestly, the best way to learn Emacs is to change the way you look at it. Don't look at is a text editor to be learned, but as an environment for writing text editors to be explored. Think to yourself: What did I always want in a text editor but never found in the editors that I have used? Set yourself about making it. You'll learn far more, more quickly, trying to make your "own" editor piece-by-piece than by trying to remember lessons learned from some loosely (if at all) linked exercises that have no context in a problem to be solved.
How is this one:
Write a simple program to open a particular file ("~/ekoans.txt") and select a random line from that text file, that is displayed to the user in a new temporary buffer. Call the function ekoan-random, and make it callable by the user.
The first few lines of ekoans.txt are:
Make ekoan-random open up a new file for you instead of a temporary buffer, and insert apropos header text in the new buffer.
Write an ekoan-sequential function that behaves like ekoan-random, except it works in sequential order
Make ekoan-sequential persist through a customization variable
Make the name of the koan file changeable by a customization variable
I call this Koan-strapping!

Resources for learning Emacs [duplicate]

This question already has answers here:
Good Resources For Emacs [closed]
(9 answers)
What to teach a beginner in Emacs? [closed]
(13 answers)
Closed 9 years ago.
I'd like to learn Emacs, and was wondering if anyone had any good resources (free or otherwise) to recommend. I'm mostly interested in programming Emacs, starting from the basics, and lots of "exercises". I have used Emacs and most of its editing features, although I'm a bit rusty so a very quick refresher on that would be useful as well.
Thanks
Edit: Thanks for the suggestions. I'll have a look and update with what I liked...
GNU Emacs manual
GNU Emacs lisp reference
emacswiki
Programming in Emacs Lisp (Second Edition) - free online book
One thing to bear in mind is that all emacs configuration is programming.
PlanetEmacsen is a good RSS feed with lots of tips.
Xah Lee although he is apparently considered a bad troll, has some great emacs programming stuff.
Also whenever there's a function or keyboard shortcut you're not sure of, try C-h f and C-h k respectively, then follow the link to the source code for that command.
For exercises, Lair of the DustBunny did a very long series on rewriting python mode from scratch.
You could also try writing the PLEAC elisp section. That's a very good way to compare elisp to your favourite language.
Emacs itself includes a tutorial with exercises that guides you through the basic features and editing commands. You can find it in the Menu under 'Help' or by pressing C-h t (i.e. press Control and 'h' together and then 't' alone).
Last week I purchased this Peepcode screencast and really liked it. It walks you through the basic features (editing, loading saving, buffers) but also dives into some advances topics, like programming emacs lisp:
http://peepcode.com/products/meet-emacs
Definitely the best book about Emacs is Bob Glickstein's "Writing GNU Emacs Extensions".
Really informative. Really good examples. And, for a technical book a pleasure to read. It is one of the best computer books I have. (Thereunder are such treasures like my "VIC-20 Technical Manual" from 1982 :-)
Some PDFs are available online, but for the full fun I suggest purchasing a hard-copy.
Emacs's own help system is your friend --- ask Emacs. Learn the main C-h keys and apropos.
These too can help:
http://www.emacswiki.org/emacs/HelpPlus
http://www.emacswiki.org/emacs/EmacsNewbieWithIcicles