It is possible to declare a list or an array without the separating semicolons by declaring each element on a separate line. Like this:
let favoriteBreeds = [ "Antwerp" "Carneaux" "Swiss Mondaine" ] //Array let favoriteBreedsArray = [| "Antwerp" "Carneaux" "Swiss Mondaine" |]
Note: for reasons I confess are unclear to me, the first member of the list/array must be on the next line from the opening symbol of the collection. Well, to be precise (this is software development after all) this is true of arrays–the same is not true of lists. But since putting the first element of the array on the next line works in both cases, it’s simplest just to do it this way.
EDIT: Per Dave Thomas, you can put the first element of the collection on the same line as the opening symbol; you just need to insure that you align all of the other elements, DIRECTLY beneath the first element, as in this code gist which Dave put up.
Personally I consider it’s easier to simply stick to the convention of always putting the first element on the next line so you don’t have to worry that much about the alignment but this does work.
Pingback: F# Weekly #41, 2013 | Sergey Tihon's Blog