Re: Is this a bug?

2013-01-16 Thread David Nadlinger
Yes, this seems to be a DMD codegen bug – works with LDC. David

Strategy to link/include library

2013-01-16 Thread o3o
Suppose I have the following library structure (from Andrei Alexandrescu 'The D Programming Language' pag. 352) acme ├── algebra.d └── io └── file.d // acme/algebra.d module algebra; import std.stdio; public void gun() { writeln(algebra-gun); } // acme/io/file.d import std.stdio;

Re: Strategy to link/include library

2013-01-16 Thread Jacob Carlborg
On 2013-01-16 12:25, o3o wrote: Suppose I have the following library structure (from Andrei Alexandrescu 'The D Programming Language' pag. 352) acme ├── algebra.d └── io └── file.d // acme/algebra.d module algebra; import std.stdio; public void gun() { writeln(algebra-gun); } //

tiny std.datetime question

2013-01-16 Thread n00b
Hello, I'm kinda ashamed to ask that here, but std.datetime documentation is so complex... I only want to get hour/minute from a t_time (no timezone). I'm moving to D2, the equivalent code in D1 was: std.date.Date date; date.parse(std.date.toUTCString(time)); date.hour;

Re: tiny std.datetime question

2013-01-16 Thread n00b
Nevermind, found it myself. SysTime* sys = new SysTime(standardTime, UTC()); sys.hour; Le 16/01/2013 08:07, n00b a écrit : Hello, I'm kinda ashamed to ask that here, but std.datetime documentation is so complex... I only want to get hour/minute from a t_time (no timezone). I'm moving to D2,

Re: Strategy to link/include library

2013-01-16 Thread o3o
On Wednesday, 16 January 2013 at 12:00:54 UTC, Jacob Carlborg wrote: Thanks for your prompt response. [cut] You usually place it in a common directory. You then use the -I switch to make the compiler aware of this directory. Let me play with some scenario: I've a library 'acme' release 1.0

Re: tiny std.datetime question

2013-01-16 Thread Jonathan M Davis
On Wednesday, January 16, 2013 09:15:39 n00b wrote: Nevermind, found it myself. SysTime* sys = new SysTime(standardTime, UTC()); sys.hour; Le 16/01/2013 08:07, n00b a écrit : Hello, I'm kinda ashamed to ask that here, but std.datetime documentation is so complex... I only want to get

Re: Strategy to link/include library

2013-01-16 Thread Jacob Carlborg
On 2013-01-16 16:08, o3o wrote: Let me play with some scenario: I've a library 'acme' release 1.0 and two client C1 and C2. * scenario 1: acme in common directory + acme ... + C1 ... + C2 ... So, in C1 $dms -I../acme *.d and in C2 $dms -I../acme *.d suppose that C2 need a new

Re: Passing shared delegates

