On Thursday, 13 May 2021 at 03:03:37 UTC, Tim wrote:
Hello all,
I have this piece of code
```D
/**
Rotate a 2D array (Vector) by phi radians
Params:
vec = 2D Vector to rotate
phi = Degree with which to rotate the Vector in radians
Returns:
Rotated 2D array (Vector)
Example:
*/
On Thursday, 13 May 2021 at 00:53:50 UTC, Steven Schveighoffer
wrote:
On 5/12/21 1:16 PM, JG wrote:
[...]
Ah, ok. So reference counting provides a single thing you can
point at and pass around without worrying about memory cleanup.
But only as long as you refer to it strictly through a
On Thursday, 13 May 2021 at 03:48:49 UTC, Tim wrote:
On Thursday, 13 May 2021 at 03:46:28 UTC, Alain De Vos wrote:
Not is is not wrong it is wright.
Because you use not pi but an approximation of pi the result
is not zero but an approximation of zero.
Oh, of course. Jesus that sucks big
I would calculate the squared distance to the point (-10,0) and
check it is small enough for practical use.
```
double squared_distance=(p.x+10) * (p.x+10)+p.y * p.y
assert (squared_distance < 1e-10);
```
On Thursday, 13 May 2021 at 03:46:28 UTC, Alain De Vos wrote:
Not is is not wrong it is wright.
Because you use not pi but an approximation of pi the result is
not zero but an approximation of zero.
Oh, of course. Jesus that sucks big time. Any idea on how to use
assert with an approximate
Not is is not wrong it is wright.
Because you use not pi but an approximation of pi the result is
not zero but an approximation of zero.
Hello all,
I have this piece of code
```D
/**
Rotate a 2D array (Vector) by phi radians
Params:
vec = 2D Vector to rotate
phi = Degree with which to rotate the Vector in radians
Returns:
Rotated 2D array (Vector)
Example:
*/
pragma(inline, true)
Point2 rotate2D(in Point2 vec, in
On 5/12/21 5:55 PM, Basile B. wrote:
On Wednesday, 12 May 2021 at 19:35:31 UTC, Jack wrote:
I'd to change the visibility of a method overrided from public to
private but it doesn't work tho to protected it does. Why is that?
...
Why is that? why must I leave it accessible somehow (even if it's
On 5/12/21 1:16 PM, JG wrote:
On Wednesday, 12 May 2021 at 13:38:10 UTC, Steven Schveighoffer wrote:
On 5/12/21 3:28 AM, JG wrote:
Reading the documentation on RefCounted I get the impression that the
following can lead to memory errors. Could someone explain exactly
how that could happen? I
On Wednesday, 12 May 2021 at 19:35:31 UTC, Jack wrote:
I'd to change the visibility of a method overrided from public
to private but it doesn't work tho to protected it does. Why is
that?
...
Why is that? why must I leave it accessible somehow (even if
it's protected) to all derived class of
On 2021-05-12 21:22, Vinod K Chandran wrote:
On Wednesday, 12 May 2021 at 18:26:39 UTC, Christian Köstlin wrote:
Are you really interested in doing winglib as a separate dub package?
If not you could just do a `dub init yourappname` which gives you the
basic skeleton. something like:
.
├──
On Wednesday, 12 May 2021 at 19:35:31 UTC, Jack wrote:
I'd to change the visibility of a method overrided from public
to private but it doesn't work tho to protected it does. Why is
that?
give:
```d
class A
{
void f() { }
}
```
this is ok:
```d
class B : A
{
protected override void
On 5/12/21 12:37 PM, Berni44 wrote:
> Even if it is a few years old, I would still use the book from Ali. Most
> is still valid and maybe, the online version is even updated
Yes, the online version is more up-to-date than the print version. (By
the way, the more-up-to-date online PDF is what
I'd to change the visibility of a method overrided from public to
private but it doesn't work tho to protected it does. Why is that?
give:
```d
class A
{
void f() { }
}
```
this is ok:
```d
class B : A
{
protected override void f() { }
}
```
this is not:
```d
class B : A
{
On Wednesday, 12 May 2021 at 18:37:55 UTC, NonNull wrote:
Some documents/books seem to be out of date. If an intuitive
person competent in several other programming languages and in
abstract reasoning wanted to take the fastest route to learn
pretty much the whole of D as it stands now, having
On Wednesday, 12 May 2021 at 15:03:14 UTC, Imperatorn wrote:
Check out add-local
Thanks. Let me check. :)
On Wednesday, 12 May 2021 at 17:23:16 UTC, JG wrote:
Have a look at
[link](https://forum.dlang.org/post/jyxdcotuqhcdfqwwh...@forum.dlang.org).
Thanks for the link. :)
On Wednesday, 12 May 2021 at 18:26:39 UTC, Christian Köstlin
wrote:
Are you really interested in doing winglib as a separate dub
package?
If not you could just do a `dub init yourappname` which gives
you the basic skeleton. something like:
.
├── dub.sdl
└── source
└── app.d
then you
Hello,
Some documents/books seem to be out of date. If an intuitive
person competent in several other programming languages and in
abstract reasoning wanted to take the fastest route to learn
pretty much the whole of D as it stands now, having already
learned and used a core of the
On 2021-05-12 15:37, Vinod K Chandran wrote:
Hi all,
I am creating a hobby project related with win api gui functions. i
would like to work with dub. But How do I use dub in my project.
1. All my gui library modules are located in a folder named "winglib".
2. And that folder also conatains a d
On Wednesday, 12 May 2021 at 13:37:26 UTC, Vinod K Chandran wrote:
Hi all,
I am creating a hobby project related with win api gui
functions. i would like to work with dub. But How do I use dub
in my project.
1. All my gui library modules are located in a folder named
"winglib".
2. And that
On Wednesday, 12 May 2021 at 13:38:10 UTC, Steven Schveighoffer
wrote:
On 5/12/21 3:28 AM, JG wrote:
Reading the documentation on RefCounted I get the impression
that the following can lead to memory errors. Could someone
explain exactly how that could happen? I suppose that problem
would be
On Wednesday, 12 May 2021 at 13:37:26 UTC, Vinod K Chandran wrote:
Hi all,
I am creating a hobby project related with win api gui
functions. i would like to work with dub. But How do I use dub
in my project.
1. All my gui library modules are located in a folder named
"winglib".
2. And that
On Wednesday, 12 May 2021 at 12:54:24 UTC, Per Nordlöw wrote:
I'm certain I've seen dmd be able to diagnose which
sub-expression of `isDumb` and `isInputRange` that evaluated to
false. Did I just dream this or is there a way? If there is a
way does this improvement still reside in a dmd PR?
Hi all,
I am creating a hobby project related with win api gui functions.
i would like to work with dub. But How do I use dub in my project.
1. All my gui library modules are located in a folder named
"winglib".
2. And that folder also conatains a d file called "package.d"
3. "package.d"
On 5/12/21 3:28 AM, JG wrote:
Reading the documentation on RefCounted I get the impression that the
following can lead to memory errors. Could someone explain exactly how
that could happen? I suppose that problem would be the call something to
do with front?
```
private struct
Given
```d
import std.range.primitives : isInputRange;
enum isDumb(Args...) = (Args.length == 2 && Args.length == 3);
void f(Args...)(Args args)
if (isDumb!(Args))
{
}
void g(Arg)(Arg arg)
if (isInputRange!(Arg))
{
}
@safe pure unittest
{
f(2, 3);
g(2);
}
```
`dmd` diagnoses the
On Wednesday, 12 May 2021 at 09:52:52 UTC, Alain De Vos wrote:
As oppposed to what i expect code below prints nothing nothing
on the screen. What is wrong and how to fix it ?
```
import std.stdio;
import std.range:iota;
import std.algorithm:map;
bool mywriteln(int x){
writeln(x);
On Wednesday, 12 May 2021 at 09:52:52 UTC, Alain De Vos wrote:
As oppposed to what i expect code below prints nothing nothing
on the screen. What is wrong and how to fix it ?
```
import std.stdio;
import std.range:iota;
import std.algorithm:map;
bool mywriteln(int x){
writeln(x);
On Wednesday, 12 May 2021 at 09:52:52 UTC, Alain De Vos wrote:
As oppposed to what i expect code below prints nothing nothing
on the screen. What is wrong and how to fix it ?
```
import std.stdio;
import std.range:iota;
import std.algorithm:map;
bool mywriteln(int x){
writeln(x);
As oppposed to what i expect code below prints nothing nothing on
the screen. What is wrong and how to fix it ?
```
import std.stdio;
import std.range:iota;
import std.algorithm:map;
bool mywriteln(int x){
writeln(x);
return true;
}
void main(){
5.iota.map!mywriteln;
}
Reading the documentation on RefCounted I get the impression that
the following can lead to memory errors. Could someone explain
exactly how that could happen? I suppose that problem would be
the call something to do with front?
```
private struct RefCountedRangeReturnType(R)
{
import
On Monday, 10 May 2021 at 11:11:06 UTC, Mike Parker wrote:
On Monday, 10 May 2021 at 10:56:35 UTC, JG wrote:
The following compiles with dmd but not with ldc on
run.dlang.io. Am I doing something wrong?
Please provide the error message(s) when asking questions like
this. In this case:
```
33 matches
Mail list logo