On Friday, 13 January 2023 at 05:17:59 UTC, thebluepandabear
wrote:
(Sorry if this is a duplicate.)
If I have the following code inside of a module:
```D
class Obj {
private {
string name = "Hi";
}
}
class ObjDerived : Obj {
}
```
Is it best practice to define `ObjDerived` in
(Sorry if this is a duplicate.)
If I have the following code inside of a module:
```D
class Obj {
private {
string name = "Hi";
}
}
class ObjDerived : Obj {
}
```
Is it best practice to define `ObjDerived` inside another module,
since `ObjDerived` can still access the members
On Monday, 15 October 2018 at 04:14:24 UTC, IM wrote:
What is the effect of calling destroy?
- calling the destructor?
- deallocating the memory?
- both?
It calls the destructor. The GC will deallocate the object's
memory later. However, you need to be careful about how you use
GC-allocated
On Monday, 15 October 2018 at 04:14:24 UTC, IM wrote:
What is the effect of calling destroy?
- calling the destructor?
- deallocating the memory?
- both?
IIRC, it only calls the destructor, the GC will decide when to
deallocate the memory.
On Monday, 15 October 2018 at 03:33:04 UTC, Basile B. wrote:
On Monday, 15 October 2018 at 03:19:07 UTC, IM wrote:
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would allocati
On Monday, 15 October 2018 at 03:19:07 UTC, IM wrote:
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would allocating an instance on the heap using:
S* s = new S;
use the GC,
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would allocating an instance on the heap using:
S* s = new S;
use the GC, or do we have to call destroy() or delete on s
ourselv
On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote:
There are a lot of discussions in the forums about how @property
should or could be implemented. But I can't seem to find
anything
that explains why or when I should use @property with the
current
compiler. Can anyone explain why and when I
On Sunday, 20 July 2014 at 18:14:29 UTC, Eric wrote:
Use @property when you want a pseudo-variable or something
that might be conceptually considered a "property" of the
object, i.e. to do this:
auto blah = thing.someProperty;
thing.someProperty = blahblah;
This is basically what I suspec
On Sunday, 20 July 2014 at 18:14:29 UTC, Eric wrote:
Use @property when you want a pseudo-variable or something
that might be conceptually considered a "property" of the
object, i.e. to do this:
auto blah = thing.someProperty;
thing.someProperty = blahblah;
This is basically what I suspec
On 7/21/2014 3:14 AM, Eric wrote:
Use @property when you want a pseudo-variable or something that might
be conceptually considered a "property" of the object, i.e. to do this:
auto blah = thing.someProperty;
thing.someProperty = blahblah;
This is basically what I suspected. But why
write:
On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote:
There are a lot of discussions in the forums about how @property
should or could be implemented. But I can't seem to find
anything
that explains why or when I should use @property with the
current
compiler. Can anyone explain why and when
On 07/20/2014 11:14 AM, Eric wrote:
>
>> Use @property when you want a pseudo-variable or something that might
>> be conceptually considered a "property" of the object, i.e. to do this:
>>
>> auto blah = thing.someProperty;
>> thing.someProperty = blahblah;
>
> This is basically what I suspected.
On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote:
There are a lot of discussions in the forums about how @property
should or could be implemented. But I can't seem to find
anything
that explains why or when I should use @property with the
current
compiler. Can anyone explain why and when
On Sunday, 20 July 2014 at 17:59:07 UTC, John Colvin wrote:
On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote:
There are a lot of discussions in the forums about how
@property
should or could be implemented. But I can't seem to find
anything
that explains why or when I should use @property
Use @property when you want a pseudo-variable or something that
might be conceptually considered a "property" of the object,
i.e. to do this:
auto blah = thing.someProperty;
thing.someProperty = blahblah;
This is basically what I suspected. But why
write:
@property int getValue() { retur
There are a lot of discussions in the forums about how @property
should or could be implemented. But I can't seem to find anything
that explains why or when I should use @property with the current
compiler. Can anyone explain why and when I should use the
@property tag?
Thx.
Eric
thx sergey my example work correctly now :D
Thu, 06 Aug 2009 10:56:33 -0400, lllTattoolll wrote:
> hi Lars and thx for help. I fix a little the first problem, now I paste a
> verion in english whit coment because i´m lost here.
> the example is the same only this is in english for your compresion of my
> problem.
>
>
Reply to llltattoolll,
writefln ("Your age is %d? \t YES \t NO", _age ); /* here is my second
problem, can´t into the response and program*/
_response = readln(); /* show me else line always */
// if all else fails, what are you getting
writef(">>%s<<\n", cast(ubyte[])chomp(_response));
hi Lars and thx for help. I fix a little the first problem, now I paste a
verion in english whit coment because i´m lost here.
the example is the same only this is in english for your compresion of my
problem.
--
code
--
Lars T. Kyllingstad wrote:
llltattoolll wrote:
hi im noob here and try learn D language, i try make this example but
when run have 2 problems.
1) when i show name and lastname show me in two lines and i wanna make
in the same line.
2) can´t validate option si ( yes ) or no ( no ) and always s
llltattoolll wrote:
hi im noob here and try learn D language, i try make this example but when run
have 2 problems.
1) when i show name and lastname show me in two lines and i wanna make in the
same line.
2) can´t validate option si ( yes ) or no ( no ) and always show the else line.
what hap
hi im noob here and try learn D language, i try make this example but when run
have 2 problems.
1) when i show name and lastname show me in two lines and i wanna make in the
same line.
2) can´t validate option si ( yes ) or no ( no ) and always show the else line.
what happend?
thx
---
24 matches
Mail list logo