On Thursday, 16 April 2015 at 20:08:30 UTC, H. S. Teoh wrote:
On Thu, Apr 16, 2015 at 07:55:52PM +, Bayan Rafeh via
Digitalmars-d-learn wrote:
Executing this code:
import std.container.array;
import std.stdio;
int main() {
writeln(Array!int([1, 2]));
return 0;
}
outputs
Executing this code:
import std.container.array;
import std.stdio;
int main() {
writeln(Array!int([1, 2]));
return 0;
}
outputs the following:
Array!int(RefCounted!(Payload,
cast(RefCountedAutoInitialize)0)(RefCountedStore(B694B0)))
The strange thing is that this works fine:
but please, take my words with a grain of salt. i'm in no way a
representative of D devs. that is how *i* understand
invariants. it seems to be consistent with the cases where
invariant works,
This is the first serious project I do with D, so I'm kind of
discovering the language as I write
Bug report at https://issues.dlang.org/show_bug.cgi?id=14051
you are trying to use invariants for the things that invariants
can't
(and must not) check. invariants are meant for checking
*internal*
*object* *consistency*. NOT correctness. NOT applicability. ONLY
consistency. object can be in "inapplicable" state, but still
consistent.
Then I must have
the thing is that your invariant is not a correct invariant at
all.
invariants are meant to check *internal* object consistency,
not external
conditions. compiler is free to call invariant block at any
time after
object is properly initialised (i.e. after ctor is complete)
and is not
executin
On Sunday, 25 January 2015 at 22:46:56 UTC, Ali Çehreli wrote:
On 01/25/2015 02:06 PM, Bayan Rafeh wrote:
is invariant() called during the destruction phase?
Something is fishy.
import std.stdio;
void main(){
writeln("entered main");
auto a = new A();
writeln("leaving main");
}
On Sunday, 25 January 2015 at 19:15:54 UTC, ketmar wrote:
On Sun, 25 Jan 2015 08:41:24 +, Bayan Rafeh wrote:
I tried what you said and I think I see the problem. I
managed to
create an example program that duplicates the problem:
import std.stdio;
class A {
string path;
this(st
On Sunday, 25 January 2015 at 08:39:42 UTC, Bayan Rafeh wrote:
On Sunday, 25 January 2015 at 00:43:43 UTC, Vladimir Panteleev
wrote:
On Saturday, 24 January 2015 at 12:16:38 UTC, Bayan Rafeh
wrote:
This problem is a tough one. I've been getting this error
when I run my unittests, and apparently
On Sunday, 25 January 2015 at 00:43:43 UTC, Vladimir Panteleev
wrote:
On Saturday, 24 January 2015 at 12:16:38 UTC, Bayan Rafeh wrote:
This problem is a tough one. I've been getting this error when
I run my unittests, and apparently it is caused by attempting
an allocation in the destructor fro
This problem is a tough one. I've been getting this error when I
run my unittests, and apparently it is caused by attempting an
allocation in the destructor from what little I could find online
about the subject.
The error is triggered once all my tests are complete, so I'm
assuming the garba
On Saturday, 24 January 2015 at 11:18:57 UTC, ketmar wrote:
On Sat, 24 Jan 2015 11:17:03 +, Bayan Rafeh wrote:
Apparently byKeyValue does not exist for associative arrays,
should it?
void main() {
int[string] a;
a.byKeyValue(); //Error: byKeyValue doesn't exist.
}
If it shouldn
Apparently byKeyValue does not exist for associative arrays,
should it?
void main() {
int[string] a;
a.byKeyValue(); //Error: byKeyValue doesn't exist.
}
If it shouldn't could someone remove it from the documentation?
http://dlang.org/hash-map.html
Compiling a simple program using std.regex:
import std.regex;
import std.stdio;
void main(string[] args) {
auto re = regex(args[1], "g");
foreach(line; stdin.byLine)
if(line.match(re))
writeln(line);
}
Renders a 1.6 megabyte binary. Is that normal?
14 matches
Mail list logo