Tips for posting code

Lisp Quiz challenges and discussion

Tips for posting code

Postby findinglisp » Sun Aug 17, 2008 4:05 pm

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.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
findinglisp
 
Posts: 440
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX

Re: Tips for posting code

Postby Paul Donnelly » Mon Aug 18, 2008 12:37 am

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.
Paul Donnelly
 
Posts: 148
Joined: Wed Jul 30, 2008 11:26 pm

Re: Tips for posting code

Postby Jasper » Wed May 20, 2009 2:19 pm

Hmm have been using #'mapcar to denote functions.. Dislike the all-caps thingy.. (But i guess there is no variables preface..)
Jasper
 
Posts: 209
Joined: Fri Oct 10, 2008 8:22 am
Location: Eindhoven, The Netherlands


Return to Lisp Quiz

Who is online

Users browsing this forum: No registered users and 1 guest