On 2/9/22 18:11, Meta wrote:
> Why do we even bother with `in` when we can do:
>
> alias In(T) = const scope T;
>
> void test(In!int n) {
> pragma(msg, typeof(n));
> }
>
> ?
>
> onlineapp.d(3): Deprecation: storage class `scope` has no effect in type
> aliases
> const(int)
>
> ...oh
I
Why do we even bother with `in` when we can do:
alias In(T) = const scope T;
void test(In!int n) {
pragma(msg, typeof(n));
}
?
onlineapp.d(3): Deprecation: storage class `scope` has no effect
in type aliases
const(int)
...oh
On Wednesday, 9 February 2022 at 17:54:17 UTC, rikki cattermole
wrote:
On 10/02/2022 5:21 AM, Paul Backus wrote:
- C (gcc/clang): __attribute__((warn_unused_result))
C23 will also have [[nodiscard]]
Not only will it have that on functions, but also support a
string too.
Unfortunately its
On Wednesday, 9 February 2022 at 17:40:31 UTC, jmh530 wrote:
On Wednesday, 9 February 2022 at 16:21:24 UTC, Paul Backus
wrote:
[snip]
In D, there is no existing word for this, so from that
perspective both "mustuse" and "nodiscard" are equally valid.
In other languages, there are multiple
On Wednesday, 9 February 2022 at 17:48:29 UTC, Guillaume Piolat
wrote:
There is also the Nim "discard" statement.
Just change the default to not allowing return values to be
discarded. When you really want to, do:
```
cast(void) function_with_return_value(…)
```
Or something like that.
On Wed, Feb 09, 2022 at 10:28:15AM -0800, Ali Çehreli via
Digitalmars-d-announce wrote:
[...]
> - const is a promise
>
> - immutable is a requirement
[...]
Strictly speaking, that's not really an accurate description. :-P A
more accurate description would be:
- const: I cannot modify the data
On Wednesday, 9 February 2022 at 16:21:24 UTC, Paul Backus wrote:
On Wednesday, 9 February 2022 at 14:30:30 UTC, Guillaume Piolat
wrote:
On Monday, 7 February 2022 at 19:57:28 UTC, forkit wrote:
First, I'm not 'insisting' on anything. I'm just expressing a
view.
nodiscard is already used by
On 2/9/22 02:15, Anonymouse wrote:
On Saturday, 8 January 2022 at 02:07:10 UTC, Ali Çehreli wrote:
2) The other noteworthy change in the book is my now-different stance
on variables: Now I recommend 'const' over 'immutable' for variables.
I'm curious, could you elaborate a bit on this? I
On 10/02/2022 5:21 AM, Paul Backus wrote:
- C (gcc/clang): __attribute__((warn_unused_result))
C23 will also have [[nodiscard]]
Not only will it have that on functions, but also support a string too.
Unfortunately its looking like we have chosen to diverge from C, and
therefore won't be
On Wednesday, 9 February 2022 at 16:21:24 UTC, Paul Backus wrote:
C++ is quite popular, but it is not the only popular language,
and there are many D programmers who have never used C++ at
all, let alone C++17 or later. Therefore, it is a mistake to
assume that all or even most D programmers
On Wednesday, 9 February 2022 at 16:21:24 UTC, Paul Backus wrote:
[snip]
In D, there is no existing word for this, so from that
perspective both "mustuse" and "nodiscard" are equally valid.
In other languages, there are multiple existing words:
- C++17: [[nodiscard]]
- C (gcc/clang):
On Wednesday, 9 February 2022 at 14:30:30 UTC, Guillaume Piolat
wrote:
On Monday, 7 February 2022 at 19:57:28 UTC, forkit wrote:
First, I'm not 'insisting' on anything. I'm just expressing a
view.
nodiscard is already used by more programmers that D is likely
to ever adopt.
Indeed, it's
On Wednesday, 9 February 2022 at 14:30:30 UTC, Guillaume Piolat
wrote:
Hence some does of of reusing,
some dose of reuse*
On Monday, 7 February 2022 at 19:57:28 UTC, forkit wrote:
First, I'm not 'insisting' on anything. I'm just expressing a
view.
nodiscard is already used by more programmers that D is likely
to ever adopt.
Indeed, it's these programmers that D is trying to adopt.
I'm not sure forcing such
On Wednesday, 9 February 2022 at 10:59:03 UTC, Dukc wrote:
You're implying that your opinion is rational and apolitical,
disagreeing with it is irrational politics.
I am implying that there are many symptoms of people not being
willing to champion the best possible design and instead have
On Sunday, 6 February 2022 at 15:43:39 UTC, Ola Fosheim Grøstad
wrote:
3. *The politics of language improvements*: I don't think this
should be a library type. I think this feature is too important
for that. To me this smells of let's move the syntax to a
library to avoid any discussion about
On Saturday, 8 January 2022 at 02:07:10 UTC, Ali Çehreli wrote:
2) The other noteworthy change in the book is my now-different
stance on variables: Now I recommend 'const' over 'immutable'
for variables.
I'm curious, could you elaborate a bit on this? I skimmed through
the page on
17 matches
Mail list logo