What's the difference between static class and static struct?
What should i use?
__traits(allMembers, mixin(__MODULE__)) also yields a module name
like object, but then how can you find out that object is a
module?
This doesn't work:
void main() {
pragma(msg, is(int == int));
pragma(msg, is(object == module));
}
Bye,
bearophile
On 1/24/15 11:15 AM, Meta wrote:
On Saturday, 24 January 2015 at 08:44:45 UTC, Ali Çehreli wrote:
On 01/24/2015 12:14 AM, Meta wrote:
import std.stdio;
void main()
{
foreach (i, line; file.byLine())
Unless the range itself provides explicitly, automatic counter is
available only for
On Monday, 26 January 2015 at 14:02:54 UTC, ref2401 wrote:
What's the difference between static class and static struct?
What should i use?
Non-static structs/classes have an extra pointer. Static ones
don't have it, so their differences are the usual ones: a class
is used by reference and
Bug report at https://issues.dlang.org/show_bug.cgi?id=14051
At the moment it goes straight go code.dlang.org, which may be a
bit overwhelming if you have just arrived at dlang.org and want
to see what it can do.
Is it worth changing to the library wiki write up page on
libraries? And making sure link to code.dlang.org is prominent,
saying
What's the preferred way of declaring run-time constant values in
D from the point of view of
1, compile-time performance
2. run-time performance
3. code-size
4. load-time
5. locality of reference module global or function global (static)
On Mon, 26 Jan 2015 20:04:58 +, Nordlöw wrote:
What's the preferred way of declaring run-time constant values in D from
the point of view of
1, compile-time performance 2. run-time performance 3. code-size 4.
load-time 5. locality of reference module global or function global
(static)
On Mon, 26 Jan 2015 11:37:12 +, Bayan Rafeh wrote:
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
On Monday, 26 January 2015 at 15:54:12 UTC, Bayan Rafeh wrote:
I apologize, I thought the point of invariant was to ensure
correctness of the
object's state
It is simply matter of internal correctness vs in-program
correctness. Sorry, documentation should probably mention that
explicitly. I
On Sunday, 25 January 2015 at 22:14:09 UTC, Adam D. Ruppe wrote:
On Sunday, 25 January 2015 at 21:24:06 UTC, Suliman wrote:
I need extract data inside rel (somedata)
string s = element.rel;
Do you mean something like this?
string s = element.rel;
foreach(row;
On Monday, 26 January 2015 at 17:24:23 UTC, Adam D. Ruppe wrote:
On Monday, 26 January 2015 at 17:17:55 UTC, Suliman wrote:
Do you mean something like this?
I just mean to get the value of the rel=something attribute,
use
element.rel;
assert(element.rel == something);
The element is the
On Monday, 26 January 2015 at 17:17:55 UTC, Suliman wrote:
Do you mean something like this?
I just mean to get the value of the rel=something attribute, use
element.rel;
assert(element.rel == something);
The element is the thing you see in the loop and stuff.
querySelectorAll returns an
On Monday, 26 January 2015 at 21:33:10 UTC, Piotrek wrote:
On Monday, 26 January 2015 at 14:11:32 UTC, bearophile wrote:
Non-static structs/classes have an extra pointer.
Bye,
bearophile
Since when structs have an extra pointer? Maybe you are talking
about nested structs?
Non-static means
I'm having trouble using dub. Nothing seems to work (-h works
though). I would like an example or two of how to get an app
going (stand alone for now). I'm using the Mac OS.
On Tue, Jan 27, 2015 at 04:38:57AM +, David Monagle via Digitalmars-d-learn
wrote:
Hi guys,
I'm a former C++ developer and really enjoying working with D now. I
have a question that I hope some of you may be able to answer.
class Parent {
@property string typeName() {
return
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
Hi guys,
I'm a former C++ developer and really enjoying working with D
now. I have a question that I hope some of you may be able to
answer.
class Parent {
@property string typeName() {
return typeof(this).stringof;
}
}
class Child : Parent {
}
void main() {
auto p = new Parent;
On Tuesday, 27 January 2015 at 06:16:03 UTC, H. S. Teoh wrote:
On Tue, Jan 27, 2015 at 06:02:38AM +, Gan via
Digitalmars-d-learn wrote:
On Tuesday, 27 January 2015 at 06:00:50 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 05:32:09 UTC, Gan wrote:
Hey I'm using normal arrays for my project:
I can certainly work with that. Thank you very much! (and for
pointing out my typo in the example)
On Tue, Jan 27, 2015 at 06:02:38AM +, Gan via Digitalmars-d-learn wrote:
On Tuesday, 27 January 2015 at 06:00:50 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 05:32:09 UTC, Gan wrote:
Hey I'm using normal arrays for my project:
//Declaring the array
SBTile[] tiles;
//Initializing the
On Tuesday, 27 January 2015 at 05:32:09 UTC, Gan wrote:
Hey I'm using normal arrays for my project:
//Declaring the array
SBTile[] tiles;
//Initializing the array
tiles = new SBTile[](0);
//Clearing the array
tiles = [];
//Removing a tile at index i from the array
tiles.remove(i);
//Adding a
On Tuesday, 27 January 2015 at 06:00:50 UTC, Gan wrote:
On Tuesday, 27 January 2015 at 05:32:09 UTC, Gan wrote:
Hey I'm using normal arrays for my project:
//Declaring the array
SBTile[] tiles;
//Initializing the array
tiles = new SBTile[](0);
//Clearing the array
tiles = [];
//Removing a
On 27/01/2015 8:03 p.m., Joel wrote:
I'm having trouble using dub. Nothing seems to work (-h works though). I
would like an example or two of how to get an app going (stand alone for
now). I'm using the Mac OS.
Lets use Devisualization.Window as an example.
Assuming in a safe directory and
On 27/01/2015 8:40 p.m., Joel wrote:
On Tuesday, 27 January 2015 at 07:25:18 UTC, Rikki Cattermole
wrote:
On 27/01/2015 8:03 p.m., Joel wrote:
I'm having trouble using dub. Nothing seems to work (-h works though). I
would like an example or two of how to get an app going (stand alone for
now).
On Tuesday, 27 January 2015 at 07:25:18 UTC, Rikki Cattermole
wrote:
On 27/01/2015 8:03 p.m., Joel wrote:
I'm having trouble using dub. Nothing seems to work (-h works
though). I
would like an example or two of how to get an app going (stand
alone for
now). I'm using the Mac OS.
Lets use
On Monday, 26 January 2015 at 02:18:05 UTC, Mike Parker wrote:
On 1/26/2015 5:45 AM, Roman wrote:
Stuff:
1. There are C code module.c and module.h
2. MinGW
3. DMD 2.066.1
4. Window 8.1
module.c:
#include module.h
int add(int a, int b) {return a + b;}
module.h:
int add(int,int);
I want to
On Monday, 26 January 2015 at 07:52:06 UTC, Gan wrote:
I've been working on my game and am getting some pretty gnarly
memory problems. I think it's how I'm allocating.
Sometimes when I use variables I can do Color(255, 255, 255).
But why is that different than new Color(255, 255, 255)?
Same
Right now, any attempt to have symbols with the same name errors
out, regardless of how they're used. This caused a problem for
me because I'm trying to use a third-party C library that defines
a struct type called socket and my code calls that library and
some networking modules from
On Monday, 26 January 2015 at 11:15:26 UTC, Joakim wrote:
Right now, any attempt to have symbols with the same name
errors out, regardless of how they're used. This caused a
problem for me because I'm trying to use a third-party C
library that defines a struct type called socket and my code
On Monday, 26 January 2015 at 11:15:26 UTC, Joakim wrote:
Right now, any attempt to have symbols with the same name
errors out, regardless of how they're used. This caused a
problem for me because I'm trying to use a third-party C
library that defines a struct type called socket and my code
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
On Monday, 26 January 2015 at 11:30:00 UTC, Daniel Kozak wrote:
On Monday, 26 January 2015 at 11:15:26 UTC, Joakim wrote:
Right now, I had to go through and selectively import all 14
symbols I needed from the 3 druntime modules that publicly
import core.sys.posix.sys.socket, so that the
Is there a way to tell DUB to compile all its sources as separate
objects which are then fed to ld.
My project has grown beyound 10k lines of code.
And I don't want DMD to recompile every line in my project if I
change only of them...and yes most of my cross-module interfaces
are
On Monday, 26 January 2015 at 22:33:21 UTC, Nordlöw wrote:
Is there a way to tell DUB to compile all its sources as
separate objects which are then fed to ld.
For reference here's the DUB build file for my project:
https://github.com/nordlow/justd/blob/master/knetquery/dub.json
On Monday, 26 January 2015 at 22:51:44 UTC, Nordlöw wrote:
On Monday, 26 January 2015 at 22:33:21 UTC, Nordlöw wrote:
Is there a way to tell DUB to compile all its sources as
separate objects which are then fed to ld.
And, yes, I'm using ld.gold as my default linker ;)
On Monday, 26 January 2015 at 22:41:09 UTC, Adam D. Ruppe wrote:
On Monday, 26 January 2015 at 22:33:21 UTC, Nordlöw wrote:
My project has grown beyound 10k lines of code.
Eh, that's nothing, especially if they aren't templates. dmd
will compile that in a fraction of a second (and even then,
On 27/01/2015 2:25 a.m., bearophile wrote:
__traits(allMembers, mixin(__MODULE__)) also yields a module name like
object, but then how can you find out that object is a module?
This doesn't work:
void main() {
pragma(msg, is(int == int));
pragma(msg, is(object == module));
}
Bye,
On 27/01/2015 8:29 a.m., Laeeth Isharc wrote:
At the moment it goes straight go code.dlang.org, which may be a bit
overwhelming if you have just arrived at dlang.org and want to see what
it can do.
Is it worth changing to the library wiki write up page on libraries?
And making sure link to
On Monday, 26 January 2015 at 22:41:09 UTC, Adam D. Ruppe wrote:
On Monday, 26 January 2015 at 22:33:21 UTC, Nordlöw wrote:
My project has grown beyound 10k lines of code.
Eh, that's nothing, especially if they aren't templates. dmd
will compile that in a fraction of a second (and even then,
On Monday, 26 January 2015 at 22:33:21 UTC, Nordlöw wrote:
My project has grown beyound 10k lines of code.
Eh, that's nothing, especially if they aren't templates. dmd will
compile that in a fraction of a second (and even then, if you
used phobos, reading the stdlib into memory will dominate
On Monday, 26 January 2015 at 22:46:46 UTC, Nordlöw wrote:
On Monday, 26 January 2015 at 22:44:26 UTC, Nordlöw wrote:
Ok, then it's more than that. It takes 7 seconds:
time dub build
time dub build --combined --force
is in the same order - around 7 seconds.
Why is DUB compiling it all in
On Monday, 26 January 2015 at 22:44:26 UTC, Nordlöw wrote:
Ok, then it's more than that. It takes 7 seconds:
time dub build
time dub build --combined --force
is in the same order - around 7 seconds.
On Monday, 26 January 2015 at 22:46:46 UTC, Nordlöw wrote:
On Monday, 26 January 2015 at 22:44:26 UTC, Nordlöw wrote:
Ok, then it's more than that. It takes 7 seconds:
time dub build
time dub build --combined --force
is in the same order - around 7 seconds.
The only way I managed to
On Monday, 26 January 2015 at 14:11:32 UTC, bearophile wrote:
Non-static structs/classes have an extra pointer.
Bye,
bearophile
Since when structs have an extra pointer? Maybe you are talking
about nested structs?
Piotrek
45 matches
Mail list logo