On 2011-08-24 20:36, jdrewsen wrote:
One way that may improve this would be to move the static methods
outside the class and make them into module functions instead.
The drawbacks of this is:
1, When importing the module there would be more symbols polluting the
namespace.
2, We would have to
On 2011-08-24 18:35, Walter Bright wrote:
On 8/24/2011 2:18 AM, Johannes Pfau wrote:
Not sure, if this still works though. Twitter is switching from HTTP
basic authentication to OAuth. Also, this code is not tested ;-)
I'm glad to see this can be done. A complete example in the
documentation
It is actually already possible to store meta data in classinfos.
---
import std.stdio;
class A {
int a;
float b;
}
mixin template register(T) if(is(T == class)) {
static this() {
T.classinfo.m_offTi = [OffsetTypeInfo(0, typeid(int)),
OffsetTypeInfo(4, typeid(float))];
}
}
mixin
On Wed, 24 Aug 2011 08:49:19 +0200, Jacob Carlborg wrote:
On 2011-08-24 01:34, Martin Nowak wrote:
On Tue, 23 Aug 2011 17:03:12 +0200, Jacob Carlborg wrote:
On 2011-08-23 16:38, Andrei Alexandrescu wrote:
On 8/23/11 12:55 AM, Jacob Carlborg wrote:
On 2011-08-23 08:52, Andrei Alexandrescu
On 08/25/2011 04:08 AM, bearophile wrote:
Timon Gehr:
It is especially compact in that program,
The coding style of that program is an unreadable mess, example:
LList!T hamming(T)(){
LList!T merge(LList!T xs, LList!T ys){
return lz({
auto x=xs.head, y=ys.head;
On 08/25/2011 04:13 AM, Andrej Mitrovic wrote:
Cool interview. The D discussion was looong, I was expecting a
2-minute talk about D and then moving onto C++ business. Pretty cool!
Now if we could have an easy way to enforce the GC out of compilation
via some compile-time switch we could fore
On 08/25/2011 04:11 AM, bearophile wrote:
Timon Geh:
Done: http://pastebin.com/Vx4hXvaT
Theoretically it could use std.bigint, but I have still not found out
how to convert these to string without pain.
To compute Hamming(1_000_000) this converts a BigInt to string:
string bigIntRepr(BigInt
On 08/25/2011 04:05 AM, Jonathan M Davis wrote:
On Thursday, August 25, 2011 03:35:05 Timon Gehr wrote:
On 08/25/2011 03:07 AM, Jonathan M Davis wrote:
On Wednesday, August 24, 2011 17:52 Timon Gehr wrote:
On 08/25/2011 02:34 AM, Jonathan M Davis wrote:
On Wednesday, August 24, 2011 17:17 Tim
Timon Geh:
> Done: http://pastebin.com/Vx4hXvaT
>
> Theoretically it could use std.bigint, but I have still not found out
> how to convert these to string without pain.
To compute Hamming(1_000_000) this converts a BigInt to string:
string bigIntRepr(BigInt i) {
const(char)[] result;
i
Cool interview. The D discussion was looong, I was expecting a
2-minute talk about D and then moving onto C++ business. Pretty cool!
Now if we could have an easy way to enforce the GC out of compilation
via some compile-time switch we could forever get rid of that GC
equals slow application ar
Timon Gehr:
> It is especially compact in that program,
The coding style of that program is an unreadable mess, example:
LList!T hamming(T)(){
LList!T merge(LList!T xs, LList!T ys){
return lz({
auto x=xs.head, y=ys.head;
if(x()y()) return cons(y,merge(
On Thursday, August 25, 2011 03:35:05 Timon Gehr wrote:
> On 08/25/2011 03:07 AM, Jonathan M Davis wrote:
> > On Wednesday, August 24, 2011 17:52 Timon Gehr wrote:
> >> On 08/25/2011 02:34 AM, Jonathan M Davis wrote:
> >>> On Wednesday, August 24, 2011 17:17 Timon Gehr wrote:
> On 08/25/2011 0
On 2011-08-22 21:27:39 +, Stewart Gordon said:
On 20/08/2011 07:28, Bernard Helyer wrote:
On Sat, 20 Aug 2011 01:42:56 +0100, Stewart Gordon wrote:
So essentially you're looking to catch cases where, if you consider the
function as a flow chart, there is no chain of arrows from the start
On 08/25/2011 03:23 AM, bearophile wrote:
Jonathan M Davis:
Don refuses to implement it, because it always creates a new string. He wants
something like the DIP for writeFrom
99.9% of the times Don is right, but in this case he's wrong. You can't avoid
putting a necessary feature (a correctl
On 08/25/2011 03:07 AM, Jonathan M Davis wrote:
On Wednesday, August 24, 2011 17:52 Timon Gehr wrote:
On 08/25/2011 02:34 AM, Jonathan M Davis wrote:
On Wednesday, August 24, 2011 17:17 Timon Gehr wrote:
On 08/25/2011 01:15 AM, Timon Gehr wrote:
On 08/24/2011 11:55 PM, bearophile wrote:
Timo
Jonathan M Davis:
> Don refuses to implement it, because it always creates a new string. He wants
> something like the DIP for writeFrom
99.9% of the times Don is right, but in this case he's wrong. You can't avoid
putting a necessary feature (a correctly working toString) just because it's
no
On 08/25/2011 01:36 AM, bearophile wrote:
Timon Gehr:
Statement at line 40 is necessary to make
the /type inference/ work out, and such things are the reason I don't
usually turn warnings on.
I think this fools DMD, and removes the warning:
return assert(0, "Tried to get tail of empty list!")
On Wednesday, August 24, 2011 17:52 Timon Gehr wrote:
> On 08/25/2011 02:34 AM, Jonathan M Davis wrote:
> > On Wednesday, August 24, 2011 17:17 Timon Gehr wrote:
> >> On 08/25/2011 01:15 AM, Timon Gehr wrote:
> >>> On 08/24/2011 11:55 PM, bearophile wrote:
> Timon Gehr:
> > If anyone is in
On 08/25/2011 02:34 AM, Jonathan M Davis wrote:
On Wednesday, August 24, 2011 17:17 Timon Gehr wrote:
On 08/25/2011 01:15 AM, Timon Gehr wrote:
On 08/24/2011 11:55 PM, bearophile wrote:
Timon Gehr:
If anyone is interested:
http://pastebin.com/2rEdx0RD
I suggest you to usually compile your D
On 08/24/2011 11:55 PM, bearophile wrote:
Timon Gehr:
If anyone is interested:
http://pastebin.com/2rEdx0RD
I suggest you to usually compile your D code with -w, I see some missing overrides. At
line 40 it gives me a "Warning: statement is not reachable".
Are you able to use it to translate
On Wednesday, August 24, 2011 17:17 Timon Gehr wrote:
> On 08/25/2011 01:15 AM, Timon Gehr wrote:
> > On 08/24/2011 11:55 PM, bearophile wrote:
> >> Timon Gehr:
> >>> If anyone is interested:
> >>> http://pastebin.com/2rEdx0RD
> >>
> >> I suggest you to usually compile your D code with -w, I see s
On 08/25/2011 01:15 AM, Timon Gehr wrote:
On 08/24/2011 11:55 PM, bearophile wrote:
Timon Gehr:
If anyone is interested:
http://pastebin.com/2rEdx0RD
I suggest you to usually compile your D code with -w, I see some
missing overrides. At line 40 it gives me a "Warning: statement is not
reacha
Timon Gehr:
> Statement at line 40 is necessary to make
> the /type inference/ work out, and such things are the reason I don't
> usually turn warnings on.
I think this fools DMD, and removes the warning:
return assert(0, "Tried to get tail of empty list!"), List.init;
(Your coding style is rea
On 08/24/2011 11:55 PM, bearophile wrote:
Timon Gehr:
If anyone is interested:
http://pastebin.com/2rEdx0RD
I suggest you to usually compile your D code with -w, I see some missing overrides. At
line 40 it gives me a "Warning: statement is not reachable".
There is only one missing override
Walter:
> http://www.reddit.com/r/programming/comments/jt7zm/scott_meyers_andrei_alexandrescu_and_herb_sutter/
The interview was nice. Sadly they don't talk about the "pure" attribute of D
:-)
Andrei needs more water.
>From that Reddit thread:
>I dislike C++ so much that I've been writing emul
Timon Gehr:
> If anyone is interested:
> http://pastebin.com/2rEdx0RD
I suggest you to usually compile your D code with -w, I see some missing
overrides. At line 40 it gives me a "Warning: statement is not reachable".
Are you able to use it to translate the Haskell version of this task?
http://
On 08/24/2011 11:19 PM, Steven Schveighoffer wrote:
On Wed, 24 Aug 2011 15:15:54 -0400, Michel Fortin
wrote:
On 2011-08-24 11:17:08 +, "Steven Schveighoffer"
said:
It's actually possible, but ugly:
auto ptr = (new int[10][](1)).ptr;
One really interesting thing to note -- the compiler a
On Aug 23, 2011, at 6:04 AM, Don wrote:
> Sean Kelly wrote:
>> Was this broken condition something that could have been detected
>> statically? I've encountered plenty of broken conditions, but I've never
>> had a compiler correctly flag one such.
>
> Yes.
>
> if (a > C1 && a < C2) ...
>
> w
On Wed, 24 Aug 2011 15:15:54 -0400, Michel Fortin
wrote:
On 2011-08-24 11:17:08 +, "Steven Schveighoffer"
said:
It's actually possible, but ugly:
auto ptr = (new int[10][](1)).ptr;
One really interesting thing to note -- the compiler actually turns
struct allocations into array-
Still 15 minutes to go, 1.2 gig download! (the video they broadcast is
of poor quality so I'm fetching the high quality one..)
On 8/24/2011 11:50 AM, Andrei Alexandrescu wrote:
Includes a long discussion about D:
http://channel9.msdn.com/posts/Scott-Meyers-Andrei-Alexandrescu-and-Herb-Sutter-C-and-Beyond
On reddit:
http://www.reddit.com/r/programming/comments/jt7zm/scott_meyers_andrei_alexandrescu_and_herb_sutter/
Den 22-08-2011 17:20, Jonathan M Davis skrev:
On Monday, August 22, 2011 15:23:54 simendsjo wrote:
On 22.08.2011 08:25, Jonathan M Davis wrote:
On Monday, August 22, 2011 08:09:54 Jonas Drewsen wrote:
On 21/08/11 23.44, Jesse Phillips wrote:
On Sat, 20 Aug 2011 23:57:54 +, Jesse Phillips
On 08/24/2011 08:19 PM, Jonathan M Davis wrote:
On Wednesday, August 24, 2011 04:22 bearophile wrote:
Caligo:
Haskell is one of the most beautiful languages. I wish I had discovered
it sooner.
I am now able to write small Haskell programs. It has some features and
parts that I like significan
On 2011-08-24 11:17:08 +, "Steven Schveighoffer"
said:
It's actually possible, but ugly:
auto ptr = (new int[10][](1)).ptr;
One really interesting thing to note -- the compiler actually turns
struct allocations into array-of-one allocations in the runtime. So
this is likely what the
== Quote from jdrewsen (jdrew...@nospam.com)'s article
> One way that may improve this would be to move the static methods
> outside the class and make them into module functions instead.
> The drawbacks of this is:
> 1, When importing the module there would be more symbols polluting the
> namespac
Includes a long discussion about D:
http://channel9.msdn.com/posts/Scott-Meyers-Andrei-Alexandrescu-and-Herb-Sutter-C-and-Beyond
Andrei
For what it's worth, my little curl.d module has one magic
function that just kinda does it all:
string curl(string url, string postData = null, string postDataContentType =
"application/x-www-form-data"); (or whatever the content type is)
This does simple stuff, then there's other ways to do fan
Den 24-08-2011 13:04, Johannes Pfau skrev:
dav1d wrote:
Jonas Drewsen Wrote:
Hi all,
This is a review request for the curl wrapper. Please read the
"known issues" in the top of the source file and if possible suggest
a solution.
We also need somebody for running the review process. Anyo
On 08/24/2011 07:57 PM, Andrei Alexandrescu wrote:
On 8/24/11 9:45 AM, Timon Gehr wrote:
On 08/24/2011 04:47 PM, Andrei Alexandrescu wrote:
On 8/24/11 6:58 AM, Timon Gehr wrote:
So, basically interfaces are the only place in D?/DMD where you can
even
specify contracts without a function body a
On Wednesday, August 24, 2011 04:22 bearophile wrote:
> Caligo:
> > Haskell is one of the most beautiful languages. I wish I had discovered
> > it sooner.
>
> I am now able to write small Haskell programs. It has some features and
> parts that I like significantly (and I'd like some of them in D t
On 8/24/11 9:45 AM, Timon Gehr wrote:
On 08/24/2011 04:47 PM, Andrei Alexandrescu wrote:
On 8/24/11 6:58 AM, Timon Gehr wrote:
So, basically interfaces are the only place in D?/DMD where you can even
specify contracts without a function body and there they don't work. I
think the bug is not the
On 8/24/2011 10:33 AM, Andrei Alexandrescu wrote:
Probably this simple level of abstraction should be provided by the library
(with the added advantage that client code will automatically work with new
protocols as the library includes them).
Yes to both.
On 8/24/11 9:39 AM, Alex Rønne Petersen wrote:
On 24-08-2011 16:47, Andrei Alexandrescu wrote:
On 8/24/11 6:58 AM, Timon Gehr wrote:
So, basically interfaces are the only place in D?/DMD where you can even
specify contracts without a function body and there they don't work. I
think the bug is n
On 8/24/11 9:35 AM, Walter Bright wrote:
On 8/24/2011 2:18 AM, Johannes Pfau wrote:
Walter Bright wrote:
On 8/17/2011 4:12 PM, David Nadlinger wrote:
the etc.curl module by Jonas Drewsen is at the front of the review
queue.
Thanks for doing this. I preface my remarks with saying I have never
"bearophile" wrote in message
news:j32mti$15tp$1...@digitalmars.com...
> Caligo:
>
>> Haskell is one of the most beautiful languages. I wish I had discovered
>> it sooner.
>
> I am now able to write small Haskell programs. It has some features and
> parts that I like significantly (and I'd like
Walter Bright wrote:
>On 8/24/2011 2:18 AM, Johannes Pfau wrote:
>> Walter Bright wrote:
>>> On 8/17/2011 4:12 PM, David Nadlinger wrote:
the etc.curl module by Jonas Drewsen is at the front of the review
queue.
>>>
>>> Thanks for doing this. I preface my remarks with saying I have never
On 08/24/2011 06:22 PM, Walter Bright wrote:
On 8/24/2011 1:09 AM, kennytm wrote:
Not sure if it's a big enough problem, but what about dangling else of
this
form?
if (a.length> 0)
foreach (i, ref e; a)
if (i> 0)
e += a[i-1];
else // oops
throw new Exception("empty array");
That wouldn't be c
On 08/24/2011 04:47 PM, Andrei Alexandrescu wrote:
On 8/24/11 6:58 AM, Timon Gehr wrote:
So, basically interfaces are the only place in D?/DMD where you can even
specify contracts without a function body and there they don't work. I
think the bug is not the only problem, actual contracts should
On 24-08-2011 16:47, Andrei Alexandrescu wrote:
On 8/24/11 6:58 AM, Timon Gehr wrote:
So, basically interfaces are the only place in D?/DMD where you can even
specify contracts without a function body and there they don't work. I
think the bug is not the only problem, actual contracts should /al
On 8/24/2011 2:18 AM, Johannes Pfau wrote:
Walter Bright wrote:
On 8/17/2011 4:12 PM, David Nadlinger wrote:
the etc.curl module by Jonas Drewsen is at the front of the review
queue.
Thanks for doing this. I preface my remarks with saying I have never
done http: programming and know little ab
On 8/23/2011 3:32 PM, Andrei Alexandrescu wrote:
Yah, disallowing complete and nested if/else pairs would be an annoyance (I'm
not sure how big). Otherwise, Walter's idea sounds good to me. Walter, would you
be okay with accepting if-if-else-else (at any depth) as a correct case and
otherwise dis
On 8/24/2011 1:09 AM, kennytm wrote:
Not sure if it's a big enough problem, but what about dangling else of this
form?
if (a.length> 0)
foreach (i, ref e; a)
if (i> 0)
e += a[i-1];
else // oops
throw new Exception("empty array");
On 8/24/11 6:58 AM, Timon Gehr wrote:
So, basically interfaces are the only place in D?/DMD where you can even
specify contracts without a function body and there they don't work. I
think the bug is not the only problem, actual contracts should /always/
be part of the function declaration and not
Damn, I forgot the most important part:
etc.curl currently uses none of D's "advanced" function attributes.
This means that etc.curl can't be used in safeD for example. IMHO
that's a big problem: New phobos code should be usable in safeD it's
bad enough that lots of old code isn't.
So:
@safe or @
On 08/24/2011 03:35 PM, Timon Gehr wrote:
On 08/24/2011 03:13 PM, Alex Rønne Petersen wrote:
Hi,
This is an odd one. Consider the following code:
interface I
{
void foo()
out { assert(bar()); }
bool bar();
}
class C : I
{
void foo() {}
bool bar() { return true; }
}
void main()
{
C c = new C
On 24-08-2011 15:35, Timon Gehr wrote:
On 08/24/2011 03:13 PM, Alex Rønne Petersen wrote:
Hi,
This is an odd one. Consider the following code:
interface I
{
void foo()
out { assert(bar()); }
bool bar();
}
class C : I
{
void foo() {}
bool bar() { return true; }
}
void main()
{
C c = new C();
On 08/24/2011 03:13 PM, Alex Rønne Petersen wrote:
Hi,
This is an odd one. Consider the following code:
interface I
{
void foo()
out { assert(bar()); }
bool bar();
}
class C : I
{
void foo() {}
bool bar() { return true; }
}
void main()
{
C c = new C();
c.foo();
}
This will crash and burn w
Hi,
This is an odd one. Consider the following code:
interface I
{
void foo()
out { assert(bar()); }
bool bar();
}
class C : I
{
void foo() {}
bool bar() { return true; }
}
void main()
{
C c = new C();
c.foo();
}
This will crash and burn when run:
object.Error:
David Nadlinger wrote:
>Now that Lars Kyllingstad's new and improved std.path has passed the
>vote – congratulations, Lars! –, and Jose Armando Garcia, the author
>of the proposed logging module, is currently not available, the
>etc.curl module by Jonas Drewsen is at the front of the review queue
On 2011-08-24 10:10, Marco Leise wrote:
Then I'll clearly use Orange when I have a need for serialization. Nice
work!
Thanks.
I've taken a closer look at
http://dsource.org/projects/orange/wiki/Features and I see that
versioning is still missing. What are your plans there? What happens at
the
Caligo:
> Haskell is one of the most beautiful languages. I wish I had discovered it
> sooner.
I am now able to write small Haskell programs. It has some features and parts
that I like significantly (and I'd like some of them in D too!), but so far I
am not appreciating it much on the whole. I
On Tue, 23 Aug 2011 10:45:33 -0400, Andrei Alexandrescu
wrote:
On 8/23/11 6:15 AM, foobar wrote:
== Quote from bearophile (bearophileh...@lycos.com)'s article
foobar:
you raise a valid concern but this looks too complicated.
I'd suggest to simplify into only two cases.
// 1) T.INIT - as y
dav1d wrote:
>Jonas Drewsen Wrote:
>
>> Hi all,
>>
>> This is a review request for the curl wrapper. Please read the
>> "known issues" in the top of the source file and if possible suggest
>> a solution.
>>
>> We also need somebody for running the review process. Anyone?
>>
>> Code:
>>
Jonas Drewsen Wrote:
> Hi all,
>
> This is a review request for the curl wrapper. Please read the
> "known issues" in the top of the source file and if possible suggest a
> solution.
>
> We also need somebody for running the review process. Anyone?
>
> Code:
> https://github.com/jcd
Walter Bright wrote:
>On 8/17/2011 4:12 PM, David Nadlinger wrote:
>> the etc.curl module by Jonas Drewsen is at the front of the review
>> queue.
>
>Thanks for doing this. I preface my remarks with saying I have never
>done http: programming and know little about it.
>
>1. The first, most obvious
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
> On Wednesday, August 24, 2011 07:57:07 Brian Brady wrote:
> > All
> >
> > I am having a problem compiling a simple program when working through "The D
> > Programming Language". The program is like so:
> >
> > #!/usr/bin/rdmd
> >
> >
Am 24.08.2011, 08:58 Uhr, schrieb Jacob Carlborg :
On 2011-08-24 08:41, Marco Leise wrote:
Am 23.08.2011, 19:42 Uhr, schrieb jdrewsen :
Den 23-08-2011 17:03, Jacob Carlborg skrev:
On 2011-08-23 16:38, Andrei Alexandrescu wrote:
On 8/23/11 12:55 AM, Jacob Carlborg wrote:
On 2011-08-23 08:52
Walter Bright wrote:
> On 8/19/2011 8:12 AM, Andrei Alexandrescu wrote:
>> One thing I'd subjectively like is to require braces on both branches of
>> if/else
>> if at least one has braces.
>
> It's rather simple to just disallow the form:
>
> if (a) if (b) statement
>^ error: u
On Wednesday, August 24, 2011 07:57:07 Brian Brady wrote:
> All
>
> I am having a problem compiling a simple program when working through "The D
> Programming Language". The program is like so:
>
> #!/usr/bin/rdmd
>
> import std.stdio, std.string;
>
> void main()
> {
> //Compute counts
> ui
All
I am having a problem compiling a simple program when working through "The D
Programming Language". The program is like so:
#!/usr/bin/rdmd
import std.stdio, std.string;
void main()
{
//Compute counts
uint[string] freqs;
foreach(line; stdin.byLine())
{
foreach(word; split(strip(
On 2011-08-24 08:41, Marco Leise wrote:
Am 23.08.2011, 19:42 Uhr, schrieb jdrewsen :
Den 23-08-2011 17:03, Jacob Carlborg skrev:
On 2011-08-23 16:38, Andrei Alexandrescu wrote:
On 8/23/11 12:55 AM, Jacob Carlborg wrote:
On 2011-08-23 08:52, Andrei Alexandrescu wrote:
On 8/22/11 11:30 PM, Ja
71 matches
Mail list logo