On Friday, 5 March 2021 at 03:32:35 UTC, harakim wrote:
I want this almost every week at work. When I run into some
trivial statement that I need to know for sure how it works,
it's rarely worth it to create a whole new file and make a main
method and all that. I just edit and run the entire pr
On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote:
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not
possible in the descontrutor? if so, why?
GC prohibits allocation during collection, since this dtor is
likely called b
On Friday, 5 March 2021 at 05:32:27 UTC, Jack wrote:
On Friday, 5 March 2021 at 02:43:36 UTC, H. S. Teoh wrote:
On Fri, Mar 05, 2021 at 02:13:39AM +, Jack via
Digitalmars-d-learn wrote:
something like filter[1] but that stops at first match? are
there any native functions for this in D or I
On Friday, 5 March 2021 at 04:22:23 UTC, Steven Schveighoffer
wrote:
On Friday, 5 March 2021 at 02:13:39 UTC, Jack wrote:
something like filter[1] but that stops at first match? are
there any native functions for this in D or I have to write
one? just making sure to not reinvent the wheel
[1
On Friday, 5 March 2021 at 02:43:36 UTC, H. S. Teoh wrote:
On Fri, Mar 05, 2021 at 02:13:39AM +, Jack via
Digitalmars-d-learn wrote:
something like filter[1] but that stops at first match? are
there any native functions for this in D or I have to write
one? just making sure to not reinvent
The following code returns a memory error. I did notice it did
happens whenever I did a memory allocation. Is this not possible
in the descontrutor? if so, why?
core.exception.InvalidMemoryOperationError@src\core\exception.d(647): Invalid
memory operation
import std.stdio;
int main()
{
On Friday, 5 March 2021 at 02:13:39 UTC, Jack wrote:
something like filter[1] but that stops at first match? are
there any native functions for this in D or I have to write
one? just making sure to not reinvent the wheel
[1]: https://devdocs.io/d/std_algorithm_iteration#filter
std.algorithm
On Friday, 5 March 2021 at 02:08:37 UTC, H. S. Teoh wrote:
In the latter case, you could just use `rdmd -unittest -i -run
main.d` (replace `main.d` with whatever source file contains
main()) to automatically compile all modules including their
unittests *and* run 'em all in one shot.
I didn't
On Friday, 5 March 2021 at 03:35:31 UTC, Mike Parker wrote:
On Friday, 5 March 2021 at 03:32:35 UTC, harakim wrote:
correct version of compiler, but this will be helpful. Is it
possible to download old versions of the compiler somewhere?
From this page you can follow a trail all the way back
On Friday, 5 March 2021 at 03:32:35 UTC, harakim wrote:
correct version of compiler, but this will be helpful. Is it
possible to download old versions of the compiler somewhere?
From this page you can follow a trail all the way back to 0.00 if
you're so inclined:
https://dlang.org/changelo
```
"toolchainRequirements": {
"frontend": "==2.096"
},
```
Thanks! I didn't know you could specify a toolchain version. I
agree it would be cool if it automatically downloaded the correct
version of compiler, but this will be helpful. Is it possible to
downloa
On Fri, Mar 05, 2021 at 02:13:39AM +, Jack via Digitalmars-d-learn wrote:
> something like filter[1] but that stops at first match? are there any
> native functions for this in D or I have to write one? just making
> sure to not reinvent the wheel
[...]
Why not just .front? E.g.:
int
something like filter[1] but that stops at first match? are there
any native functions for this in D or I have to write one? just
making sure to not reinvent the wheel
[1]: https://devdocs.io/d/std_algorithm_iteration#filter
On Fri, Mar 05, 2021 at 01:47:41AM +, Anthony via Digitalmars-d-learn wrote:
> Hello,
>
> I'm trying to run multiple unittest files with rdmd.
> So far I use `find` to just pipe in the files. Eg:
>
>
> time find source -name *__tests.d -exec rdmd -unittest --main
> -I../libprelude/source -I.
Hello,
I'm trying to run multiple unittest files with rdmd.
So far I use `find` to just pipe in the files. Eg:
time find source -name *__tests.d -exec rdmd -unittest --main
-I../libprelude/source -I../libparser/source
-I../libgeometry/source -Isource {} \;
Is there an easier way to do this?
On Thursday, 4 March 2021 at 22:30:17 UTC, tastyminerals wrote:
I got a company MacBook with M1 chip and gradually migrate all
the stuff from Linux machine. I got precompiled ldc binary
installed without any problem now is the time for dub since I
have couple of D projects I use at work and all
On Thursday, 4 March 2021 at 22:30:17 UTC, tastyminerals wrote:
I got a company MacBook with M1 chip and gradually migrate all
the stuff from Linux machine. I got precompiled ldc binary
installed without any problem now is the time for dub since I
have couple of D projects I use at work and all
I got a company MacBook with M1 chip and gradually migrate all
the stuff from Linux machine. I got precompiled ldc binary
installed without any problem now is the time for dub since I
have couple of D projects I use at work and all of them use dub.
I can only see the dub-v1.23.0-osx-x86_64.tar
On Thursday, 4 March 2021 at 15:19:16 UTC, frankp wrote:
On Thursday, 4 March 2021 at 14:54:11 UTC, frankp wrote:
I give up. This makes no sense. I just accept this is the work
of gremlins. I revert to a plain alias and an enum.
Sorry for wasting your time.
Not gremlins after all. It was sim
On Thursday, 4 March 2021 at 14:54:11 UTC, frankp wrote:
I give up. This makes no sense. I just accept this is the work
of gremlins. I revert to a plain alias and an enum.
Sorry for wasting your time.
Not gremlins after all. It was simply a matter of the compiler
pointing to the wrong line.
On Thursday, 4 March 2021 at 14:42:16 UTC, frankp wrote:
However, the compiler complains if the struct is called
"cycle_t". That's curious. Is that a reserved name?
I don't import anything by that name. Not to my knowledge at
least - I'm strictly using named imports.
False alarm. If I remove t
On Thursday, 4 March 2021 at 14:31:23 UTC, Simen Kjærås wrote:
On Thursday, 4 March 2021 at 13:58:48 UTC, frankp wrote:
Hi all,
I want to make an opaque type that simply contains an integer
with some immutable constants and toString pretty printing.
Like this:
struct Foo_t
{
private long
On Thursday, 4 March 2021 at 14:18:07 UTC, harakim wrote:
[...]
This is the text of my program
import std.stdio;
struct Foo_t
{
private long foo;
alias foo this;
static immutable long Inf = long.max; //1)
void toString(...){ writeln(foo); }
}
void main()
{
Foo_t sampl
On Thursday, 4 March 2021 at 13:58:48 UTC, frankp wrote:
Hi all,
I want to make an opaque type that simply contains an integer
with some immutable constants and toString pretty printing.
Like this:
struct Foo_t
{
private long foo;
alias foo this;
static immutable long Inf = long.max
On Thursday, 4 March 2021 at 13:58:48 UTC, frankp wrote:
Hi all,
I want to make an opaque type that simply contains an integer
with some immutable constants and toString pretty printing.
Like this:
struct Foo_t
{
private long foo;
alias foo this;
static immutable long Inf = long.max
Hi all,
I want to make an opaque type that simply contains an integer
with some immutable constants and toString pretty printing. Like
this:
struct Foo_t
{
private long foo;
alias foo this;
static immutable long Inf = long.max; //1)
void toString(...){}
}
On dmd 2.092.1 this fai
On Monday, 1 March 2021 at 22:25:39 UTC, Rey Valeza wrote:
Hi, I wrote a tutorial on Vibe.d while trying to re-learn
Vibe.d. I find that most of Kai Nacke's book need updating, so
I wrote a tutorial while trying to re-learn it.
Here it is.
https://github.com/reyvaleza/vibed/commit/27ec3678f25
On Wednesday, 3 March 2021 at 23:30:20 UTC, harakim wrote:
Contrast to me trying to figure out how to format a number in
binary. format!"%b"(number) does not work but is very similar
to what is suggested in the documentation. I was able to figure
out it's format("%b", number) but it took a few
On Wednesday, 3 March 2021 at 23:30:20 UTC, harakim wrote:
Every time I come back to a D program I wrote over a year ago,
it seems like there are numerous breaking changes and it takes
me a while to get it to compile again.
I am porting a large code base from Extended Pascal to D and I
know t
On Thursday, 4 March 2021 at 09:21:12 UTC, Siemargl wrote:
On Thursday, 4 March 2021 at 06:43:57 UTC, user1234 wrote:
otherwise another solution is to check every two monthes the
sanity of your projects. E.g a montly cronjob on a CI service
and that uses latest DMD Docker image. If it fails y
On Thursday, 4 March 2021 at 06:43:57 UTC, user1234 wrote:
otherwise another solution is to check every two monthes the
sanity of your projects. E.g a montly cronjob on a CI service
and that uses latest DMD Docker image. If it fails you got an
email... It certainly cooler to take 5 mins every
31 matches
Mail list logo