On Tue, 15 May 2012 19:43:05 -0400, Sean Kelly s...@invisibleduck.org
wrote:
One thing I'd like in a buffered input API is a way to perform
transactional reads such that if the full read can't be performed, the
read state remains unchanged. The best you can do with most APIs is to
check
On Mon, 14 May 2012 22:56:08 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/14/2012 8:02 AM, Steven Schveighoffer wrote:
I keep trying to avoid talking about this, because I'm writing a
replacement
library for std.stream, and I don't want to step on any toes while it's
still
On 5/15/2012 4:43 PM, Sean Kelly wrote:
One thing I'd like in a buffered input API is a way to perform transactional
reads such that if the full read can't be performed, the read state remains
unchanged. The best you can do with most APIs is to check for a desired
length, but what I'd I don't
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with binary data some data can't be read with ranges (when
you need to read small chunks of varying size),
I don't see why that should be true.
Steven Schveighoffer , dans le message (digitalmars.D:167548), a
My new design supports this. I have a function called readUntil:
https://github.com/schveiguy/phobos/blob/new-io2/std/io.d#L832
Essentially, it reads into its buffer until the condition is satisfied.
Therefore, you are
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with binary data some data can't be read with
ranges (when
you need to read small chunks of varying size),
I don't see why that should be
On May 16, 2012, at 6:52 AM, Walter Bright newshou...@digitalmars.com wrote:
On 5/15/2012 4:43 PM, Sean Kelly wrote:
One thing I'd like in a buffered input API is a way to perform transactional
reads such that if the full read can't be performed, the read state remains
unchanged. The best you
On Wed, 16 May 2012 10:03:42 -0400, Christophe Travert
trav...@phare.normalesup.org wrote:
Steven Schveighoffer , dans le message (digitalmars.D:167548), a
My new design supports this. I have a function called readUntil:
https://github.com/schveiguy/phobos/blob/new-io2/std/io.d#L832
On 16/05/2012 15:38, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with binary data some data can't be read with
ranges (when
you need to read small chunks of
On Wed, 16 May 2012 11:19:46 -0400, Robert Clipsham
rob...@octarineparrot.com wrote:
On 16/05/2012 15:38, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with
On 16.05.2012 19:32, Steven Schveighoffer wrote:
On Wed, 16 May 2012 11:19:46 -0400, Robert Clipsham
rob...@octarineparrot.com wrote:
On 16/05/2012 15:38, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/15/2012 3:34 PM,
On Wed, 16 May 2012 11:48:32 -0400, Dmitry Olshansky
dmitry.o...@gmail.com wrote:
On 16.05.2012 19:32, Steven Schveighoffer wrote:
On Wed, 16 May 2012 11:19:46 -0400, Robert Clipsham
rob...@octarineparrot.com wrote:
A bit ugly but:
// Default to 4 byte chunks
auto range =
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright newshou...@digitalmars.com
wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with binary data some data can't be read with ranges (when
you need to read small chunks of
On 5/16/2012 7:49 AM, Sean Kelly wrote:
On May 16, 2012, at 6:52 AM, Walter Brightnewshou...@digitalmars.com
wrote:
On 5/15/2012 4:43 PM, Sean Kelly wrote:
One thing I'd like in a buffered input API is a way to perform
transactional reads such that if the full read can't be performed, the
On 16/05/2012 16:59, Walter Bright wrote:
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright newshou...@digitalmars.com
wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with binary data some data can't be read with ranges
On Wed, May 16, 2012 at 05:41:49PM +0100, Stewart Gordon wrote:
On 16/05/2012 16:59, Walter Bright wrote:
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright
newshou...@digitalmars.com
wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do
On Wed, 16 May 2012 11:59:37 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright
newshou...@digitalmars.com
wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with
On 5/16/2012 9:41 AM, Stewart Gordon wrote:
On 16/05/2012 16:59, Walter Bright wrote:
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright newshou...@digitalmars.com
wrote:
On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with
On 5/16/2012 10:18 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 11:59:37 -0400, Walter Bright newshou...@digitalmars.com
wrote:
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright newshou...@digitalmars.com
wrote:
On 5/15/2012 3:34 PM,
On Wed, 16 May 2012 13:21:37 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/16/2012 9:41 AM, Stewart Gordon wrote:
On 16/05/2012 16:59, Walter Bright wrote:
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright
On Wed, 16 May 2012 13:23:07 -0400, Walter Bright
newshou...@digitalmars.com wrote:
On 5/16/2012 10:18 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 11:59:37 -0400, Walter Bright
newshou...@digitalmars.com
wrote:
On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012
On 5/16/12 12:34 PM, Steven Schveighoffer wrote:
In other words, ranges aren't enough.
This is copiously clear to me, but the way I like to think about it is
by extending the notion of range (with notions such as e.g.
BufferedRange, LookaheadRange, and such) instead of developing an
tbh, I've found byChunk to be less than worthless
in my experience; it's a liability because I still
have to wrap it somehow to real real world files.
Consider reading a series of strings in the format
lengthdata,[...].
I'd like it to be this simple (neglecting priming the loop):
string[] s;
On Wed, 16 May 2012 13:48:49 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 5/16/12 12:34 PM, Steven Schveighoffer wrote:
In other words, ranges aren't enough.
This is copiously clear to me, but the way I like to think about it is
by extending the notion of range
On Wednesday, 16 May 2012 at 17:48:52 UTC, Andrei Alexandrescu
wrote:
This is copiously clear to me, but the way I like to think
about it is by extending the notion of range (with notions such
as e.g. BufferedRange, LookaheadRange, and such)
I tried this in cgi.d somewhat recently. It ended
On Wed, May 16, 2012 at 12:48:49PM -0500, Andrei Alexandrescu wrote:
On 5/16/12 12:34 PM, Steven Schveighoffer wrote:
In other words, ranges aren't enough.
This is copiously clear to me, but the way I like to think about it
is by extending the notion of range (with notions such as e.g.
On Wed, 16 May 2012 15:38:02 -0400, H. S. Teoh hst...@quickfur.ath.cx
wrote:
On Wed, May 16, 2012 at 12:48:49PM -0500, Andrei Alexandrescu wrote:
On 5/16/12 12:34 PM, Steven Schveighoffer wrote:
In other words, ranges aren't enough.
This is copiously clear to me, but the way I like to think
On 05/16/12 21:38, H. S. Teoh wrote:
On Wed, May 16, 2012 at 12:48:49PM -0500, Andrei Alexandrescu wrote:
On 5/16/12 12:34 PM, Steven Schveighoffer wrote:
In other words, ranges aren't enough.
This is copiously clear to me, but the way I like to think about it
is by extending the notion of
One direction that _could_ be helpful, perhaps, is to extend
the concept
of range to include, let's tentatively call it, a ChunkedRange.
Basically a ChunkedRange implements the usual InputRange
operations
(empty, front, popfront) but adds the following new primitives:
- bool hasAtLeast(R)(R
On Wed, 16 May 2012 16:30:43 -0400, H. S. Teoh hst...@quickfur.ath.cx
wrote:
On Wed, May 16, 2012 at 04:15:22PM -0400, Steven Schveighoffer wrote:
On Wed, 16 May 2012 15:38:02 -0400, H. S. Teoh
hst...@quickfur.ath.cx wrote:
[...]
One direction that _could_ be helpful, perhaps, is to extend
On Wed, 16 May 2012 16:38:54 -0400, Artur Skawina art.08...@gmail.com
wrote:
On 05/16/12 22:15, Steven Schveighoffer wrote:
I still don't get the need to add this to ranges. The streaming API
works fine on its own.
This is not an argument against a streaming API (at least not for me),
On 5/16/12 1:00 PM, Steven Schveighoffer wrote:
What I think we would end up with is a streaming API with range
primitives tacked on.
- empty is clunky, but possible to implement. However, it may become
invalid (think of reading a file that is being appended to by another
process).
- popFront
On Wed, May 16, 2012 at 04:52:09PM -0400, Steven Schveighoffer wrote:
On Wed, 16 May 2012 16:30:43 -0400, H. S. Teoh
hst...@quickfur.ath.cx wrote:
On Wed, May 16, 2012 at 04:15:22PM -0400, Steven Schveighoffer wrote:
On Wed, 16 May 2012 15:38:02 -0400, H. S. Teoh
hst...@quickfur.ath.cx
On 05/16/12 22:58, Steven Schveighoffer wrote:
On Wed, 16 May 2012 16:38:54 -0400, Artur Skawina art.08...@gmail.com wrote:
On 05/16/12 22:15, Steven Schveighoffer wrote:
I still don't get the need to add this to ranges. The streaming API
works fine on its own.
This is not an argument
On 05/16/2012 11:08 PM, Andrei Alexandrescu wrote:
On 5/16/12 1:00 PM, Steven Schveighoffer wrote:
What I think we would end up with is a streaming API with range
primitives tacked on.
- empty is clunky, but possible to implement. However, it may become
invalid (think of reading a file that is
On 5/16/12 4:40 PM, Timon Gehr wrote:
On 05/16/2012 11:08 PM, Andrei Alexandrescu wrote:
On 5/16/12 1:00 PM, Steven Schveighoffer wrote:
What I think we would end up with is a streaming API with range
primitives tacked on.
- empty is clunky, but possible to implement. However, it may become
On 16/05/2012 18:21, Walter Bright wrote:
snip
You can have that range read from byChunk(). It's really the same thing that
C's stdio does.
And what if I want it to work on ranges that don't have a byChunk method?
Stewart.
On 16/05/2012 17:48, H. S. Teoh wrote:
On Wed, May 16, 2012 at 05:41:49PM +0100, Stewart Gordon wrote:
snip
Why would anybody want to read a large binary file _one byte at a
time_?
[...]
import std.range;
byte[] readNBytes(R)(R range, size_t n)
if (isInputRange!R hasSlicing!R)
{
On 5/14/2012 9:54 PM, H. S. Teoh wrote:
On Mon, May 14, 2012 at 07:57:28PM -0700, Walter Bright wrote:
On 5/14/2012 6:29 PM, Alex Rønne Petersen wrote:
While we're at it, do we want to keep std.outbuffer?
Since it's not range based, probably not.
Why not just fold this into std.io?
It's
On 15.05.2012 8:54, H. S. Teoh wrote:
On Mon, May 14, 2012 at 07:57:28PM -0700, Walter Bright wrote:
On 5/14/2012 6:29 PM, Alex Rønne Petersen wrote:
While we're at it, do we want to keep std.outbuffer?
Since it's not range based, probably not.
Why not just fold this into std.io? I'm
On Tuesday, 15 May 2012 at 02:56:20 UTC, Walter Bright wrote:
On 5/14/2012 8:02 AM, Steven Schveighoffer wrote:
I keep trying to avoid talking about this, because I'm writing
a replacement
library for std.stream, and I don't want to step on any toes
while it's still
not accepted.
But I have
On Tuesday, 15 May 2012 at 15:22:03 UTC, Lars T. Kyllingstad
wrote:
On Tuesday, 15 May 2012 at 02:56:20 UTC, Walter Bright wrote:
On 5/14/2012 8:02 AM, Steven Schveighoffer wrote:
I keep trying to avoid talking about this, because I'm
writing a replacement
library for std.stream, and I don't
On Sunday, 13 May 2012 at 22:26:17 UTC, Walter Bright wrote:
On 5/13/2012 3:16 PM, Nathan M. Swan wrote:
Trying to make it read lazily is even harder, as all std.utf
functions work on
arrays, not ranges. I think this should change.
Yes, std.utf should be upgraded to present range interfaces.
On Monday, 14 May 2012 at 15:02:11 UTC, Steven Schveighoffer
wrote:
In other words, a stream of bytes, not a good range (who wants
to get one byte at a time?). A stream of UTF text broken into
lines, a very good range.
There are several cases where one would want one byte at the
time; e.g.
On May 15, 2012, at 3:34 PM, Nathan M. Swan nathanms...@gmail.com wrote:
On Monday, 14 May 2012 at 15:02:11 UTC, Steven Schveighoffer wrote:
In other words, a stream of bytes, not a good range (who wants to get one
byte at a time?). A stream of UTF text broken into lines, a very good range.
On Tue, May 15, 2012 at 04:43:05PM -0700, Sean Kelly wrote:
[...]
One thing I'd like in a buffered input API is a way to perform
transactional reads such that if the full read can't be performed, the
read state remains unchanged. The best you can do with most APIs is to
check for a desired
On 5/13/12, Kiith-Sa 4...@theanswer.com wrote:
My D:YAML library (YAML parser) depends on std.stream
Also ae.xml depends on it.
From the other thread
On 13/05/2012 21:58, Walter Bright wrote:
On 5/13/2012 1:48 PM, Stewart Gordon wrote:
On 13/05/2012 20:42, Walter Bright wrote:
snip
I'd like to see std.stream dumped. I don't see any reason for it
to exist that std.stdio doesn't do (or should do).
So
On Sun, 13 May 2012 17:38:23 -0400, Walter Bright
newshou...@digitalmars.com wrote:
This discussion started in the thread Getting the const-correctness of
Object sorted once and for all, but it deserved its own thread.
These modules suffer from the following problems:
1. poor
On 13-05-2012 23:38, Walter Bright wrote:
This discussion started in the thread Getting the const-correctness of
Object sorted once and for all, but it deserved its own thread.
These modules suffer from the following problems:
1. poor documentation, dearth of examples rationale
2. toHash(),
On 5/13/2012 10:22 PM, Oleg Kuporosov wrote:
unfortunatelly std.stdio under Windows couldn't handle UTF16(wchar)-based file
names and text IO which are naturel there. The root of issues looks in both
underlying DMC C-stdio (something wrong with w* based functions?) and std.format
which provides
On 5/14/2012 4:43 AM, Stewart Gordon wrote:
If I'm writing a library to read a binary file format, I want to allow the data
to come from a file, a socket or a memory image. The stream API makes this
straightforward. But it seems some work is needed before std.stdio and the range
API are up to
On 5/14/2012 6:29 PM, Alex Rønne Petersen wrote:
While we're at it, do we want to keep std.outbuffer?
Since it's not range based, probably not.
On 5/14/2012 8:02 AM, Steven Schveighoffer wrote:
I keep trying to avoid talking about this, because I'm writing a replacement
library for std.stream, and I don't want to step on any toes while it's still
not accepted.
But I have to say, ranges are *not* a good interface for generic data
On Mon, May 14, 2012 at 07:57:28PM -0700, Walter Bright wrote:
On 5/14/2012 6:29 PM, Alex Rønne Petersen wrote:
While we're at it, do we want to keep std.outbuffer?
Since it's not range based, probably not.
Why not just fold this into std.io? I'm surprised that this is a
separate module,
On 13-05-2012 23:38, Walter Bright wrote:
This discussion started in the thread Getting the const-correctness of
Object sorted once and for all, but it deserved its own thread.
These modules suffer from the following problems:
1. poor documentation, dearth of examples rationale
2. toHash(),
This discussion started in the thread Getting the const-correctness of Object
sorted once and for all, but it deserved its own thread.
These modules suffer from the following problems:
1. poor documentation, dearth of examples rationale
2. toHash(), toString(), etc., all need to be const
On Sunday, 13 May 2012 at 21:39:07 UTC, Walter Bright wrote:
4. they should present a range interface, not a streaming one
I was just about to make a post suggesting that! You could easily
integrate std.io with std.algorithm to do some pretty cool things.
NMS
On Sunday, May 13, 2012 14:38:23 Walter Bright wrote:
This discussion started in the thread Getting the const-correctness of
Object sorted once and for all, but it deserved its own thread.
These modules suffer from the following problems:
1. poor documentation, dearth of examples
On Sunday, 13 May 2012 at 21:39:07 UTC, Walter Bright wrote:
This discussion started in the thread Getting the
const-correctness of Object sorted once and for all, but it
deserved its own thread.
These modules suffer from the following problems:
1. poor documentation, dearth of examples
On 5/13/2012 3:16 PM, Nathan M. Swan wrote:
Trying to make it read lazily is even harder, as all std.utf functions work on
arrays, not ranges. I think this should change.
Yes, std.utf should be upgraded to present range interfaces.
On Sun, May 13, 2012 at 02:38:23PM -0700, Walter Bright wrote:
This discussion started in the thread Getting the const-correctness
of Object sorted once and for all, but it deserved its own thread.
These modules suffer from the following problems:
1. poor documentation, dearth of examples
On 13/05/2012 22:38, Walter Bright wrote:
This discussion started in the thread Getting the const-correctness of
Object sorted once and for all, but it deserved its own thread.
These modules suffer from the following problems:
1. poor documentation, dearth of examples rationale
2. toHash(),
On Sunday, 13 May 2012 at 21:39:07 UTC, Walter Bright wrote:
3. overlapping functionality with std.stdio
unfortunatelly std.stdio under Windows couldn't handle
UTF16(wchar)-based file names and text IO which are naturel
there. The root of issues looks in both underlying DMC C-stdio
64 matches
Mail list logo