Qian Xu wrote:
IMO, it does not make any sense.
s[start..end]
end - is neither the count of characters in the array slice,
nor the end index of the slice.
it is just the index after the real end character.
It might help to think of the indexes in a slice as numbering the
Sam Hu wrote:
Thank you both so much.
In DFL there is a Timer class but I can not get it work:
It compiled but just print 2 lines of message:
Before timer ...
After timer...
I am asking Chris Miller on DFL forum regarding this issue.
In DWT,there is a Runnable class I think it can gain the same
On Thu, Mar 5, 2009 at 10:45 AM, Qian Xu wrote:
> Hi Jarrett,
>
> but I need an exception here. This is an unexpected case. I want no instance
> to be create in this case.
By the time the constructor runs, an instance has already been
created. But if you throw an exception in the ctor, it's impo
Hello Daniel,
Thank you. It works.
> If that's the example, then it's out of date. It should be this:
>
> int* p;
> int[3] s;
> p = s.ptr;
Qian Xu wrote:
Jarrett Billingsley wrote:
On Thu, Mar 5, 2009 at 3:17 AM, Qian Xu
wrote:
this(char[] s, int flag) {
if (flag == 1)
{
this(1);
return;
}
else if (flag == 2)
{
this("hello");
return;
}
throw new Exception("unhandled case");
this(0); // fake
This line is unreachable. The 'thro
Jarrett Billingsley wrote:
> On Thu, Mar 5, 2009 at 3:17 AM, Qian Xu
> wrote:
>
>> this(char[] s, int flag) {
>> if (flag == 1)
>> {
>> this(1);
>> return;
>> }
>> else if (flag == 2)
>> {
>> this("hello");
>> return;
>> }
>> throw new Exception("unhandled case");
>> this(0); // fake
>
> This l
On Thu, 5 Mar 2009 12:52:14 + (UTC), takeshi wrote:
> Hello, I have just started learning D.
>
> I cannot compile the code in the documentation on array and pointer
> either with dmd (D 2.0) and gdmd (D 1.0).
>
> Is some compile option or cast required?
>
> int* p;
> int[3] s;
> p = s;
Try
On Thu, Mar 5, 2009 at 3:17 AM, Qian Xu wrote:
> this(char[] s, int flag) {
> if (flag == 1)
> {
> this(1);
> return;
> }
> else if (flag == 2)
> {
> this("hello");
> return;
> }
> throw new Exception("unhandled case");
> this(0); // fake
This line is
takeshi wrote:
> Hello, I have just started learning D.
>
> I cannot compile the code in the documentation on array and pointer
> either with dmd (D 2.0) and gdmd (D 1.0).
>
> Is some compile option or cast required?
>
> int* p;
> int[3] s;
> p = s;
If that's the example, then it's out of dat
Hello, I have just started learning D.
I cannot compile the code in the documentation on array and pointer
either with dmd (D 2.0) and gdmd (D 1.0).
Is some compile option or cast required?
int* p;
int[3] s;
p = s;
Hi All,
I have got a warning by compiling ("gdc file -Wall") the following code
--
module unreachable;
class Foo {
this(int i) {}
this(char[] s) {}
this(char[] s, int flag) {
if (flag == 1)
{
this(1);
return;
}
11 matches
Mail list logo