-
Notifications
You must be signed in to change notification settings - Fork 10
WIP: Add file writing and reading #55
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
Conversation
|
|
||
| [<StringEnum>] | ||
| type OpenTextModeUpdating = | ||
| type OpenTextMode = |
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.
So @dbrattli here I did something ugly. I tried to get the OpenTextMode union working with its different open modes but I could only get it working by adding the read, write and update to the same union context. What would you recommend to do here?
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.
@MMagueta Yes this looks like the right thing to do 👍
| result |> equal () | ||
|
|
||
| [<Fact>] | ||
| let ``test write works`` () = |
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 still need to fix this test, don't take it for granted
|
The other way would be to fix the union to be: [<Erase>]
type OpenTextMode =
| OpenTextModeUpdating of OpenTextModeUpdating
| OpenTextModeWriting of OpenTextModeWriting
| OpenTextModeReading of OpenTextModeReadingthen you can do: let result = builtins.``open``(StringPath "test.txt", OpenTextModeWriting OpenTextModeWriting.Write)But it feels a bit verbose, so I think it's OK to collapse them as you suggest. The inspiration for the code is btw: |
It might be an error I induced, but that was the first thing I tried and the compilation wasn't quite right. Are we supporting nested union structures? I noticed that a lot of the class features in F# aren't being translated, so I thought it might be a wip. |
|
Closing because of #58 |
No description provided.