On Wednesday, 16 July 2014 at 04:10:13 UTC, Rikki Cattermole
wrote:
On 16/07/2014 3:50 p.m., Puming wrote:
I'd like to have a Command class, where their is a name and a
handler
field:
```d
class Command
{
string name;
string delegate(string[]) handler;
}
```
this is ok, but sometimes I
Am 15.07.2014 00:29, schrieb Nordlöw:
On Monday, 14 July 2014 at 22:27:48 UTC, Nordlöw wrote:
and then it hangs with same behaviour.
It finally got through...hmm maybe I'm on a slow 3g-network currently...
Although the log indicates that it hung while extracting the downloaded
zip file.
i have the following code
char[] Etag(string file){
auto info = DirEntry(file);
ubyte[16] hash = md5Of(to!string(info.timeLastAccessed.day)~
to!string(info.timeLastAccessed.month)~
Sean Campbell:
i have the following code
char[] Etag(string file){
auto info = DirEntry(file);
ubyte[16] hash = md5Of(to!string(info.timeLastAccessed.day)~
to!string(info.timeLastAccessed.month)~
On Wednesday, 16 July 2014 at 12:15:34 UTC, bearophile wrote:
Such kind of bugs are impossible in Rust. Hopefully we'll
eventually remove them from D too.
Seems like a popular issue. Is there a bug report for it?
Kagamin:
Seems like a popular issue.
Y
es, it is.
Is there a bug report for it?
Bug report for what? To ask for [] to be used when you slice a
fixed size array? This is in Bugzilla. Or perhaps you are asking
for lifetime management of the data? This is currently discussed
in the main D
Report for the problem when a temporary fixed-size array is
assigned to a slice, which is escaped.
Kagamin:
Report for the problem when a temporary fixed-size array is
assigned to a slice, which is escaped.
I think this is already in Bugzilla. But the point is: you can't
solve this problem locally and with small means. You need a
principled solution (or no solution at all, as now) of
I have a more pragmatic view. Do you know the issue number?
Aren't these your words: fixing as many errors as possible always
helps even if we don't fix all errors?
Hi! I've been experimenting with D functions, and found this
piece of code:
//
int abc(int delegate(long i));
int def(int function(long s));
void test() {
int b = 3;
abc( (long c) { return 6 + b; } ); // inferred to delegate
def( (long c) { return c * 2; } ); // inferred to function
}
On Wednesday, 16 July 2014 at 15:12:58 UTC, Pavel wrote:
Hi! I've been experimenting with D functions, and found this
piece of code:
//
int abc(int delegate(long i));
int def(int function(long s));
void test() {
int b = 3;
abc( (long c) { return 6 + b; } ); // inferred to delegate
def(
I would just change all the longs to ints and it would probably
work. Or all the longs to ints.
It really should have been consistent in the docs, since the
point of this is delegate vs function, not int vs long...
On Wednesday, 16 July 2014 at 15:44:03 UTC, Adam D. Ruppe wrote:
I would just change all the longs to ints and it would probably
work. Or all the longs to ints.
It really should have been consistent in the docs, since the
point of this is delegate vs function, not int vs long...
The compiler would generate calls to toDelegate and toFunction
automatically.
On 7/16/14, 10:22 AM, bearophile wrote:
Kagamin:
Report for the problem when a temporary fixed-size array is assigned
to a slice, which is escaped.
I think this is already in Bugzilla. But the point is: you can't solve
this problem locally and with small means. You need a principled
solution
Klb:
Hello, I'd like to know if it's possible, using CTFE, mixin etc
to convert a POD struct to a class at compile time.
I remember Andrei planned to add this small thingie to Phobos,
but it's still missing.
Bye,
bearophile
Ary Borenszweig:
When assigning a fixed size array to a slice, can't you just
allocate memory and copy the data there (I mean, let the
compiler do that in that case)? That would be safe, right?
Yes, using a .dup:
char[] hashstring = toHexString(hash).dup;
But the compiler should not do
Not a direct answer, but the way I'd do this is to just use
composition:
class Foo {
YourStruct _this;
alias _this this;
}
boom, it'd work pretty well just like that...
On Wednesday, 16 July 2014 at 17:43:03 UTC, Klb wrote:
auto names = __traits(allMembers, S);
Error: static variable _names_field_0 cannot be read at compile
time.
The problem there is names is a regular runtime variable and
mixins need to use compile time stuff. If you make that enum
On Wed, Jul 16, 2014 at 06:07:32PM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
Not a direct answer, but the way I'd do this is to just use
composition:
class Foo {
YourStruct _this;
alias _this this;
}
boom, it'd work pretty well just like that...
+1, simple answer to
On 07/16/2014 06:31 AM, Kagamin wrote:
I have a more pragmatic view. Do you know the issue number?
https://issues.dlang.org/show_bug.cgi?id=8838
Ali
On Wednesday, 16 July 2014 at 18:09:10 UTC, Adam D. Ruppe wrote:
On Wednesday, 16 July 2014 at 17:43:03 UTC, Klb wrote:
auto names = __traits(allMembers, S);
Error: static variable _names_field_0 cannot be read at
compile time.
The problem there is names is a regular runtime variable
On Tuesday, 15 July 2014 at 22:09:43 UTC, ponce wrote:
On Tuesday, 15 July 2014 at 20:46:32 UTC, Martijn Pot wrote:
To make a long story short:
Is there any math library with e.g. mean, std, polynomial
fitting, ...?
https://github.com/kyllingstad/scid
https://github.com/dsimcha/dstats
On Wednesday, 16 July 2014 at 19:43:26 UTC, Martijn Pot wrote:
On Tuesday, 15 July 2014 at 22:09:43 UTC, ponce wrote:
On Tuesday, 15 July 2014 at 20:46:32 UTC, Martijn Pot wrote:
To make a long story short:
Is there any math library with e.g. mean, std, polynomial
fitting, ...?
On Wednesday, 16 July 2014 at 18:27:31 UTC, Klb wrote:
On Wednesday, 16 July 2014 at 18:09:10 UTC, Adam D. Ruppe wrote:
On Wednesday, 16 July 2014 at 17:43:03 UTC, Klb wrote:
auto names = __traits(allMembers, S);
Error: static variable _names_field_0 cannot be read at
compile time.
The
On Monday, 14 July 2014 at 05:58:13 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
On Friday, July 11, 2014 04:01:24 Joel via Digitalmars-d-learn
wrote:
I've been trying to set a date for my program (a small struct):
import std.datetime;
auto date = cast(DateTime)Clock.currTime();
Alternative:
randomSample(lowercase, 10, lowercase.length).writeln;
No, I don't think that's appropriate, because it will pick 10 individual
characters from a, b, c, ... , z (i.e. no character will appear more than once),
and the characters picked will appear in alphabetical order.
On Wednesday, 16 July 2014 at 21:12:00 UTC, bachmeier wrote:
Have you tried them? Do they work? I couldn't get scid to work
last year. I've never heard of dstats before, but it hasn't
seen any activity in two years. I'd be surprised if it worked
with the latest release of DMD.
Can't speak
Here is an interesting case related to an undocumented feature of
GC.realloc(). Although I think there is a bug, I don't want to create a
bug report yet because the feature is not even documented. :)
First, here is its most recent definition from druntime/src/gc/gc.d:
void *realloc(void
30 matches
Mail list logo