-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat:Code Organization #25
Feat:Code Organization #25
Conversation
I didn't bother with the |
Yes, I agree it's ultra niche and not imprtant. It can be shown in the context of a For that, one might contrast
Something should show that assembly level attributes get attached to a (Will review in a bit) |
Syntax/Grammar/Wording Co-authored-by: Ruben Bartelink <[email protected]>
Syntax/Grammar/Wording Co-authored-by: Ruben Bartelink <[email protected]>
Syntax/Grammar/Wording Co-authored-by: Ruben Bartelink <[email protected]>
Syntax/Grammar/Wording Co-authored-by: Ruben Bartelink <[email protected]>
Syntax/Grammar/Wording Co-authored-by: Ruben Bartelink <[email protected]>
Syntax/Grammar/Wording Co-authored-by: Ruben Bartelink <[email protected]>
…Organization wording tweaks
@@ -122,9 +123,6 @@ The `let` keyword also defines named functions. | |||
let square x = x * x | |||
let print x = printfn "The number is: %d" x | |||
|
|||
let squareNegateThenPrint x = |
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.
needs to mvoe to L129
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.
Sorry, I'm not understanding this comment. Here is lines 127 to 131:
127 Pipe operator `|>` is used to chain functions and arguments together. Double-backtick identifiers are handy to improve readability especially in unit testing:
128
129 let ``square, negate, then print`` x =
130 x |> square |> negate |> print
131
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.
was saying that there is/was print (square (negate x))
, then print x |> square |> negate
, then print >> square >> negate
And one of the fns has '
(prime) naming as it was the second.
if you remove the very first one, then the motivaiton for the second is lost
so prob best to move it down and work it into that section
(and consider the flow onward to showing it with >>
)
|
||
### Namespaces | ||
Namespaces are simply dotted names that prefix other program elements to allow for further hierarchical organization. | ||
All `type` and `module` elements that follow a `namespace` declaration will require an [`open`](#CodeOrganization_OpenAndAutoOpen) or to be dotted-into to access. |
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.
that follow -> within ?
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.
"following in the file" ?
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.
demarcated by :D
I wanted to allude to a namespace
being a grouping construct that things logically within the scope of
And pave the way for saying "and if you use namespace
again, then it's an entirely separated new scope with nothing carried over"
I guess module and namespace have that aspect in common
|
||
module rec MyNamespace.MonkeyDomain | ||
|
||
exception DoNotSqueezeBananaException of Banana // `Banana` has not been defined yet, and would fail without `rec` |
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.
this is a valid example, but very esoteric
I'd say most common usage of rec
is people saying "well for this file, I just want to list everything alphabetically, regardless of the fact that it's normally good to put low level stuff first and then have the hihger level stuff at the bottom, with some exceptions where you use and
to put some irrelevant dependencies underneath"
So while this does illustrate what it does and how to use it, I dont think it conveys what it's for really, so am pretty conflicted.
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.
I stole this from MS Learn. I kind of hate it too. The long names get in the way of what's being demonstrated as well.
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.
I took a walk and realized I'm conflicted because I hate exceptions. :)
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.
whereas I think it should have a link to https://eiriktsarpalis.wordpress.com/2017/02/19/youre-better-off-using-exceptions/ and https://fsharpforfunandprofit.com/posts/against-railway-oriented-programming/ :P
Appears, I was hasty on that merge button. Will review this morning. |
Attempt at Code Organization section.