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

Stylish )))

Name: Anonymous 2012-04-01 23:04

Hello /prog/,
How do you manage your closing parenthesis?

Do you let them hang:                                   
(define (fun1 b)
  (let ((a (fun2 1 2 3)))
    (case
      ((python) (display "FIOC"))
      ((bear) (display "LISP"))
      )
    )
  )


or you tuck them in:                                    
(define (fun1 b)
  (let ((a (fun2 1 2 3)))
    (case
      ((python) (display "FIOC"))
      ((bear) (display "LISP")))))


or, let out a bit at the end of the defun:              

(define (fun1 b)
  (let ((a (fun2 1 2 3)))
    (case
      ((python) (display "FIOC"))
      ((bear) (display "LISP"))))
  )

Name: Anonymous 2012-04-03 1:11

>>20
No. Get the fuck out of here with that stupid shit.

Name: Anonymous 2012-04-03 3:34

>>21
having a text editor that matches parenthesis is enough. If you want, the editor can enforce indentation via the parens.

Name: Anonymous 2012-04-03 3:39

Whoever thinks forced indentation is a good idea needs to be brutally and savagely beaten about the head and neck.

Name: Anonymous 2012-04-03 13:55

"tucked them in"

It's the proper Lisp style and most editors support it nicely.
Even then you can place a closing paren on an empty line (for example, if a list is incomplete or automatically generated), but it should be placed with the same alignment as the previous line, so:

(list
  '(like this))

or for incomplete lists (bad style, but better than the C-like one):

(list
  '(like this)
  )

Name: Anonymous 2012-04-03 23:46

>>27
Short responses like that are ambiguous enough to leave the impression of having a point, but when you have a string of such short responses associated together, there is enough information to infer that you don't know what you are talking about.

Name: Anonymous 2012-04-04 4:58

>>38
Is any language readable with no indentation? And I mean a language with nested structures. Assembly and short perl scripts with no sub routines are not applicable, because their syntax only needs to express a sequence of one lines statements.

For me it's the stupid mistakes. Like doing:


(let (a 2)
  (+ a a))


instead of:


(let ((a 2))
  (+ a a))


Both of these read correctly at first to a person, but only one works.

Name: Anonymous 2012-04-04 9:10

>>23
Fixing language flaws in the editor is mindblowingly idiotic.
Computers exist to be used. You use computers to perform repetitive tasks. If you don't, you may as well return to the abacus.

Name: Anonymous 2012-04-04 9:26

>>38
Such linguistic skill can only come from forge of experience. Please regale us of more of your wisdom, oh wise one.

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