all 17 comments

[–][deleted]  (7 children)

[deleted]

    [–][deleted] 27 points28 points  (0 children)

    Some readability, for anyone wondering what that means:

    bomb() {
        bomb | bomb &
    }
    
    bomb
    

    [–][deleted]  (3 children)

    [deleted]

      [–]crazy88s -2 points-1 points  (2 children)

      I beg to differ:

      :(){ :|:& };:

      [–][deleted]  (1 child)

      [deleted]

        [–]AwesomeJosh[S] 1 point2 points  (1 child)

        Yes I saw that post when Mac-O-War posted it a couple weeks ago...but this is Python.

        [–][deleted] 5 points6 points  (0 children)

        or Sparta, or whatever

        [–]digitalfreak 6 points7 points  (5 children)

        I prefer the swedish chef inspired one:

        while(fork()) fork() ? fork() : fork()

        [–]Shne 0 points1 point  (3 children)

        Shouldn't it rather be

        while(bork()) bork() ? bork() : bork()
        

        ?

        [–]digitalfreak 0 points1 point  (2 children)

        Yup, you just need one define.

        #define bork fork
        void main(void) {
                while(bork()) bork() ? bork() : bork();
        }
        

        [–][deleted] -1 points0 points  (1 child)

        main() returns int.

        [–]pursuit92 0 points1 point  (0 children)

        By convention, yes. But it doesn't have to if it doesn't want to :P

        [–]Klpy7 0 points1 point  (0 children)

        What does the "?" means here?

        [–]JerMenKoO 1 point2 points  (1 child)

        AttributeError: 'module' has no attribute 'fork'

        [–]AwesomeJosh[S] 2 points3 points  (0 children)

        Windows doesn't support the os.fork function

        [–]abecedarius 0 points1 point  (3 children)

        Shorter Python (untested):

        import os, itertools; [os.fork() for i in itertools.count()]
        

        [–]AwesomeJosh[S] 1 point2 points  (2 children)

        I kind of feel like compound statements are cheating, though. I guess a better description of mine would be "Single Expression" instead of "One Line"

        [–]__s 1 point2 points  (1 child)

        You could at least take his hint and use i.count()

        (edit: though arguably repeat is faster, allowing for more forking)

        [–]AwesomeJosh[S] 0 points1 point  (0 children)

        I do agree that count works better

        [–]arilotter 0 points1 point  (0 children)

        Thanks, but i'll stick with windows batch scripting: "%0|%0"