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

Pages: 1-4041-8081-

Shorthand if()?

Name: Anonymous 2008-05-06 4:39

sup /prog/,

I was wondering whether any of you would use in lieu of

if(cond)
 do_something();


the equivalent

cond && do_something();

or something like this for a function that returns 0 on error:

(s=get_foo()) || fprintf(stderr,"Error getting foo\n");


of course, multiline if-statements would be a bad idea with this, but how about if statements with a single body statement?

Name: Anonymous 2008-05-06 4:40

no

Name: Anonymous 2008-05-06 4:49

well i think gcc supports terniary ? thing with no else clause.

Name: Anonymous 2008-05-06 5:09

It doesn't work if do_something returns void, and it feels kinda silly to change to a different construct based on the return type of the then-clause.

>>3
What... why? Don't they like `if'?

Name: Anonymous 2008-05-06 6:57

(when cond (do_something))

Fuck "if" if there's no "else" clause.

Name: Anonymous 2008-05-06 7:35

>>3
foo ? expr : (void)0;

Name: Anonymous 2008-05-06 7:47

>>1
I do it all the time.  It's called Perl.

Name: Anonymous 2008-05-06 7:52

for(;cond;){do_something(); break;}

Name: Anonymous 2008-05-06 10:06

if me.hasanus()
  hax(me)
else
  hax(your.getanus())

Name: Anonymous 2008-05-06 10:09

__   __ __ __ ____     ___     _________________________________________
||   || || || || || ||__       Hugs 98: Based on the Haskell 98 standard
||___|| ||__|| ||__|| __||     Copyright (c) 1994-2003
||---||         ___||          World Wide Web: http://haskell.org/hugs
||   ||                        Report bugs to: hugs-bugs@haskell.org
||   || Version: November 2003 _________________________________________


   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6.1, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Name: Anonymous 2008-05-06 10:50

>>9
me
your

Please learn English.

Name: Anonymous 2008-05-06 11:53

Please upgrade, >>10.
% ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
'-._                  ___.....___
    `.__           ,-'        ,-.`-,
        `''-------'          ( p )  `._
                              `-'      (  Have you read your YAHT today?
                                        \
                              .         \
                               \---..,--'
   ................._           --...--,
                     `-.._         _.-'
                          `'-----''                         Type :ihbt for help.
Prelude>

Name: Anonymous 2008-05-06 12:05

>>12
I've been wanting to do it for over a week, but I have a fresh Ubanto install and I can't be bothered to download libs needed to make GHC 6.8.

Name: Anonymous 2008-05-06 12:12


        . . ,.".".'"""..
      .             ,__\.~~
     .    ;'``` '``     \!"
     .   `.              \~"
      .., '  ____________|'~"
     `.  .__/     |_|    |\
      `..'  |  = /  | =  ||
          | \___/   |\___|/
          |        _|    |
           \      __     |
            \    /__\  ./
            |`'._____.'|
           /|          /\
          / update your  \
            fucking GHC,
              >>13

Name: Anonymous 2008-05-06 12:26

  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006

Name: Anonymous 2008-05-06 12:32

>>15
Jews?

Name: Anonymous 2008-05-06 12:34

>>16
JEWS did LISP.

Name: Anonymous 2008-05-06 12:46

>>13
Are you still using Gutsy? Hardy comes with GHC 6.8.2.

Name: Anonymous 2008-05-06 13:57

&do_something if cond;
or
cond and &do_something;

Name: Anonymous 2008-05-06 13:59

>>19
Disregard the second one, I suck cocks.

statement and &do_something;
Fixed.

Name: Anonymous 2008-05-06 14:43

>>18
It also comes with Firefox 3 beta .

Name: Anonymous 2008-05-06 14:45

>>21
You mean it comes with the best fucking version of Firefox ever.

Name: Anonymous 2008-05-06 14:46

>>22
That happens to disable an average of 42,8571429% of an extension?

Name: Anonymous 2008-05-06 14:51

>>23
Maybe it disables them because they're incompatible, so the developers of the extensions should port them.

Name: Anonymous 2008-05-06 15:04

>>23
One word, Nightly Tester Tools.

Thread OVER.

Name: Anonymous 2008-05-06 15:11

Are you guys still using the legacy Firefox 2?  I have used Firefox 3 for the last two years.

Name: Anonymous 2008-05-06 15:19

>>26
You're still using Firefox 3? Get the mozilla-central Fx4 builds.

Name: Anonymous 2008-05-06 15:29

>>27
Yeah, I'm actually using the 04-04 Firefox beta ;__;

I should get myself a PKGBUILD that instead downloads the latest nightly tarball like I used to do, but first I'll have to make sure everything is put in /usr and not /opt.

Name: Anonymous 2008-05-07 5:26


int _ = 8==D ;
for (;_;)  {_--;  Bo(  );}

Name: Anonymous 2008-05-07 7:47

>>29

Don't run this code! It's obvious just by looking at it that it will hax your anus.

Name: Anonymous 2008-05-07 9:09


