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

Help me /prog/

Name: Anonymous 2012-09-30 18:31

I love this style:

if (c) {f();
        g();}
else {h();
      i();}


It reminds me of LISP and takes less screen space, but my boss is a Jew and refuses to accept it. What should I do?

Name: Anonymous 2012-09-30 18:40

indent his anus.

Name: Anonymous 2012-09-30 19:58

you have shit tastes son

Name: Anonymous 2012-09-30 20:15

That's Abelson disgusting.

Name: Anonymous 2012-09-30 20:15

Is there a way to make if more like if (c) thenFn(); elseFn(); without explicit else? Because else is annoying.

Name: Anonymous 2012-09-30 20:23

>>5
Yes, using Lisp.

Name: Anonymous 2012-09-30 20:27

>>5
Have you considered the ternary operator?

Name: Anonymous 2012-09-30 20:56

>>1
It's because of faggots like you that languages like Python are popular. I hope you're proud of yourself!

Name: Anonymous 2012-09-30 20:56

ISHYGIDIGGY DIGGYDOO!

Name: Anonymous 2012-09-30 21:06

Name: Anonymous 2012-09-30 21:29

>>10
Not sure what you're trying to say there, but I'll take if-as-expression over if-as-statement any day.

Name: Anonymous 2012-09-30 21:42

>>11
An instruction set is said to be orthogonal if it lacks redundancy (i.e. there is only a single instruction that can be used to accomplish a given task)[8] and is designed such that instructions can use any register in any addressing mode. This terminology results from considering an instruction as a vector whose components are the instruction fields. One field identifies the registers to be operated upon, and another specifies the addressing mode. An orthogonal instruction set uniquely encodes all combinations of registers and addressing modes.[citation needed]

Name: Anonymous 2012-09-30 21:44

>>12
So, basically, the opposite of x86.

Name: Anonymous 2012-09-30 21:49

inb4 Cudder the faggot.

Name: Anonymous 2012-09-30 21:51

>>5
macros :D

Name: Anonymous 2012-09-30 21:51

why?

my eyes hurt, op.

Name: Anonymous 2012-09-30 21:57

>>12
How exactly is that relevant?

Name: Anonymous 2012-09-30 22:01

>>16
it looks symmetric.

Name: Anonymous 2012-09-30 22:53

>>16
Why do your eyes hurt? What sort of subprogrammer are you?

Name: Anonymous 2012-09-30 23:58

>>19
Probably because OP used [m] tags instead of [code] tags.
if (c) {f();
        g();}
else {h();
      i();}

There, much better!

Name: Anonymous 2012-10-01 4:49

>>20
still looks like shit

Name: Anonymous 2012-10-01 6:01

#define IF(x) if (x) {
#define ELSE }{
#define ENDIF }

IF (c)
    f();
    g();
ELSE
    h();
    i();
ENDIF

Name: RISUPU STYLE 2012-10-01 6:04

#ifthenelse(x, f1, f2) if (x) { f1; } else { f2; }

ifthenelse (c,
           (f(), g()),
           (h(), i()));

Name: Anonymous 2012-10-01 6:04

>>22
genious

Name: Anonymous 2012-10-01 6:07

C's if cannot be used as an expression and the ternary operator requires both results to have the same type. Therefore, the only way to emulate Lisp's if is to wrap most expressions into a common Lisp object structure.

Name: perl 2012-10-01 8:22

>>5

c ? f(); g(); : h(); i();

//Better yet:
switch (c){
   case 1:
      f(); g();
      break;
   case 0
      h(); i();
      break;
}
//SEPPLES

Name: Anonymous 2012-10-01 9:54

>>23

ifthenelse (c,
           (for (n=0;n<bound;n++) f(n)),
           (h(), i()));


doesnt work.

Name: Anonymous 2012-10-01 11:41

the ternary operator requires both results to have the same type.
That's necessary for it to be an expression. What would be the type of the expression if the two branches returned different types?

>>26
c ? (f(), g()) : (h(), i())

Name: Anonymous 2012-10-01 11:59

>>28
What would be the type of the expression if the two branches returned different types?
That's the point of dynamic typing.

Name: Anonymous 2012-10-01 12:30

?(x)(y)(z)

#define ?(x)(y)(z) if((x)){y}else{z}

does it work? if it doesn't your own preprocessor might be in order

Name: Anonymous 2012-10-01 12:33

>>30
No. Use m4

Name: Anonymous 2012-10-01 17:15

>>28
Wouldn't work, just void the expressions.

>>29
Does invalid macro definition syntax work? No.

Name: >>32 2012-10-01 18:12

>>29
Should be >>30

Name: Anonymous 2012-10-01 18:19

>>31
or just sed

Name: Anonymous 2012-10-01 19:30

>>5
condition?trueFn():falseFn;

Name: Anonymous 2012-10-02 7:26

There are no jews. Please continue with this programming-related discussion.

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