2013-01-16 Thread Martin Drasar
Okay, I have hit another thing when dealing with shared delegates. Consider this code: alias void delegate (B b) shared Callback; class A { private B _b; this (B b) { _b = b; } void callback (B b) shared { b.execute(callback); //_b.execute(callback); --

UFCS opDispatch

2013-01-16 Thread Nick Sabalausky
Unfortunately, opDispatch [silently] takes precedence over UFCS. I don't suppose there's any way to make a UFCS function call override opDispatch without either ditching UFCS or altering/removing the opDispatch itself?

Re: UFCS opDispatch

2013-01-16 Thread Simen Kjaeraas
On 2013-01-16, 22:02, Nick Sabalausky wrote: Unfortunately, opDispatch [silently] takes precedence over UFCS. I don't suppose there's any way to make a UFCS function call override opDispatch without either ditching UFCS or altering/removing the opDispatch itself? Only solution I know of is to

Re: tiny std.datetime question

2013-01-16 Thread n00b
Le 16/01/2013 10:54, Jonathan M Davis a écrit : On Wednesday, January 16, 2013 09:15:39 n00b wrote: Nevermind, found it myself. SysTime* sys = new SysTime(standardTime, UTC()); sys.hour; Le 16/01/2013 08:07, n00b a écrit : Hello, I'm kinda ashamed to ask that here, but std.datetime

Re: Passing shared delegates

2013-01-16 Thread Maxim Fomin
On Wednesday, 16 January 2013 at 20:05:40 UTC, Martin Drasar wrote: Okay, I have hit another thing when dealing with shared delegates. If I uncomment that line I get this error: Error: function main.B.execute (void delegate(B b) shared c) is not callable using argument types (void delegate(B

Re: tiny std.datetime question

2013-01-16 Thread Minas Mina
On Wednesday, 16 January 2013 at 14:15:46 UTC, n00b wrote: Nevermind, found it myself. SysTime* sys = new SysTime(standardTime, UTC()); sys.hour; Le 16/01/2013 08:07, n00b a écrit : Hello, I'm kinda ashamed to ask that here, but std.datetime documentation is so complex... I only want to get

UDA syntax

2013-01-16 Thread Joseph Cassman
I was wondering what the syntax is for user defined attributes (i.e. bug 9222) implemented in release 2.061. I was still unclear after reading the thread forum.dlang.org/thread/k7afq6$2832$1...@digitalmars.com. Thanks for the help Joseph

BitArray new design - slice problems

2013-01-16 Thread Era Scarecrow
Well got a few curious problems. Slicing doesn't seem it wants to work as a separate type and can cause problems. Let's take an example. Say our slice is.. struct BitArraySlice { BitArray* ba; ulong start, end; } Now how much does it depend on the bitarray that it's pointing

Re: UDA syntax

2013-01-16 Thread Ali Çehreli
On 01/16/2013 05:59 PM, Joseph Cassman wrote: I was wondering what the syntax is for user defined attributes (i.e. bug 9222) implemented in release 2.061. I was still unclear after reading the thread forum.dlang.org/thread/k7afq6$2832$1...@digitalmars.com. Thanks for the help Joseph The

Re: UDA syntax

2013-01-16 Thread Era Scarecrow
On Thursday, 17 January 2013 at 04:38:14 UTC, Ali Çehreli wrote: On 01/16/2013 05:59 PM, Joseph Cassman wrote: I was wondering what the syntax is for user defined attributes (I.e. bug 9222) implemented in release 2.061. I was still unclear after reading the thread

Re: tiny std.datetime question

2013-01-16 Thread Rob T
On Wednesday, 16 January 2013 at 13:07:48 UTC, n00b wrote: Hello, I'm kinda ashamed to ask that here, but std.datetime documentation is so complex... You'll likely have a much easier time reading this. http://vibed.org/temp/d-programming-language.org/phobos/std/datetime.html Those pages are

Re: tiny std.datetime question

2013-01-16 Thread Jonathan M Davis
On Thursday, January 17, 2013 07:15:14 Rob T wrote: On Wednesday, 16 January 2013 at 13:07:48 UTC, n00b wrote: Hello, I'm kinda ashamed to ask that here, but std.datetime documentation is so complex... You'll likely have a much easier time reading this.

Re: tiny std.datetime question

2013-01-16 Thread Rob T
On Thursday, 17 January 2013 at 06:26:21 UTC, Jonathan M Davis wrote: On Thursday, January 17, 2013 07:15:14 Rob T wrote: On Wednesday, 16 January 2013 at 13:07:48 UTC, n00b wrote: Hello, I'm kinda ashamed to ask that here, but std.datetime documentation is so complex... You'll likely have a

Re: UDA syntax

2013-01-16 Thread Ali Çehreli
On 01/16/2013 09:45 PM, Era Scarecrow wrote: (Do they have to be structs?) If they don't and you add code, can that code help/add or modify the attributed object (or can it at all?). It looks like some mixin magic can be used. Do the structs have to be empty? They can have members.

Re: tiny std.datetime question

2013-01-16 Thread Jonathan M Davis
On Thursday, January 17, 2013 07:57:51 Rob T wrote: Yeah, I was amazed at how much simpler things became after better formatting and organization was applied. Beforehand people were asking for std.datetime to be broken up, but no need anymore, although maybe the part on benchmarking and

Re: UDA syntax

2013-01-16 Thread Era Scarecrow
On Thursday, 17 January 2013 at 06:55:57 UTC, Ali Çehreli wrote: On 01/16/2013 09:45 PM, Era Scarecrow wrote: (Do they have to be structs?) If they don't and you add code, can that code help/add or modify the attributed object (or can it at all?). It looks like some mixin magic can be used.

Re: UDA syntax

2013-01-16 Thread Jacob Carlborg
On 2013-01-17 02:59, Joseph Cassman wrote: I was wondering what the syntax is for user defined attributes (i.e. bug 9222) implemented in release 2.061. I was still unclear after reading the thread forum.dlang.org/thread/k7afq6$2832$1...@digitalmars.com. Here's the documentation: