Page 1 of 1

Tips for posting code

Posted: Sun Aug 17, 2008 4:05 pm
by findinglisp
To help make the solutions and code posted to the Lisp Quiz forum maximally readable, please make sure you follow the directions below:
  1. 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.
  2. 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:

    Code: Select all

    (setq-default indent-tabs-mode nil)
    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.

Re: Tips for posting code

Posted: Mon Aug 18, 2008 12:37 am
by Paul Donnelly
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

Posted: Wed May 20, 2009 2:19 pm
by Jasper
Hmm have been using #'mapcar to denote functions.. Dislike the all-caps thingy.. (But i guess there is no variables preface..)