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 *p
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 for
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.
Incident
On 15/07/14 00:16, "Nordlöw" via Digitalmars-d-learn wrote:
Is there a natural way of generating/filling a string/wstring/dstring of a
specific length with random contents?
I think you need to be more specific about what kind of random contents you are
interested in having.
Are you intereste
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();
setDat
On Wednesday, 16 July 2014 at 08:03:40 UTC, Sönke Ludwig wrote:
BTW. the DUB forums are usually much better in terms of
responsiveness, because I rarely get the time to read here:
http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub/
Ok. Thx.
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 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, ...?
https://gith
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
Than
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 an
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 an
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 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 a
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
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 this
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
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've reached the step where the string to mix-in is generated but
I cant mix it:
-
import std.stdio;
import std.trait
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
The compiler would generate calls to toDelegate and toFunction
automatically.
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...
https://gith
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: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(
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 00:38:46 UTC, Puming wrote:
3. define all classes and use template magic to generate
companion builders just like protobuffer does. But that would
be complicated and I don't know how to do it. Do you have any
suggestion for this approach?
This would probably be a
Aren't these your words: fixing as many errors as possible always
helps even if we don't fix all errors?
I have a more pragmatic view. Do you know the issue number?
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 memo
Report for the problem when a temporary fixed-size array is
assigned to a slice, which is escaped.
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
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?
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)~
to!string(~info.timeLa
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)~
to!string(~info.timeLastAccessed.year)~
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
If you're on linux, you can try Dustmite using timeout command to
launch dmd compilation.
On Wednesday, 16 July 2014 at 07:06:12 UTC, Vlad Levenfeld wrote:
Recently I had a bug where the compiler got stuck in an
infinite loop or something. I managed to bracket it with static
if (0) and it turn
Recently I had a bug where the compiler got stuck in an infinite
loop or something. I managed to bracket it with static if (0) and
it turned out that I had intended to declare a template method
auto ref foo (Bar)() {...}
but accidentally left off the function parameters
auto ref foo (Bar) {..
36 matches
Mail list logo