Minimum thing to reproduce bug:
main.d:
```d
import test;
void main() {
auto a = FILE_MAP_READ;
}
```
test.c
```c
#define SECTION_MAP_READ 0x0004
#define FILE_MAP_READ SECTION_MAP_READ
```
build with ```"D:\dmd.2.105.3.windows\dmd2\windows\bin64\dmd.exe"
-c test.c -vcg-ast```.
Hi All,
I feel lonely, just as those who come from C++ find it strange,
because I think it makes it difficult to read code.
On Friday, 1 December 2023 at 14:53:16 UTC, Paul Backus wrote:
Technically you don't *have* to repeat the type. You can write
the return type as `auto`:
```d
auto
If I not use -allinst the linker complains when using the current
msgpack-d v1.0.5, e.g.
[...]msgpack-d/src/msgpack/package.d:203: undefined reference to
`pure nothrow @nogc @safe immutable(char)[]
core.internal.dassert._d_assert_fail!(int)._d_assert_fail!(int)._d_assert_fail(scope
After switching to dmd v2.105.3 I get this warnings almost
everywhere. Do I really have to fork msgpack-d in order to get
rid of these warnings?
Now I replaced every "in ref" with "in" in my own code but I do
not add that preview flag to the compiler invocation. Is that
safe?
I completely agree with the OP, and I want to illustrate this by
another example which I find quite bizarre:
```
struct S { int a; int b; }
S[] s_list = new S[0];
// this works
S s = { a:1, b:2 };
s_list ~= s;
// this does not
s_list ~= { a:1, b:2 };
```
I'm a C++ programmer in my day job
Hey everyone,
I'm looking into vibe-d, particularly how to build a REST API
server.
Given this struct:
```
struct Project
{
string project_id;
string name;
}
```
I could write a GETter like this:
```
@path("projects/:project_id")
Project getProject(string _project_id);
```
and a POST
On Wednesday, 29 November 2023 at 16:48:09 UTC, Paul Backus wrote:
[...]
If you're using a new enough compiler, it even supports named
arguments:
S3 fun2() { return S3(b: 2, a: 5); }
Indeed. Seems to be in dmd since 2.103.0 (2.102.2 didn't support
this syntax). Alas, the Change Log [1]
On Friday, 1 December 2023 at 13:02:06 UTC, Dom DiSc wrote:
```d
S Fun(){ return { 5, 2 }; }
```
This IS an initialization and the type is known. Requiring the
repetition of the type is also here annoying.
Technically you don't *have* to repeat the type. You can write
the return type as
On Friday, 1 December 2023 at 13:02:06 UTC, Dom DiSc wrote:
```d
S Fun(){ return { 5, 2 }; }
```
This IS an initialization and the type is known. Requiring the
repetition of the type is also here annoying.
Right.
The `{}` initialization method in C++ is very useful,I like it
very much.
On Friday, 1 December 2023 at 13:02:06 UTC, Dom DiSc wrote:
Either allow it for all initializations, or get rid of it, like
DIP 1031 suggested.
I thought the decision actually was made to just get rid of it.
On Thursday, 30 November 2023 at 12:15:04 UTC, Dennis wrote:
The syntax was inherited from C. The 'special place' is called
initialization, and it's special because the target type of the
initializer is known in advance
This is no different from `S fun(){ return { 5, 2 }; }` It
creates a new
On Thursday, 30 November 2023 at 14:10:35 UTC, zjh wrote:
On Wednesday, 29 November 2023 at 16:38:36 UTC, Dom DiSc wrote:
```d
struct S { int a; int b; }
S2 fun3() { return S2( 5, 2 ); }
```
Here,`S2( 5, 2 );` violeit `DRY` principle.
Yes. I think if we have the brackets form, it should be
On Friday, 1 December 2023 at 01:01:31 UTC, Siarhei Siamashka
wrote:
Advent of Code 2023 starts in a few hours from now. I suggest
to discuss D language solutions here.
But to avoid spoilers, it's best to do this with a 24h delay
after each puzzle is published.
Hi Siarhei. Nice to see that
On Friday, 1 December 2023 at 10:23:08 UTC, Kagamin wrote:
In C macros can be defined to any expression, so ImportC
interprets these parentheses as arbitrary expression macros and
skips them thinking they are helper macros that can't be always
translated.
But does that explain why using
So, uh, I tried deleting the parens off GENERIC_READ's value:
winnt.h:
```c
//
// These are the generic rights.
//
#define GENERIC_READ 0x8000L
#define GENERIC_WRITE(0x4000L)
#define GENERIC_EXECUTE (0x2000L)
#define
On Friday, 1 December 2023 at 08:45:30 UTC, Kagamin wrote:
Is GENERIC_WRITE awailable?
No, it's not.
I tried building with LDC 1.35.0:
```"D:\ldc2-1.35.0-windows-x64\bin\ldc2.exe" main.d -i
-vcg-ast```.
winnt.h:
```c
// begin_wdm
// begin_ntoshvp
typedef DWORD ACCESS_MASK;
typedef
Is GENERIC_WRITE awailable?
17 matches
Mail list logo