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-02 3:34

Damn lisp is ugly. Who cares how you manage your parenthesis, they're still fucking everywhere.

Name: Anonymous 2012-04-02 3:42

I like to tuck them in.

Name: Anonymous 2012-04-02 3:49

case based on what?

Name: Anonymous 2012-04-02 4:41

TUCK.
THEM.
IN.
ALWAYS.

fucking shits

>>2
Get the fuck out you cumfart. Your homosexual breed is not welcome here.

Name: Anonymous 2012-04-02 4:58


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

Name: Anonymous 2012-04-02 14:26


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

Name: Anonymous 2012-04-02 14:50

I do it by not coding in lisp.

But if I've written a nested loop in an if statement or something, then I'll normally let them hang, and pop a little comment on the end of each one reminding me as to what it's closing.

Name: VIPPER 2012-04-02 15:05

(a
 (b
  (c) d) e)

Name: Anonymous 2012-04-02 15:18

You should always tuck them in; a reader should be able to infer the logic flux by looking at the indentation alone, wich a decent editor should produce automatically. That said, I'm not an espert so I might be wrong.

Name: Anonymous 2012-04-02 15:32

you could switch to a powerful, modern, and elegant scheme dialect such as javascript

Name: Anonymous 2012-04-02 16:19

Is there a latex-like code formatter that ties with a compiler?

Or even something which accepted basic XML tags?

That way all autists could have their own formatting, though they'd be niggers upon niggers because they would be arguing that only their formatting is valid and everyone else should use their's.

Name: Anonymous 2012-04-02 16:41

>>10
Lisp should've had FIOC instead of closing parentheses.

Name: Anonymous 2012-04-02 16:41

notepad++

Name: Anonymous 2012-04-02 18:12

>>11
If only it was certain that every implementation performed tail-call elimination, and if it had let-expressions.

Name: Anonymous 2012-04-02 22:43

>>15
javascript supports continuation functor macros and ``lexical monadic generator closures'', which should be sufficient (or better, even)

Name: Anonymous 2012-04-02 22:47

>>16
Actually, you need node.js for those.

Name: Anonymous 2012-04-02 22:53

>>10

then why bother with the parentheses, use FIOC

Name: Anonymous 2012-04-02 22:54

>>13
sexp was required for Lisp's powerful macro system.

otherwise you'd need some other ungodly syntax to replace the parans.

Name: Anonymous 2012-04-02 23:41

>>19
they could be elegantly replaced by indentation

Name: Anonymous 2012-04-03 1:09

>>20
every single decent lisper has already done this

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 5:27

>>24
Whoever thinks forced indentation is a bad idea needs to ;};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};};}

Name: Anonymous 2012-04-03 5:52

Сосачевские обезьяны такие незаметные.

Name: Anonymous 2012-04-03 12:30

>>24
forced no, optional yes

>>23
Fixing language flaws in the editor is mindblowingly idiotic.

>>22
Fuck off and die you cock sucking faggot.

>>21
Probably. They just refuse to admit it.

>>20
Replaced but not exclusively.

Name: Anonymous 2012-04-03 13:29

>>18
I should have been more precise; what I actually meant is that the reader shouldn't have to count the number of parens in the clusters that tend to form at the end of lines, he should be able to tell how many lists have been closed by the change of indentation; OTOH, losing the parens that are not at the end of a line would make a lot of statements ambiguous. As to why there is no syntactic sugar nor FIOC (like closing multiple paretheses with ] ), I think it's so that you can better appreciate the power and elegance of the language; you can also more easily make your own compiler/interpreter that way; essentially, and I know CLISP guys are gonna hate me, LISP is a pretty toy language and it should stay that way.

Name: Anonymous 2012-04-03 13:35

>>28
yes. if you want to see what a proper lisp can do, especially in the right hands, look at javascript.

Name: Anonymous 2012-04-03 13:44

>>6
ENTERPRISE LISP CODE
lol, oxymoron

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-03 23:49

>>28
yes. if you want to see what a proper dynamic langauge can do, especially in the right hands, look at this one dynamic language that I happen to like.

Name: Anonymous 2012-04-03 23:54

If M-expressions were invented, developers might all be using Lisp instead of C++.

Name: Anonymous 2012-04-03 23:56

>>34 I knew you were still here!

Name: Anonymous 2012-04-04 0:50

>>33
you sound mad. i bet you use shitty languages like python

Name: Anonymous 2012-04-04 0:52

>>36
I was only a little bit mad. I use every shitty language equally.

Name: Anonymous 2012-04-04 2:53

>>32
Fuck off and die you cock sucker.  I know perfectly well what I am talking about.  Readability is important and denying that is a great sign of being an autistic retard.  The best way to fix Lisp's problem is by allowing significant indentation.  Now go lick another toilet you mental plunger.

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.

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