|\|\
|_ _\
|___/
| |     r  SIGH, it doesn't even compile
| |_____|


SIGH SIGHSIGHSIGH

Name: Anonymous 2008-05-07 9:12

how do I forkbomb in Haskell?

Name: Anonymous 2008-05-07 9:17

>>32
import Control.Concurrent

f = do a <- forkIO g
       b <- forkIO g
       putStrLn $ "f(): Forked a: " ++ (show a) ++ " and b: " ++ (show b)
       return ()

g = do a <- forkIO f
       b <- forkIO f
       putStrLn $ "g(): Forked a: " ++ (show a) ++ " and b: " ++ (show b)
       return ()


some dumbass submitted a bug: http://hackage.haskell.org/trac/ghc/ticket/1146

Name: Anonymous 2008-05-07 9:21

Isn't there a simpler way using system?

Name: Anonymous 2008-05-07 9:53

import Control.Concurrent
main = forkIO main >> forkIO main

Name: Anonymous 2008-05-07 11:15

print "Fuck you OP" || die();
print "HAX MY ANUS" && print "HAX MY ANUS";

VALID PERL CODE

Name: Anonymous 2008-05-08 18:43

>>36
He's right you know.

Name: Anonymous 2009-03-06 8:32

The device seeks not   to conquer the   human nor to   be conquered by.

Name: Anonymous 2011-02-27 11:10


> Test

Name: Anonymous 2011-02-27 11:13

> > > > Okay

Name: Anonymous 2011-02-27 11:13



>
>
> Okay

Name: Anonymous 2011-02-27 11:14








Okay

Name: Anonymous 2011-02-27 11:14


Test

Name: Anonymous 2011-02-27 11:15

:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:48 748c7c773bc63341711e734e49dab7ff
:1210062420 1298823288

>>17
<-- check my doubles

Name: Anonymous 2011-02-27 11:15



Test

Name: Anonymous 2011-02-27 11:21

> > > > > Test

Name: Anonymous 2011-02-27 11:21

> > > > Test

Name: Anonymous 2011-02-27 11:22

Test
Test
Test
Test

Name: Anonymous 2011-02-27 11:22

Test
Test
Test
Test

Name: Anonymous 2011-02-27 11:23

Test
Test
Test
Test

Name: Anonymous 2011-02-27 11:24

Test> > > Test> > > Test> > > Test

Name: Anonymous 2011-02-27 11:25

Test > > > Test > > > Test > > > Test

Name: Anonymous 2011-02-27 11:42

> > > > > > > > > > >  
Oh my.

Name: Anonymous 2011-02-27 12:25

Test </span>

Name: Anonymous 2011-02-27 12:25

:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:48 f4ba707282cb2a7da2b0fb566f05b26e
:1210062420 1298827536

>>25
<-- check my doubles

Name: Anonymous 2011-02-27 12:30

Name: Anonymous 2011-02-27 12:34

Test

Name: Anonymous 2011-02-27 12:36


Test!

Name: Anonymous 2011-02-27 12:37

Try2

Name: Anonymous 2011-02-27 12:48

Test

Name: Anonymous 2011-02-27 12:51

Test
Test

Name: Anonymous 2011-02-27 12:52

Test

Name: Anonymous 2011-02-27 13:06

The thingAbout
These quotes

Name: Anonymous 2011-02-27 13:07

The thing
About
These quotes

Name: Anonymous 2011-02-27 13:34

The thing
About
These quotes

Name: Anonymous 2011-02-27 13:34

:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:48 03afdcc6134cf2bd3734500dca6c3c0d
:1210062420 1298831645

>>28
<-- check my doubles

Name: Anonymous 2011-02-27 13:35

The thing
About
These quotes

Name: Anonymous 2011-02-27 13:40

The thing
About
These quotes

Name: Anonymous 2011-02-27 13:42

The thing
About
These quotes

Name: Anonymous 2011-02-27 13:44

The thing
About
These quotes

Name: Anonymous 2011-02-27 13:44

The thing
About
These quotes

Name: Anonymous 2011-02-27 14:05

1
2
3



Name: Anonymous 2011-02-27 14:32

1
2
3

Name: Anonymous 2011-02-27 14:36

1
2
3

Name: Anonymous 2011-02-27 14:40

1
2
3

Name: Anonymous 2011-02-27 15:50

1
2

3

Name: Anonymous 2011-02-27 15:51

:GJS1M 67dcbdbce4a0b67c4b48e86a6ae29205a95e4b83024a9d947213d1231800e8d9
:66 2a03a48087b1fc79c033c5868dfb074b
:1210062420 1298839863

>>73
<-- that's cool and all, but check 'em

Name: Anonymous 2011-02-27 15:53

Understanding
the damn
line-break.

Name: Anonymous 2011-02-27 15:55

Damn
this
line-break.

Name: Anonymous 2011-02-27 16:01

123
4
5
6

Name: Sgt.Kabukiman퀫ᯪ 2012-05-23 5:16

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

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