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

<> operator

Name: Anonymous 2007-07-14 8:37 ID:DWRQwZU8

discuss

Name: Anonymous 2007-07-14 8:40 ID:DWRQwZU8

forced:
  indentation:
    of
    code

Name: Anonymous 2007-07-14 8:55 ID:Heaven

>>2
thead(over);

Name: Anonymous 2007-07-14 9:22 ID:39ZQsd/3

>>1-3
Wtf is wrong with you? Why would you do this to your own thread

Name: Anonymous 2007-07-14 9:54 ID:UFLFWkXQ


(<=>) :: (Ord a) => a -> a -> Bool
x <=> y | x > y = True
        | x == y = True
        | x < y = True

Also forced indentation of code.

Name: Anonymous 2007-07-14 10:53 ID:+wgZb7hK

>>5
_ <=> _ = True

Name: Anonymous 2007-07-14 11:11 ID:UFLFWkXQ

>>6
No, (<=>) is less than, equal to or more than.  It reduces to True only if one of these conditions is met, otherwise to False.  It obviously isn't irrefutable.

Name: Anonymous 2007-07-14 11:45 ID:CDlk9FEe

>>6

Not if you compare a normal floating point number with NaN

Name: Anonymous 2007-07-14 11:54 ID:Heaven

go do something useful fags

Name: Anonymous 2007-07-14 11:55 ID:Nf1D+OuX

Shit Compared To !=

Name: Anonymous 2007-07-14 12:07 ID:UFLFWkXQ

>>8
Stfu n00b.
Prelude> 32.3 <=> ((30932022.0^23209320323340920432)/(30932022.0^23209320323340920432))
True

Name: Anonymous 2007-07-14 12:51 ID:CDlk9FEe

>>11
(<=>) :: (Ord a) => a -> a -> Bool
x <=> y | x > y = True
        | x == y = True
        | x < y = True
    | otherwise = False


Prelude> 42 <=> (0/0)
False

Name: Anonymous 2007-07-14 12:54 ID:CDlk9FEe

(0/0) <=> (0/0)
[spoiler]False[/spoiler]

Name: Anonymous 2007-07-14 12:54 ID:CDlk9FEe

>>13

