On Tuesday, 20 November 2018 at 03:24:56 UTC, Neia Neutuladh
wrote:
On Tue, 20 Nov 2018 00:30:44 +, Jordi Gutiérrez Hermoso
wrote:
On Monday, 19 November 2018 at 21:57:11 UTC, Neia Neutuladh
wrote:
Programmers coming from nearly any language other than C++
would find it expected and intui
On Tuesday, 20 November 2018 at 00:30:44 UTC, Jordi Gutiérrez
Hermoso wrote:
On Monday, 19 November 2018 at 21:57:11 UTC, Neia Neutuladh
wrote:
[...]
What do you think about making the syntax slightly more
explicit and warn or possibly error out if you don't do it that
way? Either
Some
On Monday, November 19, 2018 5:30:00 PM MST Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 11/19/18 7:21 PM, Jordi Gutiérrez Hermoso wrote:
> > On Monday, 19 November 2018 at 21:52:47 UTC, Steven Schveighoffer wrote:
> >> A null pointer dereference is an immediate error, and it's also a
On Tue, 20 Nov 2018 00:30:44 +, Jordi Gutiérrez Hermoso wrote:
> On Monday, 19 November 2018 at 21:57:11 UTC, Neia Neutuladh wrote:
>
>> Programmers coming from nearly any language other than C++ would find
>> it expected and intuitive that declaring a class instance variable
>> leaves it null
On Mon, 19 Nov 2018 14:32:55 -0800, H. S. Teoh wrote:
>> Standard caveats about byte order and alignment.
>
> Alignment shouldn't be a problem, since local variables should already
> be properly aligned.
Right, and the IO layer probably doesn't need to read to aligned memory
anyway.
Struct fiel
On Tuesday, 20 November 2018 at 00:30:44 UTC, Jordi Gutiérrez
Hermoso wrote:
Yeah, maybe this bit of C++ syntax isn't the best idea. What
about other alternatives?
You could try testing for null before dereferencing ;-)
If the following code in D, did what you'd reasonably expect it
to do,
On Monday, 19 November 2018 at 21:57:11 UTC, Neia Neutuladh wrote:
Programmers coming from nearly any language other than C++
would find it expected and intuitive that declaring a class
instance variable leaves it null.
What do you think about making the syntax slightly more explicit
and war
On 11/19/18 7:21 PM, Jordi Gutiérrez Hermoso wrote:
On Monday, 19 November 2018 at 21:52:47 UTC, Steven Schveighoffer wrote:
A null pointer dereference is an immediate error, and it's also a safe
error. It does not cause corruption, and it is free (the MMU is doing
it for you).
Is this alway
On Monday, 19 November 2018 at 21:52:47 UTC, Steven Schveighoffer
wrote:
A null pointer dereference is an immediate error, and it's also
a safe error. It does not cause corruption, and it is free (the
MMU is doing it for you).
Is this always true for all arches that D can compile to? I
reme
On Mon, Nov 19, 2018 at 10:14:25PM +, Neia Neutuladh via
Digitalmars-d-learn wrote:
> On Mon, 19 Nov 2018 21:30:36 +, welkam wrote:
> > So my question is in subject/title. I want to parse binary file into D
> > structs and cant really find any good way of doing it. What I try to do
> > now
On Mon, 19 Nov 2018 21:30:36 +, welkam wrote:
> So my question is in subject/title. I want to parse binary file into D
> structs and cant really find any good way of doing it. What I try to do
> now is something like this
>
> byte[4] fake_integer;
> auto fd = File("binary.data", "r");
> fd.raw
On Mon, 19 Nov 2018 21:23:31 +, Jordi Gutiérrez Hermoso wrote:
> When I was first playing with D, I managed to create a segfault by doing
> `SomeClass c;` and then trying do something with the object I thought I
> had default-created, by analogy with C++ syntax. Seasoned D programmers
> will re
On 11/19/18 4:23 PM, Jordi Gutiérrez Hermoso wrote:
When I was first playing with D, I managed to create a segfault by doing
`SomeClass c;` and then trying do something with the object I thought I
had default-created, by analogy with C++ syntax. Seasoned D programmers
will recognise that I did
On Monday, 19 November 2018 at 21:23:31 UTC, Jordi Gutiérrez
Hermoso wrote:
What's the reasoning for allowing this?
The mistake is immediately obvious when you run the program, so I
just don't see it as a big deal. You lose a matter of seconds,
realize the mistake, and fix it.
What is your
So my question is in subject/title. I want to parse binary file
into D structs and cant really find any good way of doing it.
What I try to do now is something like this
byte[4] fake_integer;
auto fd = File("binary.data", "r");
fd.rawRead(fake_integer);
int real_integer = *(cast(int*) fake_int
When I was first playing with D, I managed to create a segfault
by doing `SomeClass c;` and then trying do something with the
object I thought I had default-created, by analogy with C++
syntax. Seasoned D programmers will recognise that I did nothing
of the sort and instead created c is null an
On Monday, 19 November 2018 at 10:04:25 UTC, willo wrote:
Im trying to get MSVC to debug my binary. I've added...
"dflags": ["-g"],
at the top level in dub.json to try and get LDC to generate
debug info. But doesnt seem to have done anything.
I guess you need `-g` for the `lflags` too, assum
On Monday, 19 November 2018 at 17:18:14 UTC, John Chapman wrote:
1) task(&ddCall.dd)
Thanks, that helped.
On Monday, 19 November 2018 at 16:29:01 UTC, helxi wrote:
On Monday, 19 November 2018 at 16:10:15 UTC, helxi wrote:
...
Oh wait never mind I was missing a bracket:
auto proc = task!(ddCall.dd());
Now I have another thing to worry about: ddcall.dd() cannot be
read at compile time
On Monday, 19 November 2018 at 16:10:15 UTC, helxi wrote:
...
Oh wait never mind I was missing a bracket:
auto proc = task!(ddCall.dd());
Now I have another thing to worry about: ddcall.dd() cannot be
read at compile time.
I want to create a task out of an object's method. My Class is:
public class Calldd
{
private:
const string tmpFileName = "/tmp/nixwriter.progress.txt";
string deviceName, sourceFileName;
public:
this(in string sourceFileName, in string deviceName)
{
this.sourceFileName =
On Monday, 19 November 2018 at 14:51:14 UTC, Steven Schveighoffer
wrote:
Or just use inout. This is literally what inout is for:
inout(q32) toQ32 inout {
return q32(x);
}
This should transfer whatever constancy of the original is used
for the return value.
Yep, I just wanted to explici
On Monday, 19 November 2018 at 14:04:29 UTC, Dennis wrote:
On Monday, 19 November 2018 at 13:34:50 UTC, Stanislav Blinov
wrote:
Because it's not mutation, it's initialization.
Oh. That's an epiphany for me.
:)
When a ctor is `pure`, the compiler knows it doesn't mutate
any state other
On 11/18/18 1:17 PM, Stanislav Blinov wrote:
On Sunday, 18 November 2018 at 17:30:18 UTC, Dennis wrote:
I'm making a fixed point numeric type and want it to work correctly
with const. First problem:
```
const q16 a = 6;
a /= 2; // compiles! despite `a` being const.
Ouch. That's actu
On Monday, 19 November 2018 at 13:34:50 UTC, Stanislav Blinov
wrote:
Because it's not mutation, it's initialization.
Oh. That's an epiphany for me.
When a ctor is `pure`, the compiler knows it doesn't mutate any
state other than the object's, so it allows conversion to all
three qualifie
On Monday, 19 November 2018 at 12:28:43 UTC, Dennis wrote:
On Monday, 19 November 2018 at 02:39:32 UTC, Stanislav Blinov
wrote:
You're skimming the examples ;)
I'm not saying your examples don't work, I'm trying to
understand the minimum requirements. You said:
"That's [constructors needing
On Monday, 19 November 2018 at 02:39:32 UTC, Stanislav Blinov
wrote:
You're skimming the examples ;)
I'm not saying your examples don't work, I'm trying to understand
the minimum requirements. You said:
"That's [constructors needing to be pure is] only for types with
indirections (pointers)
Im trying to get MSVC to debug my binary. I've added...
"dflags": ["-g"],
at the top level in dub.json to try and get LDC to generate debug
info. But doesnt seem to have done anything.
28 matches
Mail list logo