-
Notifications
You must be signed in to change notification settings - Fork 106
Conversation
Simplified example
|
@KevinRansom @ReedCopsey can you take a look? The sample is used in Arrays (F#) and Array.concat<'T> Function (F#). I believe tweaks to the sample will also require tweaks to docs to mention the output outside the code sample. |
| let multiplicationTable max = seq { for i in 1 .. max -> [| for j in 1 .. max -> (i, j, i*j) |] } | ||
| printfn "%A" (Array.concat (multiplicationTable 3)) No newline at end of file | ||
| Array.concat [ [|0..3|] ; [|4|] ] | ||
| //output [|0; 1; 2; 3; 4|] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output should be placed in the doc instead of the code sample. I've included the links to the docs that reference this sample in the PR conversation thread.
|
@dend The code is correct, but yes, the output should be included in the pages if you want to take this. That being said, the previous code wasn't wrong in any sense - and in some ways, shows this off just as well as this simplified sample. I do think that having this twice, in the same code block, would be incorrect. you'd need to include the printfn calls on both lines, which means the output would also be 2x as long. @Indy9000 Perhaps this should be: // Builds new array from list of arrays
printfn "%A" (Array.concat [ [|0..3|] ; [| 4 |] ])
// Builds new array from array of arrays
printfn "%A" (Array.concat [| [|0..3|] ; [| 4 |] |])With the output block being: |
|
|
|
@Indy9000 I too agree with 1. - I was just pointing out that it wasn't "wrong" before as much as "more complex than necessary" - however, using a sequence does show that it works with anything, so in that one respect, it's nice. WRT 2. - I'd actually agree, if the rest of the docs were that way, but I think it needs to fit the format of all of the other docs, which have the results in a separate block. |
|
Before we start modifying all docs to a different convention, let's follow the existing structure regarding the output. |
|
@Indy9000 could you please move the output in the doc itself to make sure that we follow the doc guidelines? That way I can merge this PR. |
Simplified example