Hi
after using D1 and Tango for couple of years we decided to experiment
with D2 and Phobos in a small scale project. For some reason the mostly
flat package hierarchy seemed rather confusing.
For instance, it took two of us 15 minutes to build a program that reads
a line from user, converts t
retard Wrote:
> Hi
>
> after using D1 and Tango for couple of years we decided to experiment
> with D2 and Phobos in a small scale project. For some reason the mostly
> flat package hierarchy seemed rather confusing.
>
> For instance, it took two of us 15 minutes to build a program that reads
retard wrote:
Hi
after using D1 and Tango for couple of years we decided to experiment
with D2 and Phobos in a small scale project. For some reason the mostly
flat package hierarchy seemed rather confusing.
For instance, it took two of us 15 minutes to build a program that reads
a line from
On Sun, Nov 29, 2009 at 07:12:50PM +, retard wrote:
> after using D1 and Tango for couple of years we decided to experiment
> with D2 and Phobos in a small scale project. For some reason the mostly
> flat package hierarchy seemed rather confusing.
Are you familiar with C's standard library?
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
> Walter and I discussed quite a few times the possibility of defining
> std.all that publically imports all of std. My experiments show that a
> short script importing std.all will compile slower, but not too slow,
> compa
Sun, 29 Nov 2009 14:36:24 -0500, Jason House wrote:
> retard Wrote:
>
>> Hi
>>
>> after using D1 and Tango for couple of years we decided to experiment
>> with D2 and Phobos in a small scale project. For some reason the mostly
>> flat package hierarchy seemed rather confusing.
>>
>> For instanc
Sun, 29 Nov 2009 15:30:14 -0500, Adam D. Ruppe wrote:
> On Sun, Nov 29, 2009 at 07:12:50PM +, retard wrote:
>> after using D1 and Tango for couple of years we decided to experiment
>> with D2 and Phobos in a small scale project. For some reason the mostly
>> flat package hierarchy seemed rathe
Sun, 29 Nov 2009 20:26:07 +, dsimcha wrote:
> == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s
> article
>> Walter and I discussed quite a few times the possibility of defining
>> std.all that publically imports all of std. My experiments show that a
>> short script importin
== Quote from retard (r...@tard.com.invalid)'s article
> Sun, 29 Nov 2009 20:26:07 +, dsimcha wrote:
> > == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s
> > article
> >> Walter and I discussed quite a few times the possibility of defining
> >> std.all that publically imports
dsimcha wrote:
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
Walter and I discussed quite a few times the possibility of defining
std.all that publically imports all of std. My experiments show that a
short script importing std.all will compile slower, but not too s
"retard" wrote in message
news:heuh3h$o7...@digitalmars.com...
> Hi
>
> after using D1 and Tango for couple of years we decided to experiment
> with D2 and Phobos in a small scale project. For some reason the mostly
> flat package hierarchy seemed rather confusing.
>
> For instance, it took two o
== Quote from Nick Sabalausky (a...@a.a)'s article
> "retard" wrote in message
> news:heuh3h$o7...@digitalmars.com...
> > Hi
> >
> > after using D1 and Tango for couple of years we decided to experiment
> > with D2 and Phobos in a small scale project. For some reason the mostly
> > flat package hi
== Quote from retard (r...@tard.com.invalid)'s article
> Hi
> after using D1 and Tango for couple of years we decided to experiment
> with D2 and Phobos in a small scale project. For some reason the mostly
> flat package hierarchy seemed rather confusing.
> For instance, it took two of us 15 minute
Mon, 30 Nov 2009 04:51:19 +, dsimcha wrote:
> == Quote from Nick Sabalausky (a...@a.a)'s article
>> "retard" wrote in message
>> news:heuh3h$o7...@digitalmars.com...
>> > Hi
>> >
>> > after using D1 and Tango for couple of years we decided to experiment
>> > with D2 and Phobos in a small scal
Mon, 30 Nov 2009 04:55:29 +, dsimcha wrote:
> == Quote from retard (r...@tard.com.invalid)'s article
>> Hi
>> after using D1 and Tango for couple of years we decided to experiment
>> with D2 and Phobos in a small scale project. For some reason the mostly
>> flat package hierarchy seemed rather
On Nov 30, 09 14:02, retard wrote:
Mon, 30 Nov 2009 04:51:19 +, dsimcha wrote:
== Quote from Nick Sabalausky (a...@a.a)'s article
"retard" wrote in message
news:heuh3h$o7...@digitalmars.com...
Hi
after using D1 and Tango for couple of years we decided to experiment
with D2 and Phobos in
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant. How would you like it to be?
Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant. How would you l
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
> KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
>>>
>>> foreach (line; new Lines!(char) (new File ("foobar.txt")))
>>>Cout (line).newline;
>>>
On Nov 30, 09 19:01, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant
Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
> On Nov 30, 09 19:01, Ary Borenszweig wrote:
>> KennyTM~ wrote:
> By
> far the two most important pieces of I/O functionality I need are:
>
> 1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("fo
"retard" wrote in message
news:hevn56$2to...@digitalmars.com...
> Mon, 30 Nov 2009 04:51:19 +, dsimcha wrote:
>>
>> Yeah, I dislike Tango's (and Java's) I/O design. I think it's a classic
>> example of overengineering. I don't care how efficient, flexible,
>> complete, etc. it is if it does
"retard" wrote in message
news:hevo45$2to...@digitalmars.com...
> Mon, 30 Nov 2009 04:55:29 +, dsimcha wrote:
>
> Well, they have been teaching the Java i/o stuff to first year students
> for a while now. I completely agree that it's a bit too complicated for
> novices, but it's not the only
retard wrote:
Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
On Nov 30, 09 19:01, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt"))) Cout
retard wrote:
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck??
On Mon, 30 Nov 2009 18:25:41 +0300, Andrei Alexandrescu
wrote:
retard wrote:
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (
== Quote from retard (r...@tard.com.invalid)'s article
> Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
> > On Nov 30, 09 19:01, Ary Borenszweig wrote:
> >> KennyTM~ wrote:
> > By
> > far the two most important pieces of I/O functionality I need are:
> >
> > 1. Read a text file li
== Quote from dsimcha (dsim...@yahoo.com)'s article
> == Quote from retard (r...@tard.com.invalid)'s article
> > Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
> > > On Nov 30, 09 19:01, Ary Borenszweig wrote:
> > >> KennyTM~ wrote:
> > > By
> > > far the two most important pieces of I/O
Denis Koroskin wrote:
On Mon, 30 Nov 2009 18:25:41 +0300, Andrei Alexandrescu
wrote:
retard wrote:
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (li
retard Wrote:
> Java isn't that bad IMO - you just have to remember the buffer:
>
> BufferedReader input = new BufferedReader(new FileReader("foo"));
> try {
> String line = null;
>
> while (( line = input.readLine()) != null) {
> }
> }
> finally {
> input.close();
> }
One of the importa
== Quote from Roman Ivanov (isro...@km.ru)'s article
> retard Wrote:
> > Java isn't that bad IMO - you just have to remember the buffer:
> >
> > BufferedReader input = new BufferedReader(new FileReader("foo"));
> > try {
> > String line = null;
> >
> > while (( line = input.readLine()) != null)
Lars T. Kyllingstad, el 30 de noviembre a las 12:16 me escribiste:
> Ary Borenszweig wrote:
> >KennyTM~ wrote:
> By
> far the two most important pieces of I/O functionality I need are:
>
> 1. Read a text file line-by-line.
> >>>
> >>>foreach (line; new Lines!(char) (new File ("foo
Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant. How would you l
Pelle MÃ¥nsson:
> foreach (line; open("foobar.txt")) {
>writeln(line);
> }
With the xio module of my dlibs:
import d.xio: xfile;
foreach (line; xfile("foobar.txt"))
putr(line);
xfile is optimized to reduce memory rellocations as much as possible in the
most common case of about 90 char
bearophile wrote:
Pelle MÃ¥nsson:
foreach (line; open("foobar.txt")) {
writeln(line);
}
With the xio module of my dlibs:
import d.xio: xfile;
foreach (line; xfile("foobar.txt"))
putr(line);
xfile is optimized to reduce memory rellocations as much as possible in the
most common case
Andrei Alexandrescu:
> Why not just reuse the same buffer as the previous line? That approach
> is inherently adaptive.
That approach is unsafe. xfile yields byte strings, in D1. When I write 10
lines long scripts I usually don't need every bit of optimization, I need the
less bug-prone code as
bearophile wrote:
Andrei Alexandrescu:
Why not just reuse the same buffer as the previous line? That approach
is inherently adaptive.
That approach is unsafe. xfile yields byte strings, in D1. When I write 10
lines long scripts I usually don't need every bit of optimization, I need the
less
On Tue, 01 Dec 2009 15:22:23 +0300, Pelle Månsson
wrote:
bearophile wrote:
Andrei Alexandrescu:
Why not just reuse the same buffer as the previous line? That approach
is inherently adaptive.
That approach is unsafe. xfile yields byte strings, in D1. When I
write 10 lines long scripts I
Denis Koroskin wrote:
On Tue, 01 Dec 2009 15:22:23 +0300, Pelle Månsson
wrote:
bearophile wrote:
Andrei Alexandrescu:
Why not just reuse the same buffer as the previous line? That
approach is inherently adaptive.
That approach is unsafe. xfile yields byte strings, in D1. When I
write 10 l
Pelle Månsson wrote:
> File looks like a constructor. You are not constructing a file you open
> for reading.
"open" by itself is ambiguous. What are you opening? A window? A
network port? I think the word "file" needs to be in there somewhere to
disambiguate.
--
Rainer Deyke - rain...@eldw
On 30.11.2009 7:02, retard wrote:
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
To be fair, it's a bit simpler than that in Tango:
foreach (line; new TextFileInput("foobar.txt"))
Cout (line).newline;
}
2. Read a whole file into an array of bytes.
Rainer Deyke:
> "open" by itself is ambiguous. What are you opening? A window? A
> network port? I think the word "file" needs to be in there somewhere to
> disambiguate.
When you program in Python you remember that open is a built-in function to
open files :-)
When you want to open other thi
Tue, 01 Dec 2009 18:58:25 -0500, bearophile wrote:
> Rainer Deyke:
>> "open" by itself is ambiguous. What are you opening? A window? A
>> network port? I think the word "file" needs to be in there somewhere
>> to disambiguate.
>
> When you program in Python you remember that open is a built-i
retard wrote:
Tue, 01 Dec 2009 18:58:25 -0500, bearophile wrote:
Rainer Deyke:
"open" by itself is ambiguous. What are you opening? A window? A
network port? I think the word "file" needs to be in there somewhere
to disambiguate.
When you program in Python you remember that open is a buil
Rainer Deyke wrote:
Pelle Månsson wrote:
File looks like a constructor. You are not constructing a file you open
for reading.
"open" by itself is ambiguous. What are you opening? A window? A
network port? I think the word "file" needs to be in there somewhere to
disambiguate.
Something l
retard wrote:
Namespaces in general seem rather useful. I hate the php like 'there's a
flat global scope and everything is a free function approach'. It's
annoying me each time I use phobos.
If you have the same name declared in multiple imports, you cannot refer
to it without qualification (
Wed, 02 Dec 2009 08:38:29 +0100, Pelle Månsson wrote:
> retard wrote:
>> Tue, 01 Dec 2009 18:58:25 -0500, bearophile wrote:
>>
>>> Rainer Deyke:
"open" by itself is ambiguous. What are you opening? A window? A
network port? I think the word "file" needs to be in there somewhere
retard wrote:
Wed, 02 Dec 2009 08:38:29 +0100, Pelle Månsson wrote:
retard wrote:
Tue, 01 Dec 2009 18:58:25 -0500, bearophile wrote:
Rainer Deyke:
"open" by itself is ambiguous. What are you opening? A window? A
network port? I think the word "file" needs to be in there somewhere
to dis
Pelle Månsson wrote:
> Rainer Deyke wrote:
>> "open" by itself is ambiguous. What are you opening? A window? A
>> network port? I think the word "file" needs to be in there somewhere to
>> disambiguate.
>>
>>
> Something like new BufferedReader(new FileReader("foo.txt"))? It's quite
> unambiguo
retard:
> Also IIRC Python has built-in print() command. What if I want to
> redefine this to mean printing to a graphical quake like game console.
In Python3 there is a built-in print function, that is a reference to a
callable object. So you just need to redefine it, like this:
def print(...)
Rainer Deyke wrote:
Pelle Månsson wrote:
Rainer Deyke wrote:
"open" by itself is ambiguous. What are you opening? A window? A
network port? I think the word "file" needs to be in there somewhere to
disambiguate.
Something like new BufferedReader(new FileReader("foo.txt"))? It's quite
una
retard wrote:
Mon, 30 Nov 2009 04:51:19 +, dsimcha wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
2. Read a whole file into an array of b
52 matches
Mail list logo