On Wednesday, October 10, 2012 06:51:50 Val Markovic wrote:
> So if I don't need to support accepting rvalues, is there an
> argument for "in ref" over "const ref"? "in ref" looks superior:
> it's more descriptive and from what the docs say, it gives even
> more guarantees about the behavior of the
This whole topic is a bit of a thorny one in that D's design is
trying to
avoid some of the problems that allowing const T& to take
rvalues in C++
causes, but it makes a situation like what you're trying to do
annoying to
handle. And auto ref doesn't really fix it (even though that's
whole the
On Wednesday, October 10, 2012 06:39:51 Val Markovic wrote:
> On Wednesday, 10 October 2012 at 04:55:48 UTC, Val Markovic wrote:
> > Oh, and a related question: what is the best way to pass in an
> > associative array like CustomStruct[string]? I can't say I'm
> > too clear on how AA's are managed/
On Wednesday, October 10, 2012 06:27:52 Val Markovic wrote:
> TL;DR: what should I use if I need C++'s const& for a param?
>
> Long version: I have a big struct provided by a library and I'm
> trying to pass instances of it to a function that will never need
> to modify the passed in value. Natura
On Wednesday, 10 October 2012 at 04:55:48 UTC, Val Markovic wrote:
Oh, and a related question: what is the best way to pass in an
associative array like CustomStruct[string]? I can't say I'm
too clear on how AA's are managed/implemented. Do they have
value semantics or reference semantics? What
Oh, and a related question: what is the best way to pass in an
associative array like CustomStruct[string]? I can't say I'm too
clear on how AA's are managed/implemented. Do they have value
semantics or reference semantics? What about lists?
On 2012-01-10 02:10, Josh wrote:
Is there a way to do that? I've tried getenv("PROCESSOR_ARCHITECTURE")
and shell("echo %PROCESSOR_ARCHITECTURE%"), and both of them return
"x86" instead of "AMD64" like cmd. I want to use this to run a 64 bit
version of an external program if the OS is 64 b
TL;DR: what should I use if I need C++'s const& for a param?
Long version: I have a big struct provided by a library and I'm
trying to pass instances of it to a function that will never need
to modify the passed in value. Naturally I want to pass it
efficiently, without incurring a copy. I kno
On Wednesday, 10 October 2012 at 00:18:17 UTC, ixid wrote:
Is there an effective way of splitting a string with a set of
tokens? Splitter feels rather limited and multiple passes gives
you an array of arrays of strings rather than an array of
strings. I'm not sure if I'm missing an obvious appl
Is there a way to do that? I've tried
getenv("PROCESSOR_ARCHITECTURE") and shell("echo
%PROCESSOR_ARCHITECTURE%"), and both of them return "x86" instead
of "AMD64" like cmd. I want to use this to run a 64 bit version
of an external program if the OS is 64 bit, and the 32 bit
version if not.
Is there an effective way of splitting a string with a set of
tokens? Splitter feels rather limited and multiple passes gives
you an array of arrays of strings rather than an array of
strings. I'm not sure if I'm missing an obvious application of
library methods or if this is absent.
deed:
Meaning struct pointers are unusable or at least highly
unreliable?
Struct pointers are useful and reliable, but before using them
you need to know the difference between heap and stack, what a
stack frame is, and how structs are handled when they are on the
stack. Learning the basics
On Wed, Oct 10, 2012 at 12:59:08AM +0200, deed wrote:
> On Tuesday, 9 October 2012 at 16:21:47 UTC, bearophile wrote:
> >deed:
> >
> >> // Again, why are the three last adresses the same?
> >
> >The D language and its compiler is acting correctly here, so the
> >output you see is correct. All
On Tuesday, 9 October 2012 at 16:21:47 UTC, bearophile wrote:
deed:
// Again, why are the three last adresses the same?
The D language and its compiler is acting correctly here, so
the output you see is correct. All those structs are allocated
on the stack. The first three Test are a
On 09/10/2012 22:30, Andrei Alexandrescu wrote:
On 10/9/12 12:30 PM, Faux Amis wrote:
On a side-note, why is rdmd picky about argument order?
>dmd test.d -I..\include
Because anything after the program is considered an argument to the
program.
Andrei
My bad, should have read the spec bett
On 10/9/12, Andrei Alexandrescu wrote:
> I'd be bummed because that's quite a logical decision, and how other
> interpreters do it.
On second thought my solution wouldn't work. --args would still have
to be passed before the D file, and people would have to remember that
or it wouldn't work, same
On 10/9/12 4:38 PM, Andrej Mitrovic wrote:
On 10/9/12, Andrei Alexandrescu wrote:
On 10/9/12 12:30 PM, Faux Amis wrote:
On a side-note, why is rdmd picky about argument order?
>dmd test.d -I..\include
Because anything after the program is considered an argument to the
program.
Andrei
On 10/9/12, Andrei Alexandrescu wrote:
> On 10/9/12 12:30 PM, Faux Amis wrote:
>> On a side-note, why is rdmd picky about argument order?
>>
>> >dmd test.d -I..\include
>
> Because anything after the program is considered an argument to the
> program.
>
> Andrei
>
I think this is a fairly common
On 10/9/12 12:30 PM, Faux Amis wrote:
On a side-note, why is rdmd picky about argument order?
>dmd test.d -I..\include
Because anything after the program is considered an argument to the program.
Andrei
On Tuesday, 9 October 2012 at 19:04:40 UTC, Jonathan M Davis
wrote:
On Tuesday, October 09, 2012 20:09:56 Zhenya wrote:
Ok.Then can I do my own .init property that can be executed in
compile-time?
No. You directly initialize the member variables to what you
want them to be,
and that's the val
On Oct 9, 2012, at 8:44 AM, Druzhinin Alexandr wrote:
> Hello
> I spawn several threads and now I need to know if they has finished their
> job. Before I do it by means of messages from child threads to the main one
> to inform about finishing. But I'm sure this isn't good enough, because a
>
On Tuesday, October 09, 2012 20:09:56 Zhenya wrote:
> Ok.Then can I do my own .init property that can be executed in
> compile-time?
No. You directly initialize the member variables to what you want them to be,
and that's the values that they have in the init property. You can't have
anything li
On Tuesday, 9 October 2012 at 18:29:18 UTC, Jonathan M Davis
wrote:
On Tuesday, October 09, 2012 19:08:35 Zhenya wrote:
On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote:
> Hi!
> I'm sorry,maybe this topic already was discussed,but could
> anybody explain me
> why default constructor was
On Tue, 09 Oct 2012 13:51:09 -0400, Jonathan M Davis
wrote:
On Tuesday, October 09, 2012 10:29:46 Steven Schveighoffer wrote:
dcollections does not have singly-linked lists.
My mistake. I thought that you had said that it did in previous
discussions on
this topic.
I decided early on t
On Tue, Oct 09, 2012 at 07:08:35PM +0200, Zhenya wrote:
> On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote:
> >Hi!
> >I'm sorry,maybe this topic already was discussed,but could anybody
> >explain me why default constructor was disallowed in structs?
>
> And if I have to do some initializat
On Tuesday, 9 October 2012 at 18:29:18 UTC, Jonathan M Davis
wrote:
On Tuesday, October 09, 2012 19:08:35 Zhenya wrote:
On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote:
> Hi!
> I'm sorry,maybe this topic already was discussed,but could
> anybody explain me
> why default constructor was
On Tuesday, October 09, 2012 19:08:35 Zhenya wrote:
> On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote:
> > Hi!
> > I'm sorry,maybe this topic already was discussed,but could
> > anybody explain me
> > why default constructor was disallowed in structs?
>
> And if I have to do some initiali
On 10/09/2012 10:08 AM, Zhenya wrote:
On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote:
Hi!
I'm sorry,maybe this topic already was discussed,but could anybody
explain me
why default constructor was disallowed in structs?
And if I have to do some initialization of data members,what is t
On Tuesday, 9 October 2012 at 17:32:35 UTC, Zhenya wrote:
On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote:
Hi!
I'm sorry,maybe this topic already was discussed,but could
anybody explain me
why default constructor was disallowed in structs?
And if I have to do some initialization of
On Tuesday, October 09, 2012 10:29:46 Steven Schveighoffer wrote:
> dcollections does not have singly-linked lists.
My mistake. I thought that you had said that it did in previous discussions on
this topic.
- Jonathan M Davis
What does the following error mean?
wgdb.d(24): Error: function wgdb.to_string is not accessible from module
wgdb
The function in question is the pretty simple:
package string to_string(const char *zString)
{ int i;
for (i = 0; zString[i] != 0; ++i) {};
return to!string(zS
On 09-Oct-12 19:35, Adam D. Ruppe wrote:
On Tuesday, 9 October 2012 at 15:56:15 UTC, maarten van damme wrote:
Wouldn't a user then be able to launch that program followed by the
contents of a big file of say 5 gig.
The operating system won't allow that. There's a limit on argument sizes
enforc
On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote:
Hi!
I'm sorry,maybe this topic already was discussed,but could
anybody explain me
why default constructor was disallowed in structs?
And if I have to do some initialization of data members,what is
the way to do it?
On 09-Oct-12 20:36, maarten van damme wrote:
Another quick question. When I know an array is going to have an
length smaller then 255, can I use bytes as index or do I have to use
size_t to make it portable across 64 bit platforms?
The real question is why you need that? Byte is not faster (if
Hi!
I'm sorry,maybe this topic already was discussed,but could
anybody explain me
why default constructor was disallowed in structs?
Another quick question. When I know an array is going to have an
length smaller then 255, can I use bytes as index or do I have to use
size_t to make it portable across 64 bit platforms?
I get an unexpected OPTLINK termination when I run the lovely thing
below, any advice (dmd 2.060)?
rdmd --chatty --force --build-only ..\lib\libcairo-2.lib -I..\include
..\lib\libcairod.lib ..\lib\dmd_win32_x32.lib -version=Unicode
-version=WIN32_WINNT_ONLY -version=WindowsNTonly -version=Wi
Ok, that solves it. Thank you.
deed:
// Again, why are the three last adresses the same?
The D language and its compiler is acting correctly here, so the
output you see is correct. All those structs are allocated on the
stack. The first three Test are allocated on the stack. In the
loop it allocates the first str
On 09.10.2012 22:44, Druzhinin Alexandr wrote:
Hello
I spawn several threads and now I need to know if they has finished
their job. Before I do it by means of messages from child threads to the
main one to inform about finishing. But I'm sure this isn't good enough,
because a child thread may fai
Hello
I spawn several threads and now I need to know if they has finished
their job. Before I do it by means of messages from child threads to the
main one to inform about finishing. But I'm sure this isn't good enough,
because a child thread may fail before sending the exit message to the
mai
On Tuesday, 9 October 2012 at 15:56:15 UTC, maarten van damme
wrote:
Wouldn't a user then be able to launch that program followed by
the contents of a big file of say 5 gig.
The operating system won't allow that. There's a limit on
argument sizes enforced before the program actually runs.
import std.stdio;
struct Test
{
static Test[] objects;
static Test*[] psObject;
static int[] ints;
static int*[] psInt;
int a;
int b;
int* pa;
this(int a)
{
this.a = a;
this.pa = &this.a;
this.b = 2 * a;
On Sunday, 7 October 2012 at 19:23:36 UTC, Lubos Pintes wrote:
Does someone have any samples for DFL?
Here's a recent project of mine which uses DFL:
https://bitbucket.org/infognition/bsort/
On 09-Oct-12 18:46, maarten van damme wrote:
What happens when args[1].length is bigger then size_t?
Can I detect this?
Then size_t.max? It can't as it has type size_t.
Equal or even close? Nope. As it there would not be enough of even
_virtual_ memory to fit array of size_t.max and something
On Sun, 07 Oct 2012 05:15:05 -0400, Jonathan M Davis
wrote:
On Sunday, October 07, 2012 10:09:06 Russel Winder wrote:
Removal from a singly-linked list can be O(1) as well, it depends
whether you are deleting using an iterator in progress.
IIRC that dcollections' singly-linked list is like
On Tuesday, 9 October 2012 at 06:53:54 UTC, Jacob Carlborg wrote:
As far as I understand it, opDispatch needs a receiver, I.e.
this.foo() or obj.foo(). I asked the same question a while ago
and got that answer, it's by design.
I've also tried adding a opDispatch in the same struct and the
er
47 matches
Mail list logo