On Wednesday, 8 June 2022 at 01:32:42 UTC, Steven Schveighoffer
wrote:
I like `$`. It's got a well-defined meaning, and already is
somewhat magic.
-Steve
I agree it's magic.
warray[5..$] - this is one of the best uses of syntax magic in D!
I think it's what first attracted me to the lang
On 6/7/22 9:17 PM, forkit wrote:
On Wednesday, 8 June 2022 at 01:11:45 UTC, Mike Parker wrote:
...The author withdrew the DIP
..
That's a shame.
Seems like a useful language feature. I'd be using it already if it
existed.
I agree, it's a pain to dig out an import and the verbose name
On Wednesday, 8 June 2022 at 01:11:45 UTC, Mike Parker wrote:
...The author withdrew the DIP
..
That's a shame.
Seems like a useful language feature. I'd be using it already if
it existed.
I'd have gone for:
int[..] arr = [1,2,3];
On 6/7/22 3:58 PM, frame wrote:
On Tuesday, 7 June 2022 at 18:37:13 UTC, Steven Schveighoffer wrote:
My very common use of `scope(failure)` for my DB code:
```d
conn.exec("START TRANSACTION");
scope(success) conn.exec("COMMIT");
scope(failure) conn.exec("ROLLBACK");
```
This is hard to encap
On Wednesday, 8 June 2022 at 00:43:24 UTC, Ali Çehreli wrote:
Do I remember correctly that there were syntax proposals that
used $ or _?
int[$] arr = [ 1, 2 ];
int[_] arr = [ 1, 2 ];
But I can't find past discussions about that.
https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP
On 6/7/22 16:38, arandomonlooker wrote:
There is any chance size inference is going to be implemented into D as
a feature?
Do I remember correctly that there were syntax proposals that used $ or _?
int[$] arr = [ 1, 2 ];
int[_] arr = [ 1, 2 ];
But I can't find past discussions about that
On Tuesday, 7 June 2022 at 00:20:31 UTC, Ali Çehreli wrote:
On 6/6/22 17:04, arandomonlooker wrote:
> [...]
syntax causes
> [...]
As you already know, the correct syntax is 'int[]' :) but it
won't work because -betterC cannot support dynamic array.
[...]
There is any chance size inference
On 6/7/22 12:58, frame wrote:
> ```d
> bool fun() {
> scope(failure) {
> // do something
> return false;
> }
>
> badCode();
> return true;
> }
> ```
>
> I know this is bad as I'm capturing a possible error here - but this is
> what an unexperienced code
On Tuesday, 7 June 2022 at 18:37:13 UTC, Steven Schveighoffer
wrote:
My very common use of `scope(failure)` for my DB code:
```d
conn.exec("START TRANSACTION");
scope(success) conn.exec("COMMIT");
scope(failure) conn.exec("ROLLBACK");
```
This is hard to encapsulate into a type, as dtors onl
On 6/7/22 12:28 PM, frame wrote:
On Friday, 3 June 2022 at 23:40:50 UTC, Steven Schveighoffer wrote:
During the last beerconf, I wrote a short blog post about how `Error`
and `Exception` are different, and why you should never continue after
catching `Error`s.
I know the thematics but I still
On Friday, 3 June 2022 at 23:40:50 UTC, Steven Schveighoffer
wrote:
During the last beerconf, I wrote a short blog post about how
`Error` and `Exception` are different, and why you should never
continue after catching `Error`s.
I know the thematics but I still wonder why we only have
`scope(f
On Tuesday, 7 June 2022 at 13:56:23 UTC, Steven Schveighoffer
wrote:
So you are safe, it will see the pointer inside the array
reference, and see that it doesn't point at GC memory, so
nothing further will be done.
Thanks for the detailed explanation, and everyone who has replied.
On 6/6/22 6:18 PM, mw wrote:
Hi,
Suppose I have this code:
```
class GCAllocated {
float[] data;
this() {
// non-gc-allocated field
this.data = cast(float[])(core.stdc.stdlib.malloc(nBytes)[0 ..
nBytes]);
}
}
void foo() {
auto obj = new GCAllocated(); // gc-allocated
On Tuesday, 7 June 2022 at 09:12:25 UTC, ag0aep6g wrote:
On 07.06.22 11:00, max haughton wrote:
On Tuesday, 7 June 2022 at 08:56:29 UTC, ag0aep6g wrote:
[...]
That wasn't mw's question.
I also answered this in my original one IIRC.
You didn't.
Ok I must have assumed it was obvious it wou
On 07.06.22 11:00, max haughton wrote:
On Tuesday, 7 June 2022 at 08:56:29 UTC, ag0aep6g wrote:
[...]
That wasn't mw's question.
I also answered this in my original one IIRC.
You didn't.
On Tuesday, 7 June 2022 at 08:56:29 UTC, ag0aep6g wrote:
On 07.06.22 03:02, max haughton wrote:
I'm talking about the data in the array.
void[] might contain pointers, float[] does not so it won't be
scanned.
That wasn't mw's question.
I also answered this in my original one IIRC. There's
On 07.06.22 03:02, max haughton wrote:
I'm talking about the data in the array.
void[] might contain pointers, float[] does not so it won't be scanned.
That wasn't mw's question.
On Tuesday, 7 June 2022 at 00:20:31 UTC, Ali Çehreli wrote:
> it's complaining about TypeInfo being absent.
What an unfortunate error message! Trying writeln() causes
equally weird error messages.
Walter just improved it! https://github.com/dlang/dmd/pull/14181
Perhaps try a [nightly
build]
18 matches
Mail list logo