F# record list expressions

时间:2015-05-08 10:02:29

标签: list f# expression record

Hello my question is about list expressions in F#. I try to create a record that will be stored in a list. I want the parse error: Invalid numeric literal at line 1, column 5 parse error: Invalid numeric literal at line 1, column 5 parse error: Invalid numeric literal at line 1, column 5 parse error: Invalid numeric literal at line 1, column 5 Start: 00:23:13 End: 00:28:40 Duration: 00:05:27 record inside the //epc record to update from 1-9. To clear out what I mean it's like when you write Point and get: Square. Here I want the let example = [1 .. 1 .. 9] in the val example : int list = [1; 2; 3; 4; 5; 6; 7; 8; 9] record to change from Point and get all 9 Squares with the Points Square to pos = {x=1; y=1}.

x=1; y=1

I've tried the code above, I've also tried.

x=9; y=9

I then get a error message that it doesn't support the type Point = {x : int; y : int} type Square = {pos : Point; side : int; X : int} //A square got a position, a side length and a value let defaultSquare = { pos = {x=1; y=1}; side = 10; X = 0 } let spelplan = [{defaultSquare with pos = {x=1; y=1}} .. {defaultSquare with pos = {x=9; y=9}}] operator.

I've already read this and this

0 个答案:

没有答案