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

Pages: 1-

F# Question

Name: Anonymous 2013-07-29 2:38

From Microsoft's `tutorial' project that comes with VS:
/// Compute the highest-common-factor of two integers
let rec hcf a b =                       // notice: 2 parameters separated by spaces
    if a=0 then b
    elif a<b then hcf a (b-a)           // notice: 2 arguments separated by spaces
    else hcf (a-b) b
    // note: function arguments are usually space separated


Can this be taken to mean that function arguments are separated by spaces? Feels like I'm missing something.

Name: Anonymous 2013-07-29 2:50

Symta:
hcf A B =>
    if A is 0 then B
    else if A < B then hcf A B-A
    else hcf A-B B


F#:
let rec hcf a b =
    if a=0 then b
    elif a<b then hcf a (b-a)
    else hcf (a-b) b

Name: Anonymous 2013-07-29 2:51

>>2
Also, how does F# know that "a=0" means comparison, and not a declaration of "a" being a function returning 0?

Name: Anonymous 2013-07-29 2:58

>>2
nikita you are a homosexual.

Name: Anonymous 2013-07-29 3:05

>>3
Probably the let statement, idiot.

Name: Anonymous 2013-07-29 3:30

>>4
No. I'm not.

>>5
how does let know, which "=" starts body? Why not...

let (rec hcf a b =
    if a)=0 then b
    elif a<b then hcf a (b-a)
    else hcf (a-b) b

Name: Anonymous 2013-07-29 3:32

hcf = (fst.) . curry (until ((==0) . snd) (uncurry (ap (,) . mod)))

Name: Anonymous 2013-07-29 4:00

>>6
'
>does not want to fuck natalie portman
>claims not to be a homosex

Name: Anonymous 2013-07-29 4:03

>>6
I guess it works because Microsoft employs better programmers than you.

Name: Anonymous 2013-07-29 5:33

>>9
better programmers
designing unintuitive language

/0

Name: Anonymous 2013-07-29 5:33

>>7
That is why I'm using Lisp

Name: Anonymous 2013-07-29 5:35

Thread reported.

Name: Anonymous 2013-07-29 5:36

I think this one is programming related mista >>12

Name: Anonymous 2013-07-29 5:52

>>13
Not everyone who reports threads is me. This thread is on-topic.

Name: Anonymous 2013-07-29 5:58

>>14
You are all one monster as far as I'm concerned.

Name: Anonymous 2013-07-29 6:28

>>13-15
Reported.

Name: Anonymous 2013-07-29 7:11

>>16
You can't report individual posts, copralite-tama.

Name: Anonymous 2013-07-29 8:55

>>17
Reported.

Name: Anonymous 2013-07-29 15:27

F# is going to replace Lisp and Haskell.

Name: Anonymous 2013-07-29 15:30

Your mom sleeping with every other guy on this planet is going to replace the meaning of the word whore.

Name: Anonymous 2013-07-30 1:21

[b]REPLACE MY ANUS![b]

Name: Anonymous 2013-07-30 7:50

>>19

The type system is not there yet. But there are some variants on F#, which looks really promising:

http://research.microsoft.com/en-us/projects/fstar/ is really interesting. Dependent type system, which gives the user the possibility to prove properties of your program. They have some monadic variant too.

They do a lot of research into functional programming. I think F# is simple a stepping stone to a more mature functional language. Just to let the general public get it's toes wet before plunging them into the sea.

They also are a driving force behind haskell.

But it won't be F# as it is at the moment. It will be something different, more advanced.

Name: Anonymous 2013-07-30 13:14

Reported. Do not discuss non-free languages which cannot be enjoyed cross-platform.

Name: Anonymous 2013-07-30 14:03

>>23

F# can be enjoyed cross platform.

Name: Anonymous 2013-07-30 14:27

>>8
LLLLLLLLLLLLLEEEEEEEEEEEEEEELLLLLLLLLLL E/G/IN /G/REENTEXT /G/ROSKI! FUCKING LE LEL XDDDDDDDDDDDDDDDDDDDDDDDDDD

Name: Anonymous 2013-07-30 14:40

>>25
'
Back to /g/ lelcunt

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