I AM NOT EXPERT BBCODER :-(

Name: Anonymous 2007-07-14 13:18 ID:wla4wQr3

You guys are not Enlightened enough:
a <=> b = flip any [(<), (==), (>)] (\ f -> f a b)

Unfortunately I haven't been able to make it pointless yet.

Name: Anonymous 2007-07-14 13:25 ID:Heaven

>>15

This whole thread is fucking pointless

Name: Anonymous 2007-07-14 13:38 ID:Heaven

>>16

This whole board is fucking pointless

Name: Anonymous 2007-07-14 13:57 ID:+wgZb7hK

PROTIP: if you expect that your numbar could end up being NaN, you should use the Maybe or Either functors for proper error propagation. Haskell has an expressive type system, USE IT!

Name: Anonymous 2007-07-14 14:05 ID:M5sZfgow

>>18
Enjoy ur combinatorial explosion

Name: Anonymous 2007-07-14 14:20 ID:+wgZb7hK

>>19
I do...

Name: Anonymous 2007-07-14 18:01 ID:bRkjpLKc

<> is actually the colist coconstructor. Fags.

Name: Anonymous 2007-07-14 19:02 ID:GB18ftCv

>>1
Stfu, I am a Champion Programmer.

Name: Anonymous 2007-07-14 19:17 ID:bKhuOjTz

im reading a perl book and it used <> in a while loop saying its the standard input stream found in $_ and this provides alot of functionality found in unix via pipelines. I really have no idea what I'm doing..

Name: Anonymous 2007-07-14 19:29 ID:CtP90whJ

>>23

while(<>) {
    # blah...
}

Will read from STDIN until an EOF

Perl is great. For a programming assignment where I needed to read a bunch of comma-delimited records from a text file, sort the info in numerous ways and output statistics (averages, sums, etc) of various parts of the data, I wrote the whole thing without using a single variable name, only using the implied variables everywhere. Pretty funny for a program that was over 500 lines long.

I got an A for it since the teacher guessed I knew more about Perl than the rest of the class already. Indeed, everyone else was struggling with the concept of passing parameters to a function... There were many facepalm.jpg's in that course.

That was about 6 years ago, ah the memories.

Name: Anonymous 2007-07-14 23:01 ID:Heaven

Pretty funny for a program that was over 500 lines long.
500 lines in perl? you're awful

I got an A for it since the teacher guessed I knew more about Perl than the rest of the class already.
He really gave you an A instead of bashing you for writing such stupid shit? whoa. College teachers these days..

lastly, while(<>) will not read until EOF, get your faqts str8.

Name: Anonymous 2007-07-15 4:22 ID:1WPwFajJ

>>25
>while(<>) will not read until EOF, get your faqts str8.

Please learn to spell words correctly.

Also, please learn Perl.

>500 lines in perl? you're awful

Certainly not the longest Perl program ever written, and certainly not the best, but a working one.

>He really gave you an A instead of bashing you for writing such stupid shit? whoa. College teachers these days..

She knew I knew Perl from looking at other work I was doing at the time, apart from the assignments. I was creating a CMS in Perl for fun. I'd also implemented several board games as well.

I don't code Perl anymore, though. The syntax is really not to my liking. It does have it's uses, though.

Name: Anonymous 2007-07-16 3:58 ID:tF4avQN+

<> is one of the nasty things of Perl

Name: Anonymous 2007-07-16 4:12 ID:UKB+M8DG

>>27
Fine, then don't use it.
foreach $file (@ARGV) {
    open(VAGINA, $file) || die("$file: $!\n");
    while (!eof(VAGINA)) {
        $_ = readline(VAGINA);
        # manipulate $_
    }
    close(VAGINA);
}

Name: Anonymous 2007-07-16 5:02 ID:Heaven

>>28
fail

foreach $file (@ARGV) {
        die $! unless open(VAGINA, $file);
        print readline(VAGINA) until eof(VAGINA);
        close(VAGINA);
}


and i don't even know perl.

Name: Anonymous 2007-07-16 5:03 ID:Heaven

>>29
a bit smaller

foreach $file (@ARGV) {
        die $! unless open(VAGINA, $file);
        print readline(VAGINA) until eof(VAGINA) and close(VAGINA);
}

Name: Anonymous 2007-07-16 6:27 ID:tF4avQN+

>>28
But people WILL use it.

>>28-30
This is why Perl is a bad language.

Name: Anonymous 2007-07-16 6:29 ID:sQV8tmYZ

How much better would C++ be with an <> operator?
Rhetorical question, don't answer.

Name: Anonymous 2007-07-16 6:33 ID:tF4avQN+

How much C++ would a C++ <> <> if a C++ <> could <> C++?

Name: Anonymous 2007-07-16 6:38 ID:uGpZCECw

How much wood would a C++ chuck if a C++ could chuck wood?

Name: Anonymous 2007-07-16 8:43 ID:+NGzHFzO

>>30
a bit smaller

do{ open VAGINA, $_ or die $!; print <VAGINA> and close $_} for @ARGV

Name: Anonymous 2007-07-16 8:59 ID:tF4avQN+

>>35
This is why you don't use Perl for anything serious

Name: Anonymous 2007-07-16 9:20 ID:aIAYZEwE

Small vagina

Name: Anonymous 2007-07-16 9:24 ID:Heaven

Name: Anonymous 2007-07-16 9:37 ID:Heaven

>>35
Bah! It has a bug.

Name: Anonymous 2007-07-16 9:48 ID:aIAYZEwE

Centipedes? In my vagina?

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