My statistics library for D, dstats, has been updated to take advantage of the
concepts introduced in the new Phobos: http://dsource.org/projects/dstats .
It has also received several smaller miscellaneous updates:
1. Instead of being specific to arrays, all functions now accept the most
general
BCS wrote:
> Hello Christopher,
>
>> Nick Sabalausky wrote:
>>
>>> The absolute worst of all though is when an app (*cough* skype
>>> *cough*) decides that "close" and "the 'close' button" should mean
>>> "don't close anything at all, but minimize to tray instead". That
>>> should be a firing
Hello Christopher,
Nick Sabalausky wrote:
The absolute worst of all though is when an app (*cough* skype
*cough*) decides that "close" and "the 'close' button" should mean
"don't close anything at all, but minimize to tray instead". That
should be a firing squad offense ;)
I'd be killing my
On Thu, 23 Apr 2009 21:40:36 -0400, Christopher Wright wrote:
> Nick Sabalausky wrote:
>> "Steven Schveighoffer" wrote in message
>> news:op.usux6bskeav...@steves.networkengines.com...
>>> I was never a huge fan of application themes. I don't mind a theme
>>> for the whole system (as long as it'
Nick Sabalausky wrote:
"Steven Schveighoffer" wrote in message
news:op.usux6bskeav...@steves.networkengines.com...
I was never a huge fan of application themes. I don't mind a theme for
the whole system (as long as it's simple), but I don't want iTunes to look
different just because it can.
"Steven Schveighoffer" wrote in message
news:op.usux6bskeav...@steves.networkengines.com...
>
> I was never a huge fan of application themes. I don't mind a theme for
> the whole system (as long as it's simple), but I don't want iTunes to look
> different just because it can.
>
That's one of
On Thu, Apr 23, 2009 at 6:01 PM, Christopher Wright wrote:
> Andrei Alexandrescu wrote:
>>
>> Yes. The way it should be is not with sink, but with the standard output
>> iterator method put().
>>
>> void streamOut(T, R)(T object, R range)
>> {
>> foreach(x; a) range.put(x);
>> range.put(b);
Andrei Alexandrescu wrote:
Yes. The way it should be is not with sink, but with the standard output
iterator method put().
void streamOut(T, R)(T object, R range)
{
foreach(x; a) range.put(x);
range.put(b);
range.put(c);
}
// object.d
class Object
{
void streamOut(R)(R ran
On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede wrote:
Steven Schveighoffer wrote:
On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede
wrote:
(OT: an excellent example of this It's Done Because We Noticed We
Could stuff is in Firefox. When a picture is a link to another page,
and you want
On Thu, Apr 23, 2009 at 2:32 PM, Georg Wrede wrote:
>>> (OT: an excellent example of this It's Done Because We Noticed We Could
>>> stuff is in Firefox. When a picture is a link to another page, and you want
>>> to drag that to the tab area, the entire picture is dragged with the mouse.
>>> Now,
On Thu, 23 Apr 2009 14:32:13 -0400, Georg Wrede wrote:
Steven Schveighoffer wrote:
On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede
wrote:
(OT: an excellent example of this It's Done Because We Noticed We
Could stuff is in Firefox. When a picture is a link to another page,
and you want
Steven Schveighoffer wrote:
On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede wrote:
(OT: an excellent example of this It's Done Because We Noticed We
Could stuff is in Firefox. When a picture is a link to another page,
and you want to drag that to the tab area, the entire picture is
dragged w
Steven Schveighoffer wrote:
As most ranges are structs (and rightfully
so, who wants to call 3 virtual functions every loop!), they would have
to be wrapped under the current compiler. Or am I missing something else?
Yes, some wrapping would have to be done. Hopefully it will simple
enough
On Thu, 23 Apr 2009 12:09:20 -0400, Georg Wrede wrote:
(OT: an excellent example of this It's Done Because We Noticed We Could
stuff is in Firefox. When a picture is a link to another page, and you
want to drag that to the tab area, the entire picture is dragged with
the mouse. Now, how th
On Thu, 23 Apr 2009 18:28:53 +0400, Andrei Alexandrescu
wrote:
> Denis Koroskin wrote:
>> Sink is okay, but most my usages belong to one of the two scenarios: 1)
>> I need a string representation of an Object - how is Sink useful
>> here? I just want to call obj.toString() and get the result 2
On Thu, 23 Apr 2009 19:34:38 +0400, Don wrote:
> Georg Wrede wrote:
>> Don wrote:
>>> Georg Wrede wrote:
Don wrote:
> Georg Wrede wrote:
>> Don wrote:
>>> bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to
Georg Wrede wrote:
> Don wrote:
>> Georg Wrede wrote:
>>> One thing we sholuld be wary of is overdesign. BigInt is ok, but by
>>> the time we try to include a class called
>>> CompleteSimulationOfAnF1RaceCar, we're screwed. :-) I see no way to
>>> incorporate them into writefln or even plain write
bearophile wrote:
Don:
toString() is one of the most dreadful features in D.
It's also one of the most useful, and it's quite easy to understand
and use. You need very little brain to use it. Features that require
little/no brain are very important to me (but surely it's a quality
that is at t
Georg Wrede wrote:
Don wrote:
Georg Wrede wrote:
Don wrote:
Georg Wrede wrote:
Walter Bright wrote:
Lutger wrote:
what the hell...this code can't be human.
I was replaced by Colossus years ago.
Michael A. Jackson wouldn't approve 1175 gotos in 113 files.
It'd be really funny to pass i
Don wrote:
Georg Wrede wrote:
One thing we sholuld be wary of is overdesign. BigInt is ok, but by
the time we try to include a class called
CompleteSimulationOfAnF1RaceCar, we're screwed. :-) I see no way to
incorporate them into writefln or even plain writeln. Or at least, no
*use*.
I thi
On Thu, 23 Apr 2009 10:30:15 -0400, Andrei Alexandrescu
wrote:
Daniel Keep wrote:
Andrei Alexandrescu wrote:
Steven Schveighoffer wrote:
On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
This has to go into object.d and be part of the runtime,
Don:
> toString() is one of the most dreadful features in D.
It's also one of the most useful, and it's quite easy to understand and use.
You need very little brain to use it. Features that require little/no brain are
very important to me (but surely it's a quality that is at the bottom of the
Georg Wrede wrote:
Don wrote:
Georg Wrede wrote:
Don wrote:
Georg Wrede wrote:
Don wrote:
bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest
it and its new Phobos2. While I explore Phobos I'll probably post
some comments/bugs
Simen Kjaeraas:
> That actually sounds like a good idea. Like you say, is has no use
> outside of debugging, but while debugging, it's quite useful.
It's also important for small script-like programs.
I am using D to write a lot of them :-)
Bye,
bearophile
Don wrote:
Georg Wrede wrote:
Don wrote:
Georg Wrede wrote:
Don wrote:
bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest
it and its new Phobos2. While I explore Phobos I'll probably post
some comments/bugs around here.
Afte
Georg Wrede wrote:
Don wrote:
Georg Wrede wrote:
Don wrote:
bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest it
and its new Phobos2. While I explore Phobos I'll probably post some
comments/bugs around here.
After reading th
Andrei Alexandrescu wrote:
grauzone wrote:
Andrei Alexandrescu wrote:
grauzone wrote:
Yes. The way it should be is not with sink, but with the standard
output iterator method put().
void streamOut(T, R)(T object, R range)
{
foreach(x; a) range.put(x);
range.put(b);
range.put(c);
Daniel Keep wrote:
Andrei Alexandrescu wrote:
Steven Schveighoffer wrote:
On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
This has to go into object.d and be part of the runtime, where
std.range doesn't exist. There is nothing stopping you from c
Denis Koroskin wrote:
Sink is okay, but most my usages belong to one of the two scenarios:
1) I need a string representation of an Object - how is Sink useful
here? I just want to call obj.toString() and get the result 2) I need
to print it to stdout, thus I call writeln/Stdout(obj); - Sink is o
Andrei Alexandrescu wrote:
> Steven Schveighoffer wrote:
>> On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu
>> wrote:
>>
>>> Steven Schveighoffer wrote:
This has to go into object.d and be part of the runtime, where
std.range doesn't exist. There is nothing stopping you from c
Don wrote:
Georg Wrede wrote:
Don wrote:
bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest it
and its new Phobos2. While I explore Phobos I'll probably post some
comments/bugs around here.
After reading this:
http://blogs.msd
grauzone wrote:
Andrei Alexandrescu wrote:
grauzone wrote:
Yes. The way it should be is not with sink, but with the standard
output iterator method put().
void streamOut(T, R)(T object, R range)
{
foreach(x; a) range.put(x);
range.put(b);
range.put(c);
}
Eh. Is a sink callback t
On Thu, Apr 23, 2009 at 2:37 PM, Don wrote:
> bearophile wrote:
>>
>> Don:
>>>
>>> I really don't understand the backend. It's quite cryptic. Key acronyms
>>> are AE, CP and VBE. Then there's Bin, Bgen, Bkill, etc.
>>> AE *might* be Available Expression (but what does that mean?)
>>> CP might be C
Andrei Alexandrescu wrote:
Georg Wrede wrote:
Wow!
What if writeln would automatically call to!string for any object or
struct?
That's the plan, I didn't get around to it. I want to do it the right
way, i.e. with general streams, not strings.
I'm just impressed.
Georg Wrede wrote:
Don wrote:
bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest it
and its new Phobos2. While I explore Phobos I'll probably post some
comments/bugs around here.
After reading this:
http://blogs.msdn.com/vcblog
Sink is okay, but most my usages belong to one of the two scenarios:
1) I need a string representation of an Object - how is Sink useful here? I
just want to call obj.toString() and get the result
2) I need to print it to stdout, thus I call writeln/Stdout(obj); - Sink is of
no use here again.
Andrei Alexandrescu wrote:
grauzone wrote:
Yes. The way it should be is not with sink, but with the standard
output iterator method put().
void streamOut(T, R)(T object, R range)
{
foreach(x; a) range.put(x);
range.put(b);
range.put(c);
}
Eh. Is a sink callback too simple and eas
On Thu, 23 Apr 2009 17:35:59 +0400, Frits van Bommel
wrote:
> Denis Koroskin wrote:
>> On Thu, 23 Apr 2009 16:20:03 +0400, Don wrote:
>>
>>> struct Foo(A, B, C){
>>> A[10] a;
>>> B b;
>>> C c;
>>> void toString(Sink sink){
>>> foreach(x; a) sink(x);
>>> sink(b);
>>> sink(c);
>>> }
>
Georg Wrede wrote:
Wow!
What if writeln would automatically call to!string for any object or
struct?
That's the plan, I didn't get around to it. I want to do it the right
way, i.e. with general streams, not strings.
Andrei
Frits van Bommel wrote:
Andrei Alexandrescu wrote:
Steven Schveighoffer wrote:
So I'd rather have a sink function.
It must be a sink _object_ so it can hold its own state. And it must
support put() so it integrates with statically-bound output ranges.
interface OutRange
{
void put(...
Andrei Alexandrescu wrote:
Georg Wrede wrote:
Second, since we have cool stuff in D, like templates, boxing, and
other advanced things, then compared to them, it should not be a big
deal to have automatic creation of toString for structs and objects.
(This could even be on-demand, i.e. unless
Andrei Alexandrescu wrote:
Frits van Bommel wrote:
IMHO It'd be pretty nice for the standard formatting systems (both the
Tango and Phobos ones) to just call a standard Object method taking
(Sink sink, char[] format = null) on objects.
Probably we'll need that. You forgot the "in" though :o).
Georg Wrede wrote:
Second, since we have cool stuff in D, like templates, boxing, and other
advanced things, then compared to them, it should not be a big deal to
have automatic creation of toString for structs and objects. (This could
even be on-demand, i.e. unless called, the toString is not
Frits van Bommel wrote:
I usually define something like "void streamTo(Sink sink)" in a base
class if I want non-allocating output. Adding a format string to the
parameter list should be easy, but I haven't needed it yet.
I then usually implement toString by passing an appending Sink to that
me
Andrei Alexandrescu wrote:
Steven Schveighoffer wrote:
So I'd rather have a sink function.
It must be a sink _object_ so it can hold its own state. And it must
support put() so it integrates with statically-bound output ranges.
interface OutRange
{
void put(... a number of overloads ...
Steven Schveighoffer wrote:
On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
This has to go into object.d and be part of the runtime, where
std.range doesn't exist. There is nothing stopping you from calling:
streamOut(&outputrange.put);
So I'd r
Don wrote:
bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest it
and its new Phobos2. While I explore Phobos I'll probably post some
comments/bugs around here.
After reading this:
http://blogs.msdn.com/vcblog/archive/2009/04/22/
Denis Koroskin wrote:
On Thu, 23 Apr 2009 16:20:03 +0400, Don wrote:
struct Foo(A, B, C){
A[10] a;
B b;
C c;
void toString(Sink sink){
foreach(x; a) sink(x);
sink(b);
sink(c);
}
}
... but it's not, you have to create a silly buffer to put all your
strings in, even if there are 20
On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
This has to go into object.d and be part of the runtime, where
std.range doesn't exist. There is nothing stopping you from calling:
streamOut(&outputrange.put);
So I'd rather have a sink function.
Steven Schveighoffer wrote:
On Thu, 23 Apr 2009 09:06:38 -0400, Andrei Alexandrescu
wrote:
It ought to be at least as simple as:
struct Foo(A, B, C){
A[10] a;
B b;
C c;
void toString(Sink sink){
foreach(x; a) sink(x);
sink(b);
sink(c);
}
}
... but it's not, you have to create a sill
grauzone wrote:
Yes. The way it should be is not with sink, but with the standard
output iterator method put().
void streamOut(T, R)(T object, R range)
{
foreach(x; a) range.put(x);
range.put(b);
range.put(c);
}
Eh. Is a sink callback too simple and easy to use or what?
?
Andre
On Thu, 23 Apr 2009 09:06:38 -0400, Andrei Alexandrescu
wrote:
It ought to be at least as simple as:
struct Foo(A, B, C){
A[10] a;
B b;
C c;
void toString(Sink sink){
foreach(x; a) sink(x);
sink(b);
sink(c);
}
}
... but it's not, you have to create a silly buffer to put all your
s
Yes. The way it should be is not with sink, but with the standard output
iterator method put().
void streamOut(T, R)(T object, R range)
{
foreach(x; a) range.put(x);
range.put(b);
range.put(c);
}
Eh. Is a sink callback too simple and easy to use or what?
Don wrote:
No!
toString() is one of the most dreadful features in D. Trying to slightly
improve it is a waste of time -- the whole concept needs to be redone.
It's horribly inflexible, tedious, and hugely inefficient. What more
could there be to hate?
I agree.
- the object being called has
On Thu, 23 Apr 2009 16:20:03 +0400, Don wrote:
> bearophile wrote:
>> This post is mostly for Andrei.
>> I have played with D2 a bit; probably I'll need months to digest it and
>> its new Phobos2. While I explore Phobos I'll probably post some
>> comments/bugs around here.
>> After reading t
On Thu, 23 Apr 2009 18:09:06 +0900, Andrei Alexandrescu
wrote:
Masahiro Nakagawa wrote:
I submitted this problem to bugzilla.
http://d.puremagic.com/issues/show_bug.cgi?id=2882
Thanks! I fixed it and checked in std.random.
Wow!
std.random in svn works fine.
Thanks for your quick respon
Don wrote:
I'd like to see version(debug) {} put around Object.toString(). It's a
deathtrap feature that's got no business being used other than for
debugging.
That actually sounds like a good idea. Like you say, is has no use
outside of debugging, but while debugging, it's quite useful.
-
No!
toString() is one of the most dreadful features in D. Trying to slightly
improve it is a waste of time -- the whole concept needs to be redone.
It's horribly inflexible, tedious, and hugely inefficient. What more
could there be to hate?
Hey, it's only meant for debugging! (At least I hope
bearophile wrote:
Don:
I really don't understand the backend. It's quite cryptic. Key acronyms
are AE, CP and VBE. Then there's Bin, Bgen, Bkill, etc.
AE *might* be Available Expression (but what does that mean?)
CP might be Copy Propagation info
I've found that VBE = "Very Busy Expression"! (w
bearophile wrote:
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest it and its new
Phobos2. While I explore Phobos I'll probably post some comments/bugs around
here.
After reading this:
http://blogs.msdn.com/vcblog/archive/2009/04/22/decltype-c-0x
Don:
> I really don't understand the backend. It's quite cryptic. Key acronyms
> are AE, CP and VBE. Then there's Bin, Bgen, Bkill, etc.
> AE *might* be Available Expression (but what does that mean?)
> CP might be Copy Propagation info
> I've found that VBE = "Very Busy Expression"! (what does th
This post is mostly for Andrei.
I have played with D2 a bit; probably I'll need months to digest it and its new
Phobos2. While I explore Phobos I'll probably post some comments/bugs around
here.
After reading this:
http://blogs.msdn.com/vcblog/archive/2009/04/22/decltype-c-0x-features-in-vc10-pa
Masahiro Nakagawa wrote:
> I submitted this problem to bugzilla.
> http://d.puremagic.com/issues/show_bug.cgi?id=2882
Thanks! I fixed it and checked in std.random.
Andrei
bearophile wrote:
Don:
Actually it's not so difficult. I've created a patch for bug 2807 --
it's only 5 lines long! It gives an error message if a nested pure
function accesses a mutable variable from an outer scope.
Thank you very much Don, your work helps a lot.
Every time I try a tiny pro
Don wrote:
Georg Wrede wrote:
Don wrote:
Georg Wrede wrote:
Walter Bright wrote:
Lutger wrote:
what the hell...this code can't be human.
I was replaced by Colossus years ago.
Michael A. Jackson wouldn't approve 1175 gotos in 113 files.
It'd be really funny to pass it through one of tho
65 matches
Mail list logo