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

Pages: 1-

Correct way

Name: Anonymous 2012-12-08 17:03

What is the correct way of writing ifs and elses?

I do it like this:
[code]
if()
    if(){
        (something)
        (something)
    } else if()
             (something)
else
    (something)

Name: Anonymous 2012-12-08 17:04

fuck


if()
    if(){
        (something)
        (something)
    } else if()
             (something)
else
    (something)

Name: LISPPER 2012-12-08 17:08

(if condition-1
    (if condition-2
        (begin (something)
               (something))
        (if condition-3
            (something)))
    (something))

Name: Anonymous 2012-12-08 17:09

if() {
    if() {
        (something)
        (something)
    } else if() {
        (something)
    }
} else {
    (something)
}

Name: Anonymous 2012-12-08 17:19


(cond ((p1) e1)
      ((p2) e2)
      ...
      (else e-else))

Name: Anonymous 2012-12-08 19:59


auto do_it = [&]()
    {
             if() { (something); (something); }
        else if() { (something);              }
    };

if() do_it()
else (something);

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