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 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 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 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 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 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, 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 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 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 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 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, 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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, 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 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 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 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 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 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 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 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 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 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, 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 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 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 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 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 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, 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 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
201 - 253 of 253 matches
Mail list logo