On Wednesday, 10 September 2025 at 14:45:52 UTC, Richard (Rikki)
Andrew Cattermole wrote:
The caller is responsible for guaranteeing that the memory
passed in is uninitialized, and that behavior is @system.
Yeah but I should be able to mark it as `@trusted` without
trusting some random bloody
On Wednesday, 17 September 2025 at 22:16:50 UTC, Brother Bill
wrote:
Then there is another example with 'delegate' instead of
'function.
```
import std.stdio;
void main()
{
}
alias Calculator = int function(int);
Calculator makeCalculator()
{
int increment = 10;
return value
On Monday, 8 September 2025 at 14:32:32 UTC, Brother Bill wrote:
https://tour.dlang.org/tour/en/basics/delegates
This is so simple. What is D complaining about?
Should this also work with a Template, as shown?
```
import std.stdio;
void main()
{
// auto add(T)(T lhs, T rhs)
//
Ok, gotcha.
Placement new is @system, but you wanted to use it in an @safe function
iff the constructor to be called is @safe as well.
The reason placement new is @system is because of double-init. It can't
be a safe operation.
On Wed, Sep 17, 2025 at 10:16:50PM +, Brother Bill via Digitalmars-d-learn
wrote:
> In the following from Programming in D, page 483, we use function keyword.
>
> I expect that the first int in
> ```
> int function(int);
> ```
>
> represents the return value.
>
> What does the second (int)
On Wednesday, 17 September 2025 at 22:16:50 UTC, Brother Bill
wrote:
```
import std.stdio;
void main()
{
}
alias Calculator = int function(int);
Calculator makeCalculator()
{
int increment = 10;
return value => increment + value; // ← compilation ERROR
}
```
function is alm
In the following from Programming in D, page 483, we use function
keyword.
I expect that the first int in
```
int function(int);
```
represents the return value.
What does the second (int) refer to?
Then there is another example with 'delegate' instead of
'function.
```
import std.stdio;
This works:
```
import std.stdio;
void main()
{
foo();
}
void foo() {
int addMyInts(int lhs, int rhs) {
return lhs + rhs;
}
int doSomething(int delegate(int, int) doer)
{
// call passed function
return doer(
On Wednesday, 10 September 2025 at 14:25:05 UTC, IchorDev wrote:
On Wednesday, 10 September 2025 at 14:01:29 UTC, Brother Bill
wrote:
what is the meanings of == null vs. is null?
You have already asked this question [here
before](https://forum.dlang.org/thread/nvaiwzvcrahnwzior...@forum.dlang
On Friday, 12 September 2025 at 15:20:38 UTC, Brother Bill wrote:
Is is possible to 'disable' .init for a struct?
You do not want .init?
Fine:
```d
Archive noInit = void;
```
On Thursday, 11 September 2025 at 11:47:40 UTC, Dennis wrote:
On Wednesday, 10 September 2025 at 12:29:24 UTC, IchorDev wrote:
If anyone has any ideas, please let me know.
The trick that's used in druntime is putting the part that
still needs to be checked for attributes inside an `if (false)
On Wednesday, 17 September 2025 at 14:57:19 UTC, monkyyy wrote:
[snip]
Sorry, I'm having trouble understanding what you're trying to do.
On Friday, 12 September 2025 at 15:20:38 UTC, Brother Bill wrote:
Is is possible to 'disable' .init for a struct?
No (and honestly it's bad style to break the constructors)
On 9/8/25 12:55 PM, Neto wrote:
> On Monday, 8 September 2025 at 16:51:09 UTC, Serg Gini wrote:
>> On Monday, 8 September 2025 at 16:43:10 UTC, Neto wrote:
>> Yes, I know there are companies that are using it in production.
>> Even several big ones like Weka and Symmetry.
> Why isn't D productio
On Wednesday, 10 September 2025 at 20:23:28 UTC, monkyyy wrote:
[snip]
Documentation for mir iterators is here:
http://mir-algorithm.libmir.org/mir_ndslice_iterator.html
If you want to use mir without using the GC. You can allocate
with malloc, custom allocator, or use an RC allocator.
http:
On Wednesday, 17 September 2025 at 12:06:32 UTC, jmh530 wrote:
On Wednesday, 10 September 2025 at 20:23:28 UTC, monkyyy wrote:
[snip]
Documentation for mir iterators is here:
http://mir-algorithm.libmir.org/mir_ndslice_iterator.html
I see nd-iota but it seems under powered(handling only the
16 matches
Mail list logo