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

Suck it

Name: Anonymous 2007-08-09 15:23 ID:wDfRb0TX

fac n = foldr (*) 1 (take n [1..])

Suck it

Name: Anonymous 2007-08-09 15:24 ID:q4viz/A4

fac u

Name: Anonymous 2007-08-09 15:25 ID:Heaven

Cute. But doesn't memoize!

Name: Anonymous 2007-08-09 15:36 ID:pDl+4U+8

>>3
DRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

The compiler does.

Name: Anonymous 2007-08-09 15:38 ID:wDfRb0TX

3 fails.

Name: Anonymous 2007-08-09 16:20 ID:Wp8AcJA1

>>1
  YOU
FUCKING
S U C K


fac = product . enumFromTo 1

Name: Anonymous 2007-08-09 18:10 ID:Heaven

>>6
When you're too EXPERT PROGRAMMER to do:
fac n = product [1..n]

Name: Anonymous 2007-08-09 18:30 ID:AKgIEBvD

>>7
Point-free style is superior

Name: Anonymous 2007-08-09 19:11 ID:wWgruhbF

fac = product [1..]

Name: Anonymous 2007-08-09 19:19 ID:HUEWYzmh

Prelude> let fac = product [1..]
Prelude> fac 4

<interactive>:1:0:
    Couldn't match `Integer' against `t -> t1'
      Expected type: Integer
      Inferred type: t -> t1
    Probable cause: `fac' is applied to too many arguments in the call (fac 4)
    In the definition of `it': it = fac 4
Prelude>


Phail.

Name: Anonymous 2007-08-09 19:29 ID:AKgIEBvD

>>9
OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER
GODFUCKIGNDAMN
FIRST OF ALL, YOU DONT FUQIN KNOW WHAT A MAN PAGE IS
SECONDLY, THIS IS /prog/ DO NOT DEMAND USEFUL ANSWERS THE WAY YOU WANT THEM TO BE
THIRDLY PROGRAMMING IS ALL ABOUT PHILOSOPHY AND ``ABSTRACT BULLSHITE'' THAT YOU WILL NEVER COMPREHEND
AND FUQIN LASTLY, FUCK OFF WITH YOUR BULLSHYT
EVERYTHING HAS ALREADY BEEN ANSWERED IN
>>6,7,8

Name: Anonymous 2007-08-09 19:52 ID:Heaven

(define (fac n)
  (apply * (range 1 n)))

Name: Anonymous 2007-08-09 22:29 ID:wWgruhbF

>>10
lool idiot

>>11
hahahahah

>>12
WAT?????

Name: Anonymous 2007-08-09 22:39 ID:aNT+HqN1

>>12
Is apply some kind of fold? (I don't know Lisp yet)

>>13
Sorry, but you're the idiot. The function you posted doesn't take any arguments and will just attempt to calculate the product of the infinite list [1..]. Did you think any given parameter would somehow magically be injected as a right bound into the syntactic sugar? You clearly don't have a very good understanding of eta reduction.

Name: Anonymous 2007-08-09 23:10 ID:wWgruhbF

>>14
1) its called BETA reduction faggot
2) POINTLESS FUNCTIONS IN POINTLESS STYLE
3) Haskell is lazy, discussion over
4) NO U!
5) I invented the [sup] and [sub] tags, you are ETERNALLY IN DEBT TO ME.

Name: Anonymous 2007-08-09 23:11 ID:Heaven

>>14
OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER
GODFUCKIGNDAMN
FIRST OF ALL, YOU DONT FUQIN KNOW WHAT A MAN PAGE IS
SECONDLY, THIS IS /prog/ DO NOT DEMAND USEFUL ANSWERS THE WAY YOU WANT THEM TO BE
THIRDLY PROGRAMMING IS ALL ABOUT PHILOSOPHY AND ``ABSTRACT BULLSHITE'' THAT YOU WILL NEVER COMPREHEND
AND FUQIN LASTLY, FUCK OFF WITH YOUR BULLSHYT
EVERYTHING HAS ALREADY BEEN ANSWERED IN >>15

Name: Anonymous 2007-08-09 23:15 ID:/fqA7NlS

>>15,16
Potentially the same person, proceed with caution.

Name: Anonymous 2007-08-09 23:19 ID:wWgruhbF

>>17
Oh, that could be true

You are a giant faggot

Name: Anonymous 2007-08-09 23:30 ID:Heaven

: fac ( n -- n! ) [ 1+ ] map product ;

Name: Anonymous 2007-08-09 23:32 ID:BS5bcu77

>>14
no, not really. apply receives a function and a list, then makes the list the arguments of the function. So (apply * '(1 2 3)) is equivalent to (* 1 2 3). range n m returns a list (n n+1 ... m). so we get (* n n+1 n+2 ... m). * takes multiple arguments. actually, I'm not sure (*) returns 1, so this does not handle the base case correctly. other options are (reduce * 1 lst), reduce being equal to fold, or consing a 1. this makes it more or less equivalent to the haskell version, since product is probably something like product = foldr (*) 1

Name: Anonymous 2007-08-09 23:38 ID:JuIjVnEO

: fac ( n -- n! ) 1+ 1 tail product ;

Name: Anonymous 2007-08-10 0:00 ID:6UxIbwif

>>15
1) BETA REDUCTION IS FUNCTION APPLICATION, THIS IS NOT WHAT I AM TALKING ABOUT
2) POINTFREE STYLE IS ELEGANT AND YOU ARE MADE OF FAIL
3) LAZINESS HAS NOTHING TO DO WITH THIS. PRODUCT WILL FAIL TO TERMINATE WHEN GIVEN AN INFINITE LIST
4) NEIN DU
5) SUP AND SUB HAVE BEEN (AB)USED ON DQN FOR MONTHS ALREADY

GET THE FUCK OUT

Name: Anonymous 2007-08-10 1:11 ID:zu0/65CA

(((ok bitch)
  (
you asked for it)
  (
here goes))
 (
im taking out the fucking
     (
bold paranthesis on you))
 (
you fuqing angered an expert programmer)
 (
ive been here for (expt 3 88888000) years longer than you)
 (
ive read sicp twice)
 (
i know every programming language in the world
    including apl
)
 (
if u wanna batl (lets do it))
 (
ill crush you like a bean))

Name: Anonymous 2007-08-10 1:26 ID:em4J9rOF

fac = foldr (*) . enumFromTo 1

Name: Anonymous 2007-08-10 1:59 ID:PPrnF8K7

it's
fac n = product [1..n]
you haskell niggers.

Name: Anonymous 2007-08-10 2:01 ID:xrQSvt5E


[b]([/b][b]([/b][b]([/b]ok bitch[b])[/b]
  [b]([/b]you asked for it[b])[/b]
  [b]([/b]here goes[b])[/b][b])[/b]
 [b]([/b]im taking out the fucking
     [b]([/b]bold paranthesis on you[b])[/b][b])[/b]
 [b]([/b]you fuqing angered an expert programmer[b])[/b]
 [b]([/b]ive been here for [b]([/b]expt 3 88888000[b])[/b] years longer than you[b])[/b]
 [b]([/b]ive read sicp twice[b])[/b]
 [b]([/b]i know every programming language in the world
    including apl[b])[/b]
 [b]([/b]if u wanna batl [b]([/b]lets do it[b])[/b][b])[/b]
 [b]([/b]ill crush you like a bean[b])[/b][b])[/b]

Name: Anonymous 2007-08-10 2:02 ID:xrQSvt5E

(((ok bitch)
  (you asked for it)
  (here goes))
 (im taking out the fucking
     (bold paranthesis on you))
 (you fuqing angered an expert programmer)
 (ive been here for (expt 3 88888000) years longer than you)
 (ive read sicp twice)
 (i know every programming language in the world
    including apl)
 (if u wanna batl (lets do it))
 (ill crush you like a bean))

Name: Anonymous 2007-08-10 2:02 ID:xrQSvt5E


[b]([/b][b]([/b][b]([/b]ok bitch[b])[/b]
  [b]([/b]you asked for it[b])[/b]
  [b]([/b]here goes[b])[/b][b])[/b]
 [b]([/b]im taking out the fucking
     [b]([/b]bold paranthesis on you[b])[/b][b])[/b]
 [b]([/b]you fuqing angered an expert programmer[b])[/b]
 [b]([/b]ive been here for [b]([/b]expt 3 88888000[b])[/b] years longer than you[b])[/b]
 [b]([/b]ive read sicp twice[b])[/b]
 [b]([/b]i know every programming language in the world
    including apl[b])[/b]
 [b]([/b]if u wanna batl [b]([/b]lets do it[b])[/b][b])[/b]
 [b]([/b]ill crush you like a bean[b])[/b][b])[/b]

Name: Anonymous 2007-08-10 2:18 ID:zu0/65CA

>>26
>>27
>>28
LOLx3
M-m-m-m-m-m-mega fail

Name: Anonymous 2007-08-10 2:25 ID:xrQSvt5E

Can someone tlel me how to bold text inside [code] tags

Name: Anonymous 2007-08-10 2:27 ID:Heaven

>>30
By not FAILING.

Name: Anonymous 2007-08-10 2:34 ID:xrQSvt5E

tes[b]t[/b]

Name: Anonymous 2007-08-10 2:51 ID:zu0/65CA

>>30
haha if you can't work it yourself PLEASE GTFO

Name: Anonymous 2007-08-10 4:07 ID:zu0/65CA

>>30
>Can someone tlel me how to bold text inside [code] tags
>someone tlel me
>tlel
>T L E L

Name: Anonymous 2007-08-10 4:07 ID:zu0/65CA

>>30
Can someone tlel me how to bold text inside [code] tags
someone tlel me
tlel
T L E L

Name: Anonymous 2007-08-10 4:16 ID:Heaven

>>34
>Can someone tlel me how to bold text inside [code] tags
>Can someone tlel me
>Can
[b]>[/b]

Name: Anonymous 2007-08-10 4:32 ID:dbzfBUqK



[b]>([/b]display "hello"[b]>)[/b]

Name: Anonymous 2007-08-10 4:47 ID:zu0/65CA

>

Name: Anonymous 2007-08-10 4:47 ID:zu0/65CA

>>38
HAH!

Name: Anonymous 2007-08-10 6:11 ID:Heaven

This thread is now BBCode testing grounds.
>(display "hello">)

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