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

Pages: 1-

/ / + 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:09

or you know we could just use (quote foo) instead of 'foo. Or perhaps quasiquote if the following test is successful

(define (hax a . b)
    (define (haxit x) `(hax my ,x))
    (if (null? b)
        (haxit a)
        `(,@(map haxit (cons a b))))) ; yes i know i could have just used the map by itself, but i want to see if shitchan matches backticks
(hax (quote anus))
(hax my anus)
(hax (quote anus) (quote thread) (quote post))
((hax my anus) (hax my thread) (hax my post))

Name: Anonymous 2010-06-14 21:14

the main problem with Scheme code is quoting the empty list '(), this could be avoided if people would use (list).

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))))))

Name: Anonymous 2010-06-15 0:08

(it isn't really that hard to 'use 'quotes, is it?)

Name: Anonymous 2010-06-15 0:10

>>4,5
That will be broken on Linux systems because Freetype is retarded and renders bold text a different width from normal text.

Name: Anonymous 2010-06-15 0:23

>>7
Looks fine here. Something's retarded but for once it's not Freetype.

Name: Anonymous 2010-06-15 1:34

>>7
It only does that when there is no genuine bold font available and it has to fake it based on the regular-weight one, which isn't going to happen for the vast majority of fonts a user is likely to have installed.

Name: ​​​​​​​​​​ 2010-10-24 13:48

Name: Anonymous 2010-11-14 17:06

Name: Anonymous 2010-12-27 7:42

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