- Make sure you post your code using the \[code\] bbcode tag. Use the button in the editing interface to wrap your code with this tag.
- Make sure you format your code with spaces instead of tabs. Many Lispers use Emacs to write code. By default, Emacs uses a combination of tabs and spaces indent your code with a minimum number of characters. Unfortunately, the tabs don't translate well into the forum. To convert your code to use all spaces instead of tabs and spaces, select the region of code you want to paste into the forum and execute M-x untabify. To permanently change Emacs' behavior to use just spaces (hard disks are large and cheap these days, so there is little reason to try to save space), put the following in your .emacs file:
This will not change any lines of existing files that have been edited previously, so you'll have to run M-x untabify on the buffer manually after reloading them.
Code: Select all
(setq-default indent-tabs-mode nil)
Tips for posting code
-
- Posts: 447
- Joined: Sat Jun 28, 2008 7:49 am
- Location: Austin, TX
- Contact:
Tips for posting code
To help make the solutions and code posted to the Lisp Quiz forum maximally readable, please make sure you follow the directions below:
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
-
- Posts: 148
- Joined: Wed Jul 30, 2008 11:26 pm
Re: Tips for posting code
Perhaps this would be a good place to mention the convention that lisp symbols in a body of text, such as the function MAPCAR or the variable FOO are written in capital letters to distinguish them from plain old text.
Re: Tips for posting code
Hmm have been using #'mapcar to denote functions.. Dislike the all-caps thingy.. (But i guess there is no variables preface..)