View mode: basic / threaded / horizontal-split · Log in · Help
April 07, 2009
Re: The new, new phobos sneak preview
== Quote from Andrei Alexandrescu (SeeWebsiteForEmail@erdani.org)'s article
> Hi everybody,
> I just committed all of Phobos into svn on dsource.org. That is not an
> official release and has known and unknown bugs, limitations, and
> rhinodemons. I expect some ripples before we stabilize, but when we will
> we'll stabilize at a higher potential.

Two things that had been discussed on this NG that I noticed are conspicuously
absent:  eager(), which converts a lazy range to an array, and range-oriented
streams.  Are these still in the works?
April 07, 2009
Re: The new, new phobos sneak preview
dsimcha wrote:
> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail@erdani.org)'s article
>> Hi everybody,
>> I just committed all of Phobos into svn on dsource.org. That is not an
>> official release and has known and unknown bugs, limitations, and
>> rhinodemons. I expect some ripples before we stabilize, but when we will
>> we'll stabilize at a higher potential.
> 
> Two things that had been discussed on this NG that I noticed are conspicuously
> absent:  eager(), which converts a lazy range to an array, and range-oriented
> streams.  Are these still in the works?

Good questions. I forgot about eager(), and would like to think a bit 
more about the range-oriented streams.

Andrei
April 07, 2009
Re: The new, new phobos sneak preview
Hello Ellery,

> BCS wrote:
> 
>> Reply to Andrei,
>> 
>>> auto a = slurp!(int, double)("filename", "%s, %s");
>>> 
>>> Each line in the file looks like e.g. "1, 2.3". slurp returns an
>>> array of Tuple!(int, double) with the parsed content.
>>> 
>> It would be nice to have a version that would slurp into pre defined
>> structs.
>> 
>> struct S{ int i; double d }
>> 
>> S[] a = slurp!(S)("filename", "%s, %s");
>> 
> And maybe a burp that spits a tuple back into a file?
> 

I seconds the name!
April 07, 2009
Re: The new, new phobos sneak preview
Denis Koroskin wrote:
> On Tue, 07 Apr 2009 03:34:37 +0400, Alan Knowles <alan@akbkhome.com> wrote:
> 
>> Really Sweet,
>>
>> Any chance of fixing one of my pet peeves of std.stream
>> writeLine() - using platform dependant line endings
>>
>> Almost all the socket work I've done with this has made it a rather 
>> annoying pointless method (as it's totally non-portable).  perhaps 
>> implementing
>> writeCR() writeLF() writeCRLF(), then letting writeLine call them, 
>> dependant on which platform would be better?
>>
> 
> write(text, '\r');
> write(text, '\n');
I normally end up doing
writeString(text ~ "\r\n");

as the polymorphism of write is a blessing and a curse, I've had a few 
really annoying bugs  occur by sending the wrong type to write()...

hence writeCRLF - etc. seemed alot clearer

> 
>> I guess in-line comments in the manual are a bit outside your scope at 
>> present.
>>
>> Anyway great work.
>> Regards
>> Alan
>>
>>
> 
>
April 07, 2009
Re: The new, new phobos sneak preview
BCS wrote:
> Hello Ellery,
> 
>> BCS wrote:
>>
>>> Reply to Andrei,
>>>
>>>> auto a = slurp!(int, double)("filename", "%s, %s");
>>>>
>>>> Each line in the file looks like e.g. "1, 2.3". slurp returns an
>>>> array of Tuple!(int, double) with the parsed content.
>>>>
>>> It would be nice to have a version that would slurp into pre defined
>>> structs.
>>>
>>> struct S{ int i; double d }
>>>
>>> S[] a = slurp!(S)("filename", "%s, %s");
>>>
>> And maybe a burp that spits a tuple back into a file?
>>
> 
> I seconds the name!
> 
> 

I wonder what fart and sniff would do. :o|

On a more (well, only slightly) serious note, the name slurp() is taken 
from perl (google perl slurp), and incidentally burp is around there too.


Andrei
April 07, 2009
Re: The new, new phobos sneak preview
On 2009-04-06 18:29:50 -0400, Andrei Alexandrescu 
<SeeWebsiteForEmail@erdani.org> said:

> for (auto copy = range[]; !copy.empty; copy.popFront)
> {
>      auto e = copy.front;
>      body
> }

Perhaps it's a little off topic, but...

Wouldn't it be better if the language was made so that evaluating an 
array as a bool would yeild false when empty and true when not? This 
would avoid forcing the !empty double negation at many places like this 
one.

	while (range) range.popFront;

instead of

	while (!range.empty) range.popFront;

and

	for (auto copy = range[]; copy; copy.popFront)

instead of

	for (auto copy = range[]; !copy.empty; copy.popFront)

-- 
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/
April 07, 2009
Re: The new, new phobos sneak preview
This is looking very impressive, will you be covering some of these concepts 
and idioms used in phobos in your upcoming TDPL?

This url returns a 404:

http://www.erdani.dreamhosters.com/d/web/phobos/std_patterns.html
April 07, 2009
Re: The new, new phobos sneak preview
Lutger wrote:
> This is looking very impressive, will you be covering some of these concepts 
> and idioms used in phobos in your upcoming TDPL?
> 
> This url returns a 404:
> 
> http://www.erdani.dreamhosters.com/d/web/phobos/std_patterns.html

Sorry, that module is not meant to be visible yet.

Andrei
April 07, 2009
Re: The new, new phobos sneak preview
Mon, 06 Apr 2009 14:23:20 -0700, Andrei Alexandrescu wrote:

> I just committed all of Phobos into svn on dsource.org. That is not an
> official release and has known and unknown bugs, limitations, and
> rhinodemons. I expect some ripples before we stabilize, but when we will
> we'll stabilize at a higher potential.

Looks scary, but great. :D

-----

* There are two std.regexp and no std.regex in the package list
* std.range.advance docs mention 'drop' instead of 'advance'
* std.range.retreatN docs metnion 'advanceRight' instead of 'retreatN'
April 08, 2009
Re: The new, new phobos sneak preview
Andrei Alexandrescu wrote:

> I just committed all of Phobos into svn on dsource.org. That is not an
> official release and has known and unknown bugs, limitations, and
> rhinodemons. I expect some ripples before we stabilize, but when we will
> we'll stabilize at a higher potential.

Will the final release support "osx" [sic] and "freebsd" too,
or is the new Phobos going to be "Windows" and "linux" only ?

> If you want to build Phobos yourself, check out the Makefile (not
> linux.mak; that won't work). That GNU Makefile, hosted on Linux, can
> build the Linux lib and also the Windows lib by using wine. (I'm very
> happy about this; now I can test on Windows and Linux without switching
> more than a command line tweak.)

For instance, things like these look a bit hardcoded to linux:
EXTRA_MODULES_posix = $(addprefix std/c/linux/, linux socket)

--anders
1 2 3 4 5 6
Top | Discussion index | About this forum | D home