Converting a C# code to F#??

Posted by Brendon on Stack Overflow See other posts from Stack Overflow or by Brendon
Published on 2010-06-05T18:23:31Z Indexed on 2010/06/05 18:32 UTC
Read the original article Hit count: 194

Filed under:

Hello all

I am just a beginner in programing i wish covert some code from C# to F#,

I have encotered this code:

float[] v1=new float[10];

...

//Enqueue the Execute command. 
Queue.Execute(kernelVecSum, null, **new long[] { v1.Length }**, null, null);

I have previously ask how to convert the v1 object, I think i know how, But how do i use the function call especially the "new long[] { v1.Length }" part of the function argument, what does "new long[] { v1.Length }" mean??

I have created v1 like this "let v1 = [| for i in 1.0 .. 10.0 -> 2.0 * i |]"

Is it correct?? or should i use v1 like this "let v1 = ref [| for i in 1.0 .. 10.0 -> 2.0 * i |]" ???

© Stack Overflow or respective owner

Related posts about F#