On Monday, 17 May 2021 at 00:27:01 UTC, SealabJaster wrote:
On Sunday, 16 May 2021 at 23:52:06 UTC, Adam D. Ruppe wrote:
...
I've opened a PR (https://github.com/dlang/dmd/pull/12526) with
a super hacked together proof-of-concept.
As I say in the PR I don't know if I'm actually capable of
On Sunday, 16 May 2021 at 15:43:51 UTC, Adam D. Ruppe wrote:
On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote:
Error: undefined identifier 'SetDCBrushColor'
Did you include gdi32.lib on the command line?
I got this error:
C:\Users\Usuario\Arquivos\dm\lib\gdi32.lib
Error 43: Not a Valid
On Monday, 17 May 2021 at 00:27:01 UTC, SealabJaster wrote:
I've opened a PR (https://github.com/dlang/dmd/pull/12526) with
a super hacked together proof-of-concept.
oh very good! I was going to add something similar to my own todo
list but who knows when I'd get around to it.
This kind of t
On Sunday, 16 May 2021 at 23:52:06 UTC, Adam D. Ruppe wrote:
...
I've opened a PR (https://github.com/dlang/dmd/pull/12526) with a
super hacked together proof-of-concept.
As I say in the PR I don't know if I'm actually capable of
pushing it forward if the idea gets accepted, but I've decide
On Sunday, 16 May 2021 at 22:17:16 UTC, Chris Piker wrote:
It seems there's a broken symmetry in compiler error reporting
for the following, ostensibly identical, cases:
Oh yes, I completely agree with you.
Sometimes error messages even use the name but it is from a
different module so it is
On Sunday, 16 May 2021 at 18:30:49 UTC, Alain De Vos wrote:
Is there a list of compiler flags not shown ?
ldc2 -help-hidden
On Sunday, 16 May 2021 at 13:35:02 UTC, Adam D. Ruppe wrote:
Wait, what's the bug there? The typeof DOES tell you they are
separate.
Error: cannot implicitly convert expression `b` of type
`S!(func2)` to `S!(func1)`
Sorry, it's a forum post, so I really should have been more
explicit.
It
On Sunday, 16 May 2021 at 20:32:08 UTC, SealabJaster wrote:
...
You could even make a helper function that lets the compiler
infer the lambda's type for you:
```d
struct S(T)
{
alias FT = T function(T);
FT func;
}
S!T s(T)(T function(T) func)
{
return S!T(func);
}
void main()
{
On Sunday, 16 May 2021 at 12:54:19 UTC, Chris Piker wrote:
...
If all you need is a single type for the parameter(s) and return
type, then it can be simplified a bit to save you some typing:
```d
struct S(T)
{
alias FT = T function(T);
FT func;
}
void main()
{
auto a = S!int(a =>
On Sun, May 16, 2021 at 06:33:04PM +, Alain De Vos via Digitalmars-d-learn
wrote:
> On Sunday, 16 May 2021 at 18:27:40 UTC, H. S. Teoh wrote:
[...]
> > -snip-
> > import std.stdio:writeln;
> >
> > int [] fun() @safe {// N.B.: need @safe
> > int[3]s=[1,2,3];
On Sunday, 16 May 2021 at 18:06:40 UTC, Jack wrote:
On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote:
Well, I program in D as a hobby for just over a year, and I
like to learn and explore this wonderful programming language.
Now I found the DMC compiler that compiles C ++ code. So I
decid
On Sunday, 16 May 2021 at 11:42:19 UTC, Adam D. Ruppe wrote:
On Sunday, 16 May 2021 at 08:04:06 UTC, cc wrote:
If the goal is to absolutely squeeze the GC back down after
using new or dynamic arrays, I find destroy + GC.free often
fails to do the trick (e.g. GC.stats.usedSize remains high).
d
On Sunday, 16 May 2021 at 18:27:40 UTC, H. S. Teoh wrote:
On Sun, May 16, 2021 at 05:24:40PM +, Alain De Vos via
Digitalmars-d-learn wrote:
On Sunday, 16 May 2021 at 16:58:15 UTC, H. S. Teoh wrote:
> On Sun, May 16, 2021 at 04:40:53PM +, Alain De Vos via
> Digitalmars-d-learn wrote:
>
Is there a list of compiler flags not shown ?
the flag dip1000 was not shown in the help file.
And indeed for the second program compiling with dip1000 results
in,
test.d(6): Error: scope variable r may not be returned
But the first program still compiles and runs without problem,
even with dip1000.
On Sun, May 16, 2021 at 05:24:40PM +, Alain De Vos via Digitalmars-d-learn
wrote:
> On Sunday, 16 May 2021 at 16:58:15 UTC, H. S. Teoh wrote:
> > On Sun, May 16, 2021 at 04:40:53PM +, Alain De Vos via
> > Digitalmars-d-learn wrote:
> > > This works also,
> > >
> > > ```
> > > import std.s
On 16.05.21 19:24, Alain De Vos wrote:
On Sunday, 16 May 2021 at 16:58:15 UTC, H. S. Teoh wrote:
[...]
Though I believe if you compile with -dip25 -dip1000 the compiler
should emit an error for the above code. If not, please file a bug
against -dip1000.
T
I use ldc2. No dip flags here.
On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote:
Well, I program in D as a hobby for just over a year, and I
like to learn and explore this wonderful programming language.
Now I found the DMC compiler that compiles C ++ code. So I
decided to test it. Creating a program with a win32api
gr
On Sunday, 16 May 2021 at 15:43:51 UTC, Adam D. Ruppe wrote:
On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote:
Error: undefined identifier 'SetDCBrushColor'
Did you include gdi32.lib on the command line?
Yes, I did it. But not work. I get this error:
Error: undefined identifier 'SetDCBr
On Sunday, 16 May 2021 at 16:58:15 UTC, H. S. Teoh wrote:
On Sun, May 16, 2021 at 04:40:53PM +, Alain De Vos via
Digitalmars-d-learn wrote:
This works also,
```
import std.stdio:writeln;
int [] fun(){
int[3]s=[1,2,3];
int[] r=s;
return r;
}
void main(){
wri
On 5/16/21 12:32 PM, Alain De Vos wrote:
Why doesn't this program dups core ?
Is s not recycled ?
```
import std.stdio:writeln;
void main(){
//I point to the heap
int[] p=[1,2,3];
{
int[3]s=[1,2,3];
//I point to the stack
p=s;
}
//Why do I still live ?
On Sun, May 16, 2021 at 04:40:53PM +, Alain De Vos via Digitalmars-d-learn
wrote:
> This works also,
>
> ```
> import std.stdio:writeln;
>
> int [] fun(){
> int[3]s=[1,2,3];
> int[] r=s;
> return r;
> }
>
> void main(){
> writeln(fun()[0]);
> }
> ```
https://is
This works also,
```
import std.stdio:writeln;
int [] fun(){
int[3]s=[1,2,3];
int[] r=s;
return r;
}
void main(){
writeln(fun()[0]);
}
```
Why doesn't this program dups core ?
Is s not recycled ?
```
import std.stdio:writeln;
void main(){
//I point to the heap
int[] p=[1,2,3];
{
int[3]s=[1,2,3];
//I point to the stack
p=s;
}
//Why do I still live ?
On Sunday, 16 May 2021 at 15:47:55 UTC, Adam D. Ruppe wrote:
On Sunday, 16 May 2021 at 15:12:25 UTC, Nick wrote:
Is this warning still valid?
The @property thing doesn't do much. All it does is change
typeof(a.prop) from function over to the return value of the
function. (Which actually make
On Sat, May 15, 2021 at 02:31:08PM +, Alain De Vos via Digitalmars-d-learn
wrote:
> Which parts in dlang don't you use and why ?
>
> Personally i have no need for enum types, immutable is doing fine.
> Auto return types i find dangerous to use.
> Voldermont types.
> Named initialiser.
> Tuple
On Sunday, 16 May 2021 at 15:12:25 UTC, Nick wrote:
Is this warning still valid?
The @property thing doesn't do much. All it does is change
typeof(a.prop) from function over to the return value of the
function. (Which actually makes it required for the range empty
and front things!)
But si
On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote:
Error: undefined identifier 'SetDCBrushColor'
Did you include gdi32.lib on the command line?
On Sat, May 15, 2021 at 11:25:10AM +, Chris Piker via Digitalmars-d-learn
wrote:
[...]
> Basically the issue is that if one attempts to make a range based
> pipeline aka:
>
> ```d
> auto mega_range = range1.range2!(lambda2).range3!(lambda3);
> ```
> Then the type definition of mega_range is s
The [Property
Functions](https://dlang.org/spec/function.html#property-functions) documentation reads:
WARNING: The definition and usefulness of property functions is
being reviewed, and the implementation is currently incomplete.
Using property functions is not recommended until the
definiti
Well, I program in D as a hobby for just over a year, and I like
to learn and explore this wonderful programming language. Now I
found the DMC compiler that compiles C ++ code. So I decided to
test it. Creating a program with a win32api graphical interface I
run into this error:
Error: undefi
On Sunday, 16 May 2021 at 12:54:19 UTC, Chris Piker wrote:
a = b; // Lambdas as arguments instead of types works
Wait a sec, when you do the
```d
auto a = S!(a => a*2)();
```
That's not actually passing a type. That's passing the (hidden)
name of a on-the-spot-created function template as
On Sunday, 16 May 2021 at 10:10:54 UTC, SealabJaster wrote:
It's due to a quirk with passing lambdas as template arguments.
Each lambda is actually separated into its own function.
Hey that was a very well laid out example.
Okay, I think the light is starting do dawn. So if I use lambdas
as
On Sunday, 16 May 2021 at 09:55:31 UTC, Chris Piker wrote:
On Sunday, 16 May 2021 at 09:17:47 UTC, Jordan Wilson wrote:
Another example:
```d
auto r = [iota(1,10).map!(a => a.to!int),iota(1,10).map!(a =>
a.to!int)];
# compile error
```
Hi Jordan
Nice succinct example. Thanks for looking at
On Sunday, 16 May 2021 at 08:04:06 UTC, cc wrote:
If the goal is to absolutely squeeze the GC back down after
using new or dynamic arrays, I find destroy + GC.free often
fails to do the trick (e.g. GC.stats.usedSize remains high).
destroy + GC.free has a quirk - GC.free only works on what
GC.
On Sunday, 16 May 2021 at 09:55:31 UTC, Chris Piker wrote:
On Sunday, 16 May 2021 at 09:17:47 UTC, Jordan Wilson wrote:
Another example:
```d
auto r = [iota(1,10).map!(a => a.to!int),iota(1,10).map!(a =>
a.to!int)];
# compile error
```
Hi Jordan
Nice succinct example. Thanks for looking at
On Sunday, 16 May 2021 at 09:55:31 UTC, Chris Piker wrote:
Maybe that's eminently reasonable to those with deep knowledge,
but it seems crazy to a new D programmer. It breaks a general
assumption about programming when copying and pasting a
definition yields two things that aren't the same typ
On Sunday, 16 May 2021 at 09:17:47 UTC, Jordan Wilson wrote:
Another example:
```d
auto r = [iota(1,10).map!(a => a.to!int),iota(1,10).map!(a =>
a.to!int)];
# compile error
```
Hi Jordan
Nice succinct example. Thanks for looking at the code :)
So, honest question. Does it strike you as od
On Sunday, 16 May 2021 at 07:20:52 UTC, Chris Piker wrote:
On Saturday, 15 May 2021 at 14:05:34 UTC, Paul Backus wrote:
If you post your code (or at least a self-contained subset of
it) someone can probably help you figure out where you're
running into trouble. The error messages by themselves
On Saturday, 15 May 2021 at 18:24:19 UTC, Alain De Vos wrote:
Thanks, good idea but,
It does not initiate a GC cycle or free any GC memory.
Personally I wish D would re-implement "delete" and make it "just
work" like one would assume, but from what I've seen there have
been many many debates
On Saturday, 15 May 2021 at 14:05:34 UTC, Paul Backus wrote:
If you post your code (or at least a self-contained subset of
it) someone can probably help you figure out where you're
running into trouble. The error messages by themselves do not
provide enough information--all I can say from them
41 matches
Mail list logo