Re: Understanding the Behavior of i + ++i in D Language

2024-08-23 Thread IchorDev via Digitalmars-d-learn
On Friday, 23 August 2024 at 09:49:27 UTC, Nick Treleaven wrote: On Friday, 23 August 2024 at 09:42:38 UTC, Nick Treleaven wrote: C++: undefined, could be `6 + 6` if the increment is done first. g++ gives me a warning with `-Wall`: You asked about C, for some reason I used C++. I think the `

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-23 Thread IchorDev via Digitalmars-d-learn
On Saturday, 24 August 2024 at 00:24:12 UTC, Nicol Farran Terra wrote: I am not sure if this expected behavior, but importing this in my app.d does not work. I get an error about a missing import. You are importing `google.protobuf`, right? Providing the app.d would be helpful, or at least a sn

Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-23 Thread Nicol Farran Terra via Digitalmars-d-learn
Here is my painpoint. I am trying to make a game engine using a combination of D and Swift, my two favorite programming languages. I chose D specifically for lower level features, like stuff for Vulkan and OpenGL as a 'learning experience'. That said, I wanted to keep my dependencies minimal, b

Re: Understanding the Behavior of i + ++i in D Language

2024-08-23 Thread Nick Treleaven via Digitalmars-d-learn
On Friday, 23 August 2024 at 09:42:38 UTC, Nick Treleaven wrote: C++: undefined, could be `6 + 6` if the increment is done first. g++ gives me a warning with `-Wall`: You asked about C, for some reason I used C++. But it's the same in C, and the error happens with `gcc -Wall`.

Re: Understanding the Behavior of i + ++i in D Language

2024-08-23 Thread Nick Treleaven via Digitalmars-d-learn
On Friday, 23 August 2024 at 08:58:16 UTC, Me'vâ wrote: ``` import std.stdio:writeln; void main() { int i = 5; writeln("Result: ", i + ++i); } ``` When I run this, it surprisingly outputs 11. I tried something similar in C before and it gave me 12. I’m curious, why is there a differen

Understanding the Behavior of i + ++i in D Language

2024-08-23 Thread Me'vâ via Digitalmars-d-learn
Hello, I'm working with a simple piece of code in the D language and encountered a result that has left me puzzled. The code snippet is as follows: ``` import std.stdio:writeln; void main() { int i = 5; writeln("Result: ", i + ++i); } ``` When I run this, it surprisingly outputs 11.

Re: need help to use Emscripten with LDC to build wasm projects

2024-08-23 Thread monkyyy via Digitalmars-d-learn
On Friday, 23 August 2024 at 05:50:43 UTC, Dakota wrote: any suggestions how to fix this? ```sh /ldc/bin/../import/core/stdc/stdio.d(31): Error: module ``` I dont use the std with wasm, everything imports everything else and there are just broken symbols deep in "core" that wont be fixed