On Thursday, 5 January 2023 at 22:49:01 UTC, thebluepandabear
wrote:
Have fun reading this :
https://issues.dlang.org/show_bug.cgi?id=21929
Thanks for the code suggestion although it still doesn't fix
the bug. I am curious as to what those brackets do as well.
Okay, my bad for writing the
On Thursday, 5 January 2023 at 11:55:33 UTC, thebluepandabear
wrote:
I am using CSFML D bindings and I have created my own sort of
UI library for drawing elements onto the screen.
One of the classes I've created is a `Button` class, which
contains a delegate called `onButtonClick` which is
On Thursday, 5 January 2023 at 09:10:00 UTC, areYouSureAboutThat
wrote:
I was playing around with betterC, when I discovered, that if i
accidently forget to provide -betterC to the compiler, it will
still compile this, but, there will be no runtime bounds
checking occuring.
My question is:
On Tuesday, 27 December 2022 at 15:09:11 UTC, Sergei Nosov wrote:
Consider, I have the following code:
```
auto a = [3, 6, 2, 1, 5, 4, 0];
auto indicies = iota(3);
auto ai = indexed(a, indicies);
ai = indexed(ai, iota(2));
writeln(ai);
```
Basically, my idea is to apply
On Sunday, 27 November 2022 at 17:06:31 UTC, vushu wrote:
On Saturday, 16 May 2020 at 17:45:56 UTC, Konstantin wrote:
[...]
I'm actually also very curious about this issue, since I come
from c++ where this is possible, and it is a very common
functionality for example for dependency
On Friday, 25 November 2022 at 17:45:57 UTC, Paul Backus wrote:
On Friday, 25 November 2022 at 14:07:28 UTC, ShadoLight wrote:
On Saturday, 19 November 2022 at 15:00:16 UTC, Paul Backus
wrote:
Since, in your example, `lf` has global lifetime, the
compiler deduces that `lf.fp` also has global
On Wednesday, 23 November 2022 at 11:06:12 UTC, []() {}() wrote:
On Wednesday, 23 November 2022 at 09:51:46 UTC, FeepingCreature
wrote:
Why then should a programming language insist that all other
code in the module should be able to bypass my specification,
and do as it pleases to my
On Sunday, 13 November 2022 at 18:51:09 UTC, Siarhei Siamashka
wrote:
On Saturday, 12 November 2022 at 14:07:46 UTC, Per Nordlöw
wrote:
Have anybody created a wrapper container
```d
struct Sorted(ArrayLike, alias lessThanPred)
```
that wraps an array-like type `ArrayLike` so that it's always
On Tuesday, 8 November 2022 at 00:05:18 UTC, vushu wrote:
Any where to find learning material for using dmd as a library?
thanks.
https://github.com/Superbelko/dmdlib-notes
This is the only resource I know of
On Thursday, 3 November 2022 at 15:40:02 UTC, H. S. Teoh wrote:
On Thu, Nov 03, 2022 at 04:41:14AM +, Siarhei Siamashka via
Digitalmars-d-learn wrote: [...]
```D
@safe:
import std.stdio;
class A {
void foo() { writeln("foo"); }
}
void main() {
auto a1 = new A;
a1.foo(); // prints
On Thursday, 3 November 2022 at 04:41:14 UTC, Siarhei Siamashka
wrote:
C++ code:
```C++
#include
class A {
public:
void foo() { std::cout << "foo" << std::endl; }
};
int main() {
auto a1 = new A;
a1->foo(); // prints "foo"
A a2;
a2.foo(); // prints "foo"
delete a1;
}
```
D code:
On Tuesday, 1 November 2022 at 23:40:22 UTC, Christian Köstlin
wrote:
Dear dlang-folk,
one of the tools I always return to is rake
(https://ruby.github.io/rake/). For those that do not know it,
its a little like make in the
sense that you describe your build as a graph of tasks with
On Tuesday, 1 November 2022 at 15:49:54 UTC, Keivan Shah wrote:
On Tuesday, 1 November 2022 at 15:42:43 UTC, Imperatorn wrote:
On Tuesday, 1 November 2022 at 15:40:04 UTC, Keivan Shah wrote:
Hello,
Today I came across a strange bug while using D with `dmd`. I
have still not been able to
On Friday, 21 October 2022 at 22:03:53 UTC, Kevin Bailey wrote:
I'm trying to do this equivalent C++:
unordered_map map;
for (auto i = map.find(something); i != map.end(); ++i)
...do something with i...
in D, but obviously with an associative array. It seems that
it's quite
On Saturday, 24 September 2022 at 23:04:00 UTC, rassoc wrote:
On 9/24/22 15:28, Adam D Ruppe via Digitalmars-d-learn wrote:
gdb --args ./your_program
and then it will tell you all the details you want to know
about when this happens.
Thank you for your input, Adam. Real shame that there's
On Tuesday, 13 September 2022 at 03:13:59 UTC, Daniel Donnell, Jr
wrote:
On Sunday, 11 September 2022 at 02:14:51 UTC, zjh wrote:
On Saturday, 10 September 2022 at 22:07:32 UTC, Ali Çehreli
wrote:
On 9/10/22 13:04, Daniel Donnell wrote:
> https://dlang.org/spec/cpp_interface.html
At DConf,
On Friday, 2 September 2022 at 18:39:27 UTC, rikki cattermole
wrote:
I think you are wanting opAssign not opBinary.
Also you made a mistake, since its a struct you don't want to
new it when you construct and return it.
```d
return new Time(secos / 3600, (secos % 3600) / 60, secos % 60);
```
On Friday, 19 August 2022 at 16:36:24 UTC, MyNameHere wrote:
On Friday, 19 August 2022 at 14:30:50 UTC, kinke wrote:
Oh and `DevicePath()` is a convenience member returning a
pointer to the 'dynamic array' (as the array decays to a
pointer in C too), so no need to fiddle with `.offsetof` and
On Wednesday, 10 August 2022 at 14:11:04 UTC, Ruby The Roobster
wrote:
On Saturday, 6 August 2022 at 13:20:19 UTC, Sergey wrote:
On Thursday, 4 August 2022 at 13:01:30 UTC, Ruby The Roobster
wrote:
Is there any implementation in phobos of something similar to
BigInt but for non-integers as
On Wednesday, 22 June 2022 at 16:02:00 UTC, mw wrote:
Hi,
I know with PyD, D can call Python, and with autowrap, Python
can call a D .dll, I'm just wondering if someone can show an
example that Python <==> d can call both ways? esp. show
passing D objects to Python and then call its member
On Tuesday, 21 June 2022 at 17:09:28 UTC, JG wrote:
Suppose we are often writing something like
```d
theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]=x;
```
One would like to something like
```d
alias shortName =
On Friday, 17 June 2022 at 01:04:28 UTC, Paul Backus wrote:
Nope. The way UFCS works is that allows you to call free
functions using member-function syntax, and member-function
syntax is always `object.memberName`, so UFCS only works for
functions that have a name, not anonymous functions.
On Sunday, 12 June 2022 at 05:05:46 UTC, forkit wrote:
Is it possible to create a package.d, consisting of (for
example), two modules, where each module can access private
declarations within each other.
In essence, declaring 'a module level friendship', or a kind of
'extended module' if you
On Saturday, 11 June 2022 at 11:51:43 UTC, Tejas wrote:
On Saturday, 11 June 2022 at 10:07:46 UTC, test123 wrote:
how to work this around.
```d
__gshared const TEST = import(`onlineapp.d`);
extern(C) void main(){
__gshared bin_ptr = TEST.ptr;
}
```
```sh
dmd2 -betterC -J. onlineapp.d
On Saturday, 11 June 2022 at 10:07:46 UTC, test123 wrote:
how to work this around.
```d
__gshared const TEST = import(`onlineapp.d`);
extern(C) void main(){
__gshared bin_ptr = TEST.ptr;
}
```
```sh
dmd2 -betterC -J. onlineapp.d
onlineapp.d(3): Error: cannot use non-constant CTFE
On Thursday, 2 June 2022 at 01:49:32 UTC, Ruby The Roobster wrote:
On Thursday, 2 June 2022 at 01:29:39 UTC, Ruby The Roobster
wrote:
On Thursday, 2 June 2022 at 01:00:57 UTC, Ali Çehreli wrote:
On 6/1/22 17:36, Ruby The Roobster wrote:
> A stripped down version of some code I have:
Not much
On Tuesday, 31 May 2022 at 08:51:45 UTC, realhet wrote:
Hi,
In my framework I just found a dozen of compile time error
handling like:
...else static assert("Invalid type");
This compiles without error. And it was useless for detecting
errors because I forgot the first "false" or "0"
On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote:
I am trying to build a project with GDC. It successfully
compiles with dmd and ldmd2. When I use gdc in one go the
binary is successfully build:
[...]
Is seperate compilation working successfully for dmd and ldc?
The only bug I know
On Friday, 27 May 2022 at 08:39:08 UTC, vit wrote:
Hello, I have this problem:
```d
static int i;
void bar(T)(){
static if(is(T == int))
(()@system => 1)();
static if(is(T == float))
i = 42;
}
void foo(T)(){
bar!T();
}
void main()@safe pure{
On Tuesday, 24 May 2022 at 02:29:38 UTC, cc wrote:
```d
import core.memory;
import core.stdc.stdlib : malloc, free;
import core.lifetime : emplace;
[...]
FWIW your code will compile if you add `extern(C++)` to `Foo`
On Friday, 20 May 2022 at 02:37:48 UTC, harakim wrote:
I need to write a piece of software to track and categorize
some purchases. It's the kind of thing I could probably write
in a couple of hours in C#/Java + html/css/javascript. However,
something keeps drawing me to D and as this is a
On Wednesday, 18 May 2022 at 21:52:18 UTC, HuskyNator wrote:
On Wednesday, 18 May 2022 at 21:49:14 UTC, HuskyNator wrote:
After updating to `DMD 2.100.0` & `DUB 1.29.0`, I still get
this behavior.
Only when I use `dub run --b=debug` however (default for me).
`dub run --b=release` does return
On Wednesday, 18 May 2022 at 01:04:16 UTC, Alain De Vos wrote:
I tried neovim editor & serve-d and failed.
I tried kate editor & serve-d and failed.
https://github.com/Pure-D/serve-d
Anyone has a clue ?
I'm using [lunarvim](https://github.com/LunarVim/LunarVim). It
provides you the ability
On Tuesday, 17 May 2022 at 09:38:31 UTC, Sergey wrote:
On Monday, 16 May 2022 at 17:32:20 UTC, Allen Garvey wrote:
I'm working on a comparison of WebAssembly performance for
error propagation dithering using D, C++ and Zig. So far C++
and Zig work as expected, but for D, despite using the same
On Sunday, 15 May 2022 at 21:33:24 UTC, Ali Çehreli wrote:
D programmers don't write move constructors or move assignment.
Such concepts don't even exist.
Never say never :
https://github.com/dlang/DIPs/blob/master/DIPs/DIP1040.md
Walter is one of the authors of the DIP
Also, there's
On Friday, 13 May 2022 at 03:31:53 UTC, Ali Çehreli wrote:
On 5/12/22 18:56, forkit wrote:
> So...you want to do a talk that challenges D's complexity, by
getting
> back to basics?
I wasn't thinking about challenging complexity but it gives me
ideas.
I am looking for concrete topics like
On Friday, 13 May 2022 at 04:19:26 UTC, Ola Fosheim Grøstad wrote:
On Friday, 13 May 2022 at 03:31:53 UTC, Ali Çehreli wrote:
On 5/12/22 18:56, forkit wrote:
> So...you want to do a talk that challenges D's complexity, by
getting
> back to basics?
I wasn't thinking about challenging
On Thursday, 12 May 2022 at 15:18:34 UTC, jmh530 wrote:
On Thursday, 12 May 2022 at 12:13:32 UTC, Basile B. wrote:
[snip]
```
is ( Type : TypeSpecialization , TemplateParameterList )
is ( Type == TypeSpecialization , TemplateParameterList )
is ( Type Identifier : TypeSpecialization ,
On Wednesday, 11 May 2022 at 14:20:07 UTC, H. S. Teoh wrote:
On Wed, May 11, 2022 at 01:37:21PM +, matheus via
Digitalmars-d-learn wrote:
> [...]
[...]
[...]
[...]
My suggestion is: when prototyping, don't even think about
attributes. Just templatize your functions and let the compiler
On Tuesday, 10 May 2022 at 11:33:24 UTC, frame wrote:
On Tuesday, 10 May 2022 at 11:26:44 UTC, frame wrote:
On Tuesday, 10 May 2022 at 03:18:14 UTC, Tejas wrote:
Can you try
Makes no difference.
OK, I tried it in separate test and works. Weird, I already
tried that before, there must be
On Tuesday, 10 May 2022 at 01:00:24 UTC, frame wrote:
So `__traits(getOverloads)` returns also templated members and
`__traits(isTemplate)` can select those members. Unfortunately,
`Parameters!` does not work with the templated member. How can
I pass a symbol of T or A... to `Parameters!` as
On Saturday, 7 May 2022 at 18:36:40 UTC, jmh530 wrote:
In the code below, there is a two parameter function `foo` and
an override of it with only one parameter. In the override
case, I force the second one to be 1, but ideally there should
be a way to specify it at compile-time.
It would be
On Sunday, 8 May 2022 at 01:38:55 UTC, jmh530 wrote:
On Saturday, 7 May 2022 at 23:30:37 UTC, Paul Backus wrote:
[snip]
Worth noting that you *can* write
```d
alias foo = partial!(foo, a);
```
...which will add the partially-applied version to `foo`'s
overload set.
You sure about that?
On Friday, 6 May 2022 at 08:25:34 UTC, Siarhei Siamashka wrote:
On Friday, 6 May 2022 at 07:05:35 UTC, zjh wrote:
For example, I think `d` can also make use of `'winrt'`, which
is very important for `GUI` programming . `D` officials should
pay attention to `it`.
I have downloaded `dwinrt`
On Tuesday, 3 May 2022 at 12:59:31 UTC, Alain De Vos wrote:
Error: array literal in @nogc function test.myfun may cause a
GC allocation
@nogc void myfun(){
scope int[] i=[1,2,3];
}//myfun
May is a fuzzy word...
For this particular piece of code, you can use a static array to
On Tuesday, 3 May 2022 at 00:38:34 UTC, Tejas wrote:
On Monday, 2 May 2022 at 22:01:51 UTC, ag0aep6g wrote:
On 02.05.22 22:47, Stanislav Blinov wrote:
On Monday, 2 May 2022 at 20:16:04 UTC, ag0aep6g wrote:
On 02.05.22 21:17, Stanislav Blinov wrote:
On Monday, 2 May 2022 at 16:29:05 UTC,
On Monday, 2 May 2022 at 22:01:51 UTC, ag0aep6g wrote:
On 02.05.22 22:47, Stanislav Blinov wrote:
On Monday, 2 May 2022 at 20:16:04 UTC, ag0aep6g wrote:
On 02.05.22 21:17, Stanislav Blinov wrote:
On Monday, 2 May 2022 at 16:29:05 UTC, Loara wrote:
[...]
```d
template MyAlias(T){
On Sunday, 1 May 2022 at 03:57:12 UTC, Elfstone wrote:
module test;
struct MatrixImpl(S, size_t M, size_t N)
{
}
[...]
AFAICT, I'm afraid you'll have to stick to `dot2`
This DIP I believe does what you want but... It wasn't looked
upon favorably...
On Saturday, 30 April 2022 at 14:29:56 UTC, notsteve wrote:
Hi,
I am trying to setup a simple webserver in D using vibe.d
(0.9.4) and want to use mongoDB as a database. To achieve this,
I've set up a mongoDB atlas instance with the following command
inside the standard app.d file created by
On Saturday, 30 April 2022 at 09:25:18 UTC, Dukc wrote:
On Sunday, 24 April 2022 at 21:00:50 UTC, Alain De Vod wrote:
[...]
A few picks.
1: You do not need to import `destroy`. Everything in `object`
is automatically imported.
[...]
Hell, just using `scope int[] i` should be enough to
On Friday, 29 April 2022 at 16:10:52 UTC, Salih Dincer wrote:
On Friday, 29 April 2022 at 12:57:15 UTC, Steven Schveighoffer
wrote:
[...]
I see, think it can be done with mixin:
```d
template prn(alias args)
{
string prn()
{
string result = "write(";
foreach(s; args.split("|"))
On Friday, 29 April 2022 at 12:57:15 UTC, Steven Schveighoffer
wrote:
On 4/28/22 10:48 PM, Salih Dincer wrote:
[...]
There is no string interpolation in D. You can use a function
such as `std.conv.text` to produce a string given interleaving
strings and items. Or you can use
On Sunday, 24 April 2022 at 09:31:40 UTC, elfstone wrote:
Dub(DMD 2.099.1) builds and runs the following code without a
warning.
import std.stdio;
import core.stdc.stdlib;
@live
void test()
{
int* p = cast(int*) malloc(32);
p = cast(int*) malloc(32);
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote:
Here I try to concatenate three character strings using
`wcsncat()`.
[...]
Maybe try using `wstring` instead of string? Also use the `w`
postfix
```d
wstring dlang_string = "BBB"w;
I can't test because I'm not on my PC and I
On Wednesday, 6 April 2022 at 10:36:04 UTC, francesco.andreetto
wrote:
I have two structs, point and vec, in which I want to implement
some arithmetic operations.
The operations are:
```
point - point = vec
point + vec = point
```
Using mixin templates the code compiles but calling the
On Sunday, 3 April 2022 at 08:37:45 UTC, user1234 wrote:
On Saturday, 2 April 2022 at 21:57:02 UTC, Marcone wrote:
Where I download Digital Mars C Preprocessor sppn.exe? I need
it to use ImportC
it's part of the [DMC] toolchain.
[DMC]:
On Wednesday, 30 March 2022 at 12:46:07 UTC, Vijay Nayar wrote:
Consider the following code example:
```d
import std.stdio;
void main()
{
alias DelegateT = string delegate();
// An array of delegates, each has their own scope.
DelegateT[] funcs;
foreach (i; ["ham", "cheese"]) {
//
On Thursday, 24 February 2022 at 06:54:07 UTC, eugene wrote:
On Thursday, 24 February 2022 at 06:30:51 UTC, Tejas wrote:
On Wednesday, 23 February 2022 at 09:34:56 UTC, eugene wrote:
On Tuesday, 22 February 2022 at 20:19:39 UTC, Chris Piker
wrote:
[...]
As you might have been already noted,
On Wednesday, 23 February 2022 at 09:34:56 UTC, eugene wrote:
On Tuesday, 22 February 2022 at 20:19:39 UTC, Chris Piker wrote:
[...]
As you might have been already noted,
the key idea is to implement SM explicitly,
i.e we have states, messages, actions, transitions
and extremely simple engine
On Wednesday, 2 February 2022 at 23:21:52 UTC, forkit wrote:
Any reason why compiling this with ldc would cause the exe to
crash?
Compiling with DMD (using either declaration of palindrome
works just fine though)
//
module test;
import std;
void main()
{
char[] palindrome =
On Tuesday, 18 January 2022 at 20:43:08 UTC, forkit wrote:
On Tuesday, 18 January 2022 at 16:02:42 UTC, Tejas wrote:
Newer languages nowadays use `start..intent, think it's something we should follow?
I've decided to avoid using number ranges 'directly', and
instead use a wrapper
On Tuesday, 18 January 2022 at 17:58:54 UTC, H. S. Teoh wrote:
On Tue, Jan 18, 2022 at 04:02:42PM +, Tejas via
Digitalmars-d-learn wrote: [...]
Newer languages nowadays use `start..intent, think it's something we should follow?
I've never seen that before. Which languages use that?
T
On Monday, 17 January 2022 at 22:48:17 UTC, H. S. Teoh wrote:
On Mon, Jan 17, 2022 at 10:35:30PM +, forkit via
Digitalmars-d-learn wrote:
On Monday, 17 January 2022 at 22:28:10 UTC, H. S. Teoh wrote:
> [...]
[...]
If I were able to write a compiler, my compiler would warn you:
"This is
On Thursday, 6 January 2022 at 16:01:09 UTC, Stefan Koch wrote:
On Thursday, 6 January 2022 at 12:04:12 UTC, HuskyNator wrote:
On Monday, 28 November 2016 at 14:41:44 UTC, Era Scarecrow
wrote:
On Monday, 28 November 2016 at 09:06:34 UTC, Paolo Invernizzi
wrote:
The point is that I was trying
On Wednesday, 5 January 2022 at 16:14:02 UTC, Ben Jones wrote:
On Wednesday, 5 January 2022 at 03:38:54 UTC, Tejas wrote:
On Tuesday, 4 January 2022 at 18:13:56 UTC, Ben Jones wrote:
The tricky part is that the lab machines that the students
will be using don't have a D compiler installed
On Wednesday, 5 January 2022 at 08:58:44 UTC, Dennis wrote:
On Wednesday, 5 January 2022 at 05:38:45 UTC, Tejas wrote:
The entire reason I wanted to get a `ref` was so that I can
avoid the `*` :(
I don't know what the real code behind the reduced example is,
but maybe you can structure your
On Wednesday, 5 January 2022 at 05:17:10 UTC, Stanislav Blinov
wrote:
It is returned. But initializing `c` with it makes a copy.
Oh...
Wish we had real `ref` ;(
This will mutate `a`:
```
func(a) = 10;
```
Thank you for your help!
On Wednesday, 5 January 2022 at 05:15:30 UTC, Paul Backus wrote:
On Wednesday, 5 January 2022 at 04:35:12 UTC, Tejas wrote:
```d
import std.stdio:writeln;
ref int func(return ref int a){
a = 6; // modifies a as expected
return a;
}
void main(){
int a = 5;
auto c = func(a); // I
```d
import std.stdio:writeln;
ref int func(return ref int a){
a = 6; // modifies a as expected
return a;
}
void main(){
int a = 5;
auto c = func(a); // I expected c to alias a here
c = 10; // Expected to modify a as well
writeln(a); // prints 6 :(
}
```
The
On Tuesday, 4 January 2022 at 18:13:56 UTC, Ben Jones wrote:
The tricky part is that the lab machines that the students will
be using don't have a D compiler installed (they're Fedora
machines, and I didn't see a dmd package in their repos, or I
would have asked the admins to install it).
On Friday, 31 December 2021 at 00:57:26 UTC, kdevel wrote:
```dptr.d
class R {
}
void foo (R r)
{
}
alias fn = void function (R);
void lyr (fn F) (R r)
{
}
immutable fn foo_ptr = // line 14
pragma (msg, typeof (foo_ptr));
auto ptr = lyr!(foo_ptr);// line 17
```
dmd reports:
```
On Thursday, 30 December 2021 at 17:31:27 UTC, eugene wrote:
On Thursday, 30 December 2021 at 16:49:17 UTC, Tejas wrote:
I _think_ the above code is correct, please verify
Self-contained example:
```d
import std.stdio;
import std.string;
void main() {
ubyte[8] b = [0x68, 0x65, 0x6C,
On Thursday, 30 December 2021 at 17:07:20 UTC, eugene wrote:
On Thursday, 30 December 2021 at 16:49:17 UTC, Tejas wrote:
```d
char[] s = cast(char[])ioCtx.buf[0 .. $];// please remember
that in `[0 .. $]` last index is automatically `length - 1`
but just buf[$] will be an error since there
On Thursday, 30 December 2021 at 09:34:27 UTC, eugene wrote:
I suspect the question was asked somewhere before.
If so just give a link.
Anyway:
```d
class IoContext {
...
ubyte[] buf;
...
this(uint bufSize) {
buf = new ubyte[bufSize];
}
}
```
```d
class
On Thursday, 30 December 2021 at 04:42:06 UTC, Tejas wrote:
On Thursday, 30 December 2021 at 01:04:10 UTC, Ali Çehreli
wrote:
The second item in the documentation mentions "any number of
default parameters" when describing copy constructor syntax:
On Thursday, 30 December 2021 at 01:04:10 UTC, Ali Çehreli wrote:
The second item in the documentation mentions "any number of
default parameters" when describing copy constructor syntax:
https://dlang.org/spec/struct.html#struct-copy-constructor
1) I can't figure out how to use those extra
On Tuesday, 28 December 2021 at 18:27:36 UTC, vit wrote:
Hi, why this code doesn't compile?
```d
struct Foo{
bool opCast(T : bool)()const{
assert(0);
}
~this(){}
}
struct Bar{
const Foo foo;
}
void main(){
}
```
Error: template instance `opCast!(Foo)` does not
On Tuesday, 28 December 2021 at 16:29:05 UTC, Bagomot wrote:
I can't do it according to your example, my Watcher list fills
up at runtime.
Yes, it's possible to do it at runtime as well(it already _was_
happening at runtime), although I'll be using a `cast` for
convenience now.
```d
On Tuesday, 28 December 2021 at 14:19:46 UTC, Bagomot wrote:
On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote:
On 12/27/21 1:33 AM, Bagomot wrote:
> separate thread, without blocking the main one.
I think you can use std.concurrency there. I have a chapter
here:
On Tuesday, 28 December 2021 at 01:45:42 UTC, Era Scarecrow wrote:
On Monday, 27 December 2021 at 19:38:38 UTC, frame wrote:
[...]
const/immutable members are to be set/assigned instantiation.
Most likely the problem is a bug and sounds like
[...]
The workaround is okay, but I think we
On Wednesday, 22 December 2021 at 11:50:06 UTC, evilrat wrote:
On Wednesday, 22 December 2021 at 10:37:51 UTC, Michel wrote:
Hey, I've tried coding in Visual Studio Code but there isn't
any function checking/showing what arguments a function
accepts, I can just write
On Monday, 20 December 2021 at 11:58:03 UTC, Tim wrote:
On Monday, 20 December 2021 at 10:24:00 UTC, Jan wrote:
Is this a known issue, or is there a way to instruct DMD to
use a specific calling convention for a given type?
This looks like a bug. It seems to work without constructor in
C++,
On Monday, 20 December 2021 at 11:30:09 UTC, rumbu wrote:
On Monday, 20 December 2021 at 10:49:20 UTC, rempas wrote:
On Monday, 20 December 2021 at 09:30:30 UTC, rumbu wrote:
Thanks a lot for the info. When I try to use this code, I'm
getting the following error:
```
Error: expression
On Sunday, 19 December 2021 at 22:29:21 UTC, vit wrote:
Hello,
Why is copy ctor in this example not called?
```d
import std.stdio;
struct Foo {
int i;
this(int i){
this.i = i;
writeln("init: ", i);
}
this(ref typeof(this) rhs){
this.i = rhs.i;
On Sunday, 19 December 2021 at 02:57:35 UTC, Mike Parker wrote:
On Saturday, 18 December 2021 at 22:31:38 UTC, bachmeier wrote:
I've been trying to get the stb header library to compile.
There's a single remaining failure:
```
typedef struct
{
unsigned char c[4];
} stb_easy_font_color;
On Saturday, 18 December 2021 at 11:01:53 UTC, Denis Feklushkin
wrote:
On Friday, 17 December 2021 at 19:03:05 UTC, Tejas wrote:
Well, I got completely mislead by my experiment
```d
struct S
{
~this() immutable {}
}
```
Interesting what discussed behaviour isn't affects method what
On Friday, 17 December 2021 at 18:51:56 UTC, Ali Çehreli wrote:
On 12/17/21 10:01 AM, Tejas wrote:
> [...]
Storage,
There is no such requirement nor guarantee.
[...]
Well, I got completely mislead by my experiment
```d
struct S
{
~this() immutable {}
}
void main()
{
immutable S
On Friday, 17 December 2021 at 18:32:43 UTC, Denis Feklushkin
wrote:
On Friday, 17 December 2021 at 18:02:52 UTC, Tejas wrote:
I improved your sample:
```d
immutable struct S
{
~this() {}
}
immutable struct S2
{
S sss;
~this() {}
}
void main()
{
S2 s = S2();
}
```
```
Error:
On Friday, 17 December 2021 at 18:19:34 UTC, Denis Feklushkin
wrote:
On Friday, 17 December 2021 at 18:01:03 UTC, Tejas wrote:
I think since `immutable` objects are kept in Read Only Storage
Some of them can be stored in ROM in some cases, but actually
"immutable" keyword means "not mutable
On Friday, 17 December 2021 at 18:01:03 UTC, Tejas wrote:
On Friday, 17 December 2021 at 17:34:05 UTC, Denis Feklushkin
wrote:
On Friday, 17 December 2021 at 17:27:53 UTC, Denis Feklushkin
wrote:
[...]
("serializer_bug" is just name of my local .d file)
I think since `immutable`
On Friday, 17 December 2021 at 17:34:05 UTC, Denis Feklushkin
wrote:
On Friday, 17 December 2021 at 17:27:53 UTC, Denis Feklushkin
wrote:
~this() {} // Comment out this to fix this compilation
error:
// Error: `immutable` method `serializer_bug.Imm.~this` is
("serializer_bug" is
On Tuesday, 14 December 2021 at 15:14:40 UTC, Steven
Schveighoffer wrote:
On 12/14/21 12:04 AM, Tejas wrote:
Is there anything wrong with the answer I posted?
Can you please tell me if there's anything dissatisfactory
about it? I feel like it does everything the OP wants.
Also, am I wrong
On Tuesday, 14 December 2021 at 13:25:04 UTC, apz28 wrote:
On Tuesday, 14 December 2021 at 05:04:46 UTC, Tejas wrote:
Is there anything wrong with the answer I posted?
Can you please tell me if there's anything dissatisfactory
about it? I feel like it does everything the OP wants.
Also, am
On Tuesday, 14 December 2021 at 12:04:36 UTC, RazvanN wrote:
On Sunday, 12 December 2021 at 11:57:43 UTC, vit wrote:
[...]
The problem is that the compiler will try to generate an inout
copy constructor for Bar that looks roughly like this:
```
this(ref scope inout(Bar) p) inout
{
On Monday, 13 December 2021 at 12:08:30 UTC, evilrat wrote:
On Monday, 13 December 2021 at 11:13:12 UTC, Tejas wrote:
On Monday, 13 December 2021 at 09:21:26 UTC, Jan wrote:
[...]
You'll have to use something called a
[shim](https://en.wikipedia.org/wiki/Shim_(computing)), it
seems.
For
On Monday, 13 December 2021 at 22:30:59 UTC, Adam D Ruppe wrote:
On Monday, 13 December 2021 at 22:06:45 UTC, chopchop wrote:
If I remove the ref, it works as expected, that is to say I
can give a derived class as parameter.
Why are you using the ref to begin with?
What the logic here?
On Monday, 13 December 2021 at 20:43:51 UTC, Steven Schveighoffer
wrote:
On 12/11/21 10:02 PM, apz28 wrote:
On Sunday, 12 December 2021 at 00:02:25 UTC, Stanislav Blinov
wrote:
@apz28, I can't figure out the intent here. To convert result
of abs to an unsigned?
The function logic works only
On Monday, 13 December 2021 at 09:21:26 UTC, Jan wrote:
On Monday, 13 December 2021 at 07:48:34 UTC, evilrat wrote:
On Sunday, 12 December 2021 at 21:24:39 UTC, Jan wrote:
In D I have an extern(C++) class:
```cpp
extern(C++) class A
{
~this();
// other stuff
}
```
An a function that
On Sunday, 12 December 2021 at 19:17:53 UTC, vit wrote:
On Sunday, 12 December 2021 at 18:32:28 UTC, Imperatorn wrote:
On Sunday, 12 December 2021 at 11:57:43 UTC, vit wrote:
Hello, why does this code fail to compile?
```d
struct Foo(T){
this(Rhs, this This)(scope Rhs rhs){
}
On Sunday, 12 December 2021 at 03:02:28 UTC, apz28 wrote:
On Sunday, 12 December 2021 at 00:02:25 UTC, Stanislav Blinov
wrote:
@apz28, I can't figure out the intent here. To convert result
of abs to an unsigned?
The function logic works only for unsigned type and the
parameter value can be
1 - 100 of 253 matches
Mail list logo