On Friday, 10 May 2024 at 16:33:53 UTC, Nick Treleaven wrote:
Arrays evaluate to true in boolean conditions if their `.ptr`
field is non-null. This is bug-prone and I hope we can remove
this in the next edition.
...
A string literal's `.ptr` field is always non-null, because it
is
On Friday, 10 May 2024 at 15:23:39 UTC, Andy Valencia wrote:
On Friday, 10 May 2024 at 03:07:43 UTC, Steven Schveighoffer
wrote:
Yes, we say that a type has "truthiness" if it can be used in
a condition (`while`, `if`, `assert`, etc).
So if I may ask for one more small clarification... WRT
On Friday, 10 May 2024 at 03:07:43 UTC, Steven Schveighoffer
wrote:
Yes, we say that a type has "truthiness" if it can be used in a
condition (`while`, `if`, `assert`, etc).
So if I may ask for one more small clarification... WRT
"truthiness", I've observed that empty arrays are treated as
On Friday, 10 May 2024 at 13:27:40 UTC, Dukc wrote:
Steven Schveighoffer kirjoitti 10.5.2024 klo 16.01:
On Friday, 10 May 2024 at 11:05:28 UTC, Dukc wrote:
This also gets inferred as `pure` - meaning that if you use
it twice for the same `WeakRef`, the compiler may reuse the
result of the
Steven Schveighoffer kirjoitti 10.5.2024 klo 16.01:
On Friday, 10 May 2024 at 11:05:28 UTC, Dukc wrote:
This also gets inferred as `pure` - meaning that if you use it twice
for the same `WeakRef`, the compiler may reuse the result of the first
dereference for the second call, without checking
On Friday, 10 May 2024 at 11:05:28 UTC, Dukc wrote:
This also gets inferred as `pure` - meaning that if you use it
twice for the same `WeakRef`, the compiler may reuse the result
of the first dereference for the second call, without checking
whether the referred value has changed!
This
evilrat kirjoitti 9.5.2024 klo 18.19:
```d
struct WeakRef(T) {
private size_t _handle; // same size as a pointer
this(T* ptr) {
_handle = cast(size_t) ptr;
}
T* getRef() {
return cast(T*) _handle;
}
// do the rest ...
}
```
[1]
Dmitry Ponyatov kirjoitti 9.5.2024 klo 11.30:
> And I also can't figure out how to inherit `ParseTree` with all my
script language objects to get AST right from pegged parser. Should I
use some superloop with lot of matches to process parsed `pt` tree into
something I need myself, to drop all