-
Notifications
You must be signed in to change notification settings - Fork 344
Conversation
cc @pakrym (not Pranav) |
I just moved ISlicable to Experimental package and changed the tests to use an adapter. A long term solution would mean ReadOnlyBytes implementing ISlicable, but for now I want to merge this PR to remove ReadOnlyBytes completly. @pakrym, are you ok with this merge? |
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.
Get rid of the commenter our code
} | ||
} | ||
} | ||
//// Copyright (c) Microsoft. All rights reserved. |
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.
Why is this commented out?
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.
@davidfowl, Sarah Faraphallower said it wasn't required...
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.
Won't immediately say I disagree either, my 3 Sat and CRT/JMT logic tables work without it....
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.
@davidfowl, something went very wrong with the merge. I really don't understand how the tests passed. Anyway, I meant to delete this whole file, and I will shortly.
@dotnet-bot test Innerloop Ubuntu16.04 Debug Build and Test |
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.
Not sure why there's a conflict but this LGTM
14ecc71
to
3c7d83f
Compare
@dotnet-bot test Innerloop Ubuntu16.04 Release Build and Test |
<edit>
I just moved ISlicable to Experimental package and changed the tests to use an adapter. A long term solution would mean ReadOnlyBytes implementing ISlicable, but for now I want to merge this PR to remove ReadOnlyBytes
</edit>
This PR shows what it would take to remove ReadOnlyBytes and still support TryReadUntil on BufferReader. TryReadUntill reads till some delimiter and then returns the bytes read. The difference between TryReadUntill and all the other "read" methods we already support is that its result is not fixed-size, i.e. the result is ReadOnlyBytes itself. Other read methods return ints, floats, datetimes, etc.
To summarize:
ISlicable<T>
interface. If BufferReader wraps a type implementing ISlicable, the reader would support TryReadUntil; otherwise TryReadUntil would not be available (the extension constraint would not be fulfilled).It works, but I wish it all was simpler.
cc: @pakrym , @davidfowl, @joshfree, @terrajobst, @halter73, @ahsonkhan
BTW, I assume/assert we must support something like TryReadUntil on the reader, i.e. our abstractions are not shippable if we cannot make it work.
Other alternatives we explored (and my commentary on them):
Any other ideas?