Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/ / + LISP snippet proposal

Name: Anonymous 2010-06-14 20:57

I propose that LISP-like code snippets be posted not with [code] tags, but instead, with [m] tags.

I suggest this because the prettyprint script Shii chan uses is designed for C-like languages. We've all experienced an entire post worth of greentext because of an "unmatched" apostrophe. It's distracting!

It's not a perfect solution, but it's the best one we have. But it's not so bad: the color isn't as significant so much as the fixed-width formatting anyway. So when posting LISP-like code, use [m] tags!

Also, please don't try to use [aa] tags. That could cause a real mess!

Thank you for your attention to this matter.

Name: Anonymous 2010-06-14 21:26

I tend to use m-tags if I have # or ' in the code, otherwise code-tags.

I also have my own formatter that looks like:
(defun write-tag (tag s)
  (format nil "[~a]~a[/~a]" tag s tag))

(defun escape-slash (s)
  (substitute "\" "\\" s))

(defun fancy-format (s)
  (escape-slash
   (write-tag "m"
     (with-output-to-string (o)
       (loop for c across s
      do (princ (case c
              ((#[b]([/b] #[b])[/b]) (write-tag "b" c))
              (t c))
            o))))))


I only use it from time to time, as I don't always feel like testing for possible bbcode failures (like now).

Name: Anonymous 2010-06-14 21:29

And that obviously had to fuck up somehow... I forgot to account for the damn Emacs tabs which I should have turned off to begin with.

(defun write-tag (tag s)
  (format nil "[~a]~a[/~a]" tag s tag))

(defun escape-slash (s)
  (substitute "\" "\\" s))

(defun fancy-format (s)
  (escape-slash
   (write-tag "m"
     (with-output-to-string (o)
       (loop for c across s
             do (princ (case c
                         ((#[b]([/b] #[b])[/b]) (write-tag "b" c))
                         (t c))
                       o))))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List