digitalmars.D - mmfile cleanup
- Ben Hinkle (7/7) Dec 02 2004 Since Matthew seems to be busy, I'd like to send Walter an updated
- Matthew (6/13) Dec 02 2004 there
- Ben Hinkle (14/32) Dec 03 2004 ok - thanks for MmFile, by the way. Looking at the code again I see I ne...
- Matthew (15/47) Dec 03 2004 Just a thought, but I never liked the name MmFile. I hate contractions.
-
Carlos Santander B.
(18/18)
Dec 03 2004
"Ben Hinkle"
escribi� en el mensaje - Ben Hinkle (20/38) Dec 03 2004 Also
Since Matthew seems to be busy, I'd like to send Walter an updated std.mmfile. I'd like to remove the "auto" from the class declaration. Also I'll change the old-style opIndex(i,val) to opIndexAssign(i,val). Are there any other changes to mmfile that people would like to see? I'll also uncomment the code in std.stream that wraps an MmFile with a stream interface. -Ben
Dec 02 2004
Since Matthew seems to be busy,Just found out it's one more week. (It's always _one more week_ ...)I'd like to send Walter an updated std.mmfile. I'd like to remove the "auto" from the class declaration.AlsoI'll change the old-style opIndex(i,val) to opIndexAssign(i,val). Arethereany other changes to mmfile that people would like to see?All of the above are fine by me.I'll also uncomment the code in std.stream that wraps an MmFile with a stream interface.Don't have enough info to comment, but sounds sensible, as long as they're not unreasonable coupled to each other as a consequence
Dec 02 2004
Matthew wrote:ok - thanks for MmFile, by the way. Looking at the code again I see I need to fix a bug in the stream interface if the MmFile isn't writeable. Currectnly MmFile doesn't store the mode so another change to MmFile would be to store the mode flag the user requested so that the stream class can figure out if the MmFile is writable. The mode flag would be a read-only property of type MmFile.Mode. Oh yeah, another change is to make the module name std.mmfile instead of just mmfile.Since Matthew seems to be busy,Just found out it's one more week. (It's always _one more week_ ...)I'd like to send Walter an updated std.mmfile. I'd like to remove the "auto" from the class declaration.AlsoI'll change the old-style opIndex(i,val) to opIndexAssign(i,val). Arethereany other changes to mmfile that people would like to see?All of the above are fine by me.There is a parametrized stream class that takes any type that acts like an array and wraps it in a stream. There already existed MemoryStream that wraps an honest-to-god array. The commented out code is to wrap MmFiles plus some unittests. -BenI'll also uncomment the code in std.stream that wraps an MmFile with a stream interface.Don't have enough info to comment, but sounds sensible, as long as they're not unreasonable coupled to each other as a consequence
Dec 03 2004
Just a thought, but I never liked the name MmFile. I hate contractions. How would people feel about it being the uncontracted MemoryMappedFile? "Ben Hinkle" <bhinkle4 juno.com> wrote in message news:coposn$1357$1 digitaldaemon.com...Matthew wrote:declaration.Since Matthew seems to be busy,Just found out it's one more week. (It's always _one more week_ ...)I'd like to send Walter an updated std.mmfile. I'd like to remove the "auto" from the classAreAlsoI'll change the old-style opIndex(i,val) to opIndexAssign(i,val).needthereok - thanks for MmFile, by the way. Looking at the code again I see Iany other changes to mmfile that people would like to see?All of the above are fine by me.to fix a bug in the stream interface if the MmFile isn't writeable. Currectnly MmFile doesn't store the mode so another change to MmFilewouldbe to store the mode flag the user requested so that the stream classcanfigure out if the MmFile is writable. The mode flag would be aread-onlyproperty of type MmFile.Mode. Oh yeah, another change is to make the module name std.mmfile insteadofjust mmfile.with aI'll also uncomment the code in std.stream that wraps an MmFilelike anThere is a parametrized stream class that takes any type that actsstream interface.Don't have enough info to comment, but sounds sensible, as long as they're not unreasonable coupled to each other as a consequencearray and wraps it in a stream. There already existed MemoryStreamthatwraps an honest-to-god array. The commented out code is to wrapMmFilesplus some unittests. -Ben
Dec 03 2004
"Ben Hinkle" <bhinkle mathworks.com> escribi� en el mensaje news:conaiv$fd6$1 digitaldaemon.com... | Since Matthew seems to be busy, I'd like to send Walter an updated | std.mmfile. I'd like to remove the "auto" from the class declaration. Also | I'll change the old-style opIndex(i,val) to opIndexAssign(i,val). Are there | any other changes to mmfile that people would like to see? | | I'll also uncomment the code in std.stream that wraps an MmFile with a | stream interface. | | -Ben | | What I would really like would be seeing only one of OutBuffer, MemoryStream and MmFile. Which one, I don't know. Surely derived from std.stream.Stream, but that doesn't mean it has to be MemoryStream. ----------------------- Carlos Santander Bernal
Dec 03 2004
"Carlos Santander B." <csantander619 gmail.com> wrote in message news:coqkgg$2ddd$2 digitaldaemon.com..."Ben Hinkle" <bhinkle mathworks.com> escribi� en el mensaje news:conaiv$fd6$1 digitaldaemon.com... | Since Matthew seems to be busy, I'd like to send Walter an updated | std.mmfile. I'd like to remove the "auto" from the class declaration.Also| I'll change the old-style opIndex(i,val) to opIndexAssign(i,val). Arethere| any other changes to mmfile that people would like to see? | | I'll also uncomment the code in std.stream that wraps an MmFile with a | stream interface. | | -Ben | | What I would really like would be seeing only one of OutBuffer,MemoryStream andMmFile. Which one, I don't know. Surely derived from std.stream.Stream,but thatdoesn't mean it has to be MemoryStream. ----------------------- Carlos Santander BernalMmFile is different enough from OB and MS that it can't be replaced with one of those but I can see your point that OB and MS are very similar and could be combined somehow. Scanning over the two it looks like the differences are: 1) OB is probably faster than MS 2) OB has alignment functions and spread 3) MS has read and seek support (OB mentions InBuffer in the help but I can't find any InBuffer) 4) MS subclasses Stream and so can be used in a generic Stream context. Hmm... Adding alignment and other stuff to MS would probably be pretty easy. The performance would be slightly worse, though. I have a feeling Walter wouldn't like seeing OB go away, but who knows. There is the question of backwards compatibility - though the outbuffer.d could consist of "alias MemoryStream OutBuffer".
Dec 03 2004