On Monday, 28 July 2025 at 11:06:40 UTC, kinke wrote:
On Sunday, 27 July 2025 at 23:23:40 UTC, user1234 wrote:
That is confusing
It affects the mangling of global vars, just like functions.
ah indeed
That is confusing, e.g
```
extern(C) int r;
int main()
{
return r;
}
```
works. But what is likely more intended here is
```
extern int r;
int main()
{
return r;
}
```
which leads, this time, to the expected linker error.
On Sunday, 27 July 2025 at 15:14:03 UTC, H. S. Teoh wrote:
On Sun, Jul 27, 2025 at 11:08:33AM +, David T. Oxygen via
Digitalmars-d-learn wrote:
I wrote a piece of code like this:
```d
class Person{
string name;
this(string name){this.name=name;}
}
class Someone:Person{
On Sunday, 20 July 2025 at 08:46:08 UTC, Salih Dincer wrote:
Hello D Language Forum!
I’m running the InputRange example below and it dutifully reads
from stdin until it spots a tilde, printing each character in
every loop iteration. I even tried to break out with F6 but
couldn’t get it to sto
On Monday, 23 June 2025 at 10:37:58 UTC, Dom DiSc wrote:
I think scope should not be allowed on basic types, as it has
no effect and is only confusing.
I know, it would be needed to enable generic programming, but I
find a function that can take both an int and an int* suspect
anyway - this is
On Monday, 28 April 2025 at 22:47:35 UTC, monkyyy wrote:
On Monday, 28 April 2025 at 22:16:47 UTC, user1234 wrote:
On Monday, 28 April 2025 at 20:05:34 UTC, monkyyy wrote:
aliases for types, overload sets
enum for litterals
According to me that's a very bad advice. I'm more on "never
enum"
On Monday, 28 April 2025 at 20:05:34 UTC, monkyyy wrote:
aliases for types, overload sets
enum for litterals
According to me that's a very bad advice. I'm more on "never
enum". Do you have any example where enum is better ?
On Monday, 28 April 2025 at 04:59:24 UTC, Orion wrote:
In which programming scenarios should alias be used instead of
enum?
So far I have only found a simplified notation of a generic
lambda:
alias id = (x) => x; x; , which does not work in the case of
enum.
There is also a difference in ov
On Saturday, 12 April 2025 at 03:22:06 UTC, faceless wrote:
What is the purpose of hiding the `aligned_alloc` declaration
like this in `core.stdc.stdlib`?
```d
29version (CRuntime_Glibc)
30version = AlignedAllocSupported;
31else version (CRuntime_Newlib)
32version = A
On Saturday, 5 April 2025 at 07:48:27 UTC, Aditya Vir wrote:
Hello everyone,
I am Aditya, a computer science undergrad from India. I want to
push my application to D lang for this year's Google summer of
Code.
I seek tips and advice regarding how should I frame my
application.
Here is my cur
On Saturday, 1 March 2025 at 02:19:55 UTC, Meta wrote:
Thanks, I forgot about that syntax. Another question I have is
if there's a way to do this inline:
```d
struct Test
{
int n;
float f;
static Test opCall(int n, float f)
{
//return {n, f};Error
On Wednesday, 26 February 2025 at 16:38:20 UTC, Salih Dincer
wrote:
On Wednesday, 26 February 2025 at 15:11:47 UTC, bkoie wrote:
stuff like this is not even necessary if you dont need it now
dont delcare an easy workaround is use some copy dictionary.
It's not that simple. I found the followi
On Sunday, 2 February 2025 at 01:12:59 UTC, user1234 wrote:
On Saturday, 1 February 2025 at 21:56:23 UTC, Jabari Zakiya
wrote:
On Saturday, 1 February 2025 at 00:21:22 UTC, user1234 wrote:
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya
wrote:
[...]
A first draft of the translation
On Saturday, 1 February 2025 at 21:56:23 UTC, Jabari Zakiya wrote:
On Saturday, 1 February 2025 at 00:21:22 UTC, user1234 wrote:
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya
wrote:
[...]
A first draft of the translation, not very idiomatic D code:
```d
module prime_pairs;
import
On Friday, 31 January 2025 at 20:05:54 UTC, Jabari Zakiya wrote:
I'm converting Ruby code to D and am running into issues.
Would appreciate what needs to be done to get it to compile/run
correctly.
Here's the Ruby code:
[...]
A first draft of the translation, not very idiomatic D code:
```
On Thursday, 9 January 2025 at 23:44:52 UTC, WhatMeWorry wrote:
You misspelled the parameter name 'locaction', so your
assignment in the constructor is a no-op:
```
this.location = this.location
```
Thanks. I was starting to question my sanity.
That error is so classic that eventually a we
On Wednesday, 25 December 2024 at 16:41:05 UTC, sfp wrote:
On Wednesday, 25 December 2024 at 07:57:04 UTC, monkyyy wrote:
static foreach, traits and mixin
I was looking into this but I think I need some help getting
off the ground...
This doesn't compile:
```
enum Test { mixin("A, B, C") }
On Thursday, 19 December 2024 at 18:49:28 UTC, sfp wrote:
Subject lines says it all, I think... The choice to make binary
operators implementable only via this `opBinary` template means
it's unclear how to get virtual operators on an interface.
E.g., this toy example *does* compile:
```
interf
On Sunday, 15 December 2024 at 08:45:22 UTC, DLearner wrote:
Please consider:
```
size_t foo() {
static size_t var1 = 1;
var1 = var1 + 1;
return var1;
}
unittest {
assert(foo() == 2);
assert(foo() == 3);
}
```
which works as expected.
But
```
size_t foo1() {
static size_
On Wednesday, 11 December 2024 at 04:33:58 UTC, Salih Dincer
wrote:
On Wednesday, 11 December 2024 at 03:40:35 UTC, user1234 wrote:
what's the `MonoTime` equivalent of the now deprecated
`TickDuration.currSystemTick.msecs` ?
```d
import core.time;
// Get the current monotonic time
auto curren
On Friday, 22 November 2024 at 16:36:43 UTC, Andrew wrote:
I'm getting started using D for some small personal projects
and one thing I wanted to do was use a helper function for a
tuple. I declared the function like this:
string getOrZeroth(Tuple!(string, string, string) tup, int
i) pure
On Tuesday, 19 November 2024 at 09:08:46 UTC, Adrian Preuß wrote:
Hey,
I'm looking at **D** right now because I find it much easier to
create native applications as opposed to C++.
I have the following project structure:
```
- main.d (Booting)
- client.d
- Renderer.d
- Man
On Friday, 8 November 2024 at 23:27:40 UTC, Dom DiSc wrote:
I _very_ often use this pattern:
```
fun(ref int[] a)
{
assert(a.length && a.length<=100);
int[100] b;
b[0 .. a.length-1] = a[];
b[a.length .. 100] = 5;
}
```
I consider this perfectly safe, but DScanner gives warnings for
On Thursday, 14 November 2024 at 06:53:01 UTC, Salih Dincer wrote:
On Friday, 8 November 2024 at 23:27:40 UTC, Dom DiSc wrote:
I _very_ often use this pattern:
```d
fun(ref int[] a)
{
assert(a.length && a.length<=100);
int[100] b;
b[0 .. a.length-1] = a[];
b[a.length .. 100] = 5;
}
On Monday, 14 October 2024 at 20:38:38 UTC, user1234 wrote:
On Monday, 14 October 2024 at 15:59:07 UTC, vinoB wrote:
Hi All,
Request your help in understanding why the below code is
producing different outputs, code 1 output: 4294966806, code
2/3 output: 50331648, and which one is the correct
On Monday, 14 October 2024 at 15:59:07 UTC, vinoB wrote:
Hi All,
Request your help in understanding why the below code is
producing different outputs, code 1 output: 4294966806, code
2/3 output: 50331648, and which one is the correct output.
[...]
`cast(unint)` of a `float` does truncation
On Saturday, 28 September 2024 at 12:20:43 UTC, realhet wrote:
Hi,
I have some statements in my mind about --allinst, but I'm not
sure they are correct or not.
1. Normally the compiler analyzes the full code with all the
modules, and it only compiles code for template things that are
used i
On Thursday, 26 September 2024 at 06:53:12 UTC, Per Nordlöw wrote:
Should a function like
```d
uint parseHex(in char ch) pure nothrow @safe @nogc {
switch (ch) {
case '0': .. case '9':
return ch - '0';
case 'a': .. case 'f':
return 10 + ch
On Saturday, 21 September 2024 at 04:29:15 UTC, user1234 wrote:
```d
module m;
[...]
Beside the childish example... D could use a system of
"constraint matching score" to help Carlos. Three AndAndExps
verified should have a better score than two and finally
determine the selection.
On Wednesday, 11 September 2024 at 10:08:29 UTC, ryuukk_ wrote:
On Wednesday, 11 September 2024 at 09:14:39 UTC, Nick Treleaven
wrote:
On Wednesday, 11 September 2024 at 08:08:45 UTC, ryuukk_ wrote:
[...]
I again apologies for being wrong and i apologies again for
trying to improve things, i d
On Monday, 9 September 2024 at 20:02:48 UTC, Jabari Zakiya wrote:
I have this code to input integer values:
```
ulong[] x;
foreach (_; 0 .. 2) { ulong a; readf!" %d"(a); x ~= a; }
end_num = max(x[0], 3);
start_num = max(x[1], 3);
if (start_num > end_num) swap(start_num, end_num);
sta
On Monday, 5 August 2024 at 03:09:41 UTC, IchorDev wrote:
On Sunday, 4 August 2024 at 10:32:38 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Chuck it into the ideas forum.
If it interests somebody, somebody else can work on it.
Also sometimes if a feature is very minor you can submit a
‘feat
On Thursday, 1 August 2024 at 10:59:03 UTC, IchorDev wrote:
On Thursday, 1 August 2024 at 09:55:08 UTC, user1234 wrote:
The problem would be that sorting the candidates of an
overload set would be more complicated. Also in certain cases
it would be less obvious to get which one is selected.
P
On Thursday, 1 August 2024 at 08:46:00 UTC, IchorDev wrote:
[...]
I’m pretty sure this is intentional to prevent ambiguity, but I
can’t quite remember what the point of that is.
The problem would be that sorting the candidates of an overload
set would be more complicated. Also in certain case
On Monday, 8 July 2024 at 07:29:27 UTC, aberba wrote:
On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote:
On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote:
On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote:
```d
import std.path;
// Error: no property `asNormalie
On Monday, 8 July 2024 at 08:56:51 UTC, drug007 wrote:
I need to generate some meta info of my data types. I do it
this [...]
How can I "break" this recursion or some other work around to
fix it?
Use `Node*[]` for the children type. That way the compiler knows
the size of the (previously) pro
On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote:
On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote:
On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote:
```d
import std.path;
// Error: no property `asNormaliedPath` for
`dirName("/sandbox/onlineapp.d")` of type `
On Monday, 6 May 2024 at 18:06:53 UTC, Julian Fondren wrote:
On Monday, 6 May 2024 at 17:55:49 UTC, user1234 wrote:
I think this just works:
```d
enum Flag : bool
{
no,
yes
}
alias AllowVancancy = Flag; // example usage
```
```d
import std.stdio : writeln;
enum Flag : bool { no, yes
I think this just works:
```d
enum Flag : bool
{
no,
yes
}
alias AllowVancancy = Flag; // example usage
```
Also this is completion friendly whereas Phobos version does not
permit DCD completion as it's based on opDispatch.
Compare to phobos version:
```d
template Flag(string name)
On Friday, 3 May 2024 at 15:19:13 UTC, user1234 wrote:
On Friday, 3 May 2024 at 14:59:57 UTC, BoQsc wrote:
On Friday, 3 May 2024 at 13:18:02 UTC, user1234 wrote:
[...]
So how would you update this example, what is the right index
type here to choose?
```
import std.stdio : writefln;
vo
On Friday, 3 May 2024 at 14:59:57 UTC, BoQsc wrote:
On Friday, 3 May 2024 at 13:18:02 UTC, user1234 wrote:
On Friday, 3 May 2024 at 10:50:03 UTC, BoQsc wrote:
[...]
**You can specify the index type, just choose the right one.**
For now there's a deprecation message but after some while
you'
On Friday, 3 May 2024 at 10:50:03 UTC, BoQsc wrote:
Why am I forced to visit this D Lang thread, why this
deprecation warning still appears in my console window in the
latest version of DMD. Does not make any sense from the
developer's perspective to show this warning and pollute the
already p
On Wednesday, 1 May 2024 at 12:07:26 UTC, NotYouAgain wrote:
I want to do a C like #define on private, but I can't
ie. #define private fileprivate
// ---
module m;
alias fileprivate = private; // grr!
class myClass
{
fileprivate int n;
}
// ---
You cant. That is simply not supported.
On Thursday, 4 April 2024 at 19:56:50 UTC, Ferhat Kurtulmuş wrote:
On Thursday, 4 April 2024 at 18:14:54 UTC, BoQsc wrote:
I'm looking for more readable standard function to add a
**character** literal to a **string**.
The `~` operator is clearly not great while reading a source
code.
I'm not
On Monday, 11 March 2024 at 16:51:48 UTC, Andy Valencia wrote:
On Monday, 11 March 2024 at 16:25:13 UTC, Jonathan M Davis
wrote:
...
But what exactly static means varies based on the context.
Thank you for the list! But none of those appear to apply to a
function defined in the outermost sco
On Saturday, 2 March 2024 at 08:41:40 UTC, Salih Dincer wrote:
SLM,
What exactly did this patch with the new update fix?
Nothing, it looks like what happened is that the issue was
wrongly referenced by a dlang.org PR
(https://github.com/dlang/dlang.org/pull/3701/commits/4e8db30f0bf3c330c3431
I want to share a stupid program to show you that D safety is
more complex than you might think:
```d
module test;
void test() @safe
{
int i;
int b = (*&(*&++i))++;
}
void main() @safe
{
test();
}
```
I'm not showing a deficiency of D, that program is undeniably
safe ;)
On Wednesday, 24 January 2024 at 21:30:23 UTC, user1234 wrote:
On Wednesday, 24 January 2024 at 21:12:20 UTC, atzensepp wrote:
[...]
what a bummer!
Have you tried
https://dlang.org/phobos/std_functional.html#compose ?
Well this violates the second requirement:
the composition itself requi
On Wednesday, 24 January 2024 at 21:12:20 UTC, atzensepp wrote:
[...]
what a bummer!
Have you tried
https://dlang.org/phobos/std_functional.html#compose ?
On Tuesday, 16 January 2024 at 13:37:59 UTC, user1234 wrote:
Implementation detail. D frontend resolves identifiers using
associative arrays (that's called symtabs in the compiler
IIRC), hence the only complexity is the scope (plus the import
decls found while going back to the module scope).
On Tuesday, 16 January 2024 at 13:19:59 UTC, Orfeo wrote:
I found myself a bit perplexed when it comes to the usage of
"nested imports" and selective imports. It seems that prominent
D programmers have varied opinions on the matter. I would love
to hear your insights and experiences on this top
On Monday, 15 January 2024 at 18:34:58 UTC, H. S. Teoh wrote:
On Mon, Jan 15, 2024 at 06:16:44PM +, Bastiaan Veelo via
Digitalmars-d-learn wrote:
Hey people, I can use some help understanding why the last
line produces a compile error.
```d
import std.stdio;
struct S
{
static void foo
On Monday, 15 January 2024 at 18:16:44 UTC, Bastiaan Veelo wrote:
[...]
It seems to me this should just work.
Thanks!
--Bastiaan.
The two calls are not equivalent. To be equivalent you need to
set `S_foo` static too, otherwise `S_Foo` is instanciated in
`main` scope, proof:
```d
import s
On Tuesday, 2 January 2024 at 11:39:12 UTC, Anonymouse wrote:
On Tuesday, 2 January 2024 at 11:05:33 UTC, user1234 wrote:
Do not use `shared` AA. Use `__gshared` + sync primitives.
`shared` AA will lead to all sort of bugs:
- https://issues.dlang.org/show_bug.cgi?id=20484#c1
- https://issues.d
On Monday, 1 January 2024 at 15:48:16 UTC, Anonymouse wrote:
I have a `shared string[int]` AA that I access from two
different threads. The function I spawn to start the second
thread takes the AA as an argument.
[...]
What is the common solution here? Do I add a module-level
`Object thing`
On Friday, 29 December 2023 at 17:11:49 UTC, DLearner wrote:
Compile-time:
[...]
Is there a 'foo1' that yields 1 from the snippet below?
[...]
Similarly, execution-time, is there a foo2 that wields 2 from
the snippet below:
[...]
**compile-tome**
```d
void main() {
import std.stdio;
On Saturday, 2 December 2023 at 16:17:08 UTC, user1234 wrote:
On Saturday, 2 December 2023 at 15:30:39 UTC, zoujiaqing wrote:
[...]
sign is binary, you have to use the toHexString utility :
```d
import std.stdio;
import std.digest.sha;
void main()
{
SHA256 sha256;
sha256.start();
On Saturday, 2 December 2023 at 15:30:39 UTC, zoujiaqing wrote:
```D
import std.stdio;
import std.digest.sha;
void main()
{
SHA256 sha256;
sha256.start();
string appKey =
"1";
ubyte[1024] data = cast(ubyte[])(appKey.dup[0..$]
On Saturday, 2 December 2023 at 13:16:26 UTC, Johannes
Miesenhardt wrote:
Hello,
[...]
I see the way why it doesn't work, but I think it should.
Considering that
`version (Test) {} else {`
works without any issue but looks very ugly.
Can somebody explain if this is an intended decision or wh
On Sunday, 5 November 2023 at 18:36:40 UTC, Ctn-Dev wrote:
I wrote this earlier:
[...]
if runs when both "One" and "Two" are in the given array as
intended, but its conditional statement looks verbose. Is there
a more concise way of getting the same result?
Yes, assuming you accept to drop
On Wednesday, 11 October 2023 at 13:36:16 UTC, Paul wrote:
On Wednesday, 11 October 2023 at 12:54:53 UTC, user1234 wrote:
`extern(C)` on module level functions affect the mangling and
the calling convention.
- Mangling is used by the linker to link symbols between
objects.
- Calling convent
On Wednesday, 11 October 2023 at 12:36:58 UTC, Paul wrote:
What does the extern (c) attribute(?) do?
Does it tell the compiler/linker to build the function like a C
compiler would build a C function? If so what does that mean?
Does it tell the compiler/linker to let C functions know it
exists?
On Thursday, 5 October 2023 at 22:24:06 UTC, mw wrote:
On Thursday, 5 October 2023 at 21:41:38 UTC, cc wrote:
If you have `T info`, T.tupleof[n] will always match up with
info.tupleof[n]. You can think of `info.tupleof[n]` as being
rewritten by the compiler in-place as
info.whateverFieldTha
On Thursday, 5 October 2023 at 20:42:26 UTC, mw wrote:
On Thursday, 5 October 2023 at 20:07:38 UTC, user1234 wrote:
No. Sorry.
Generally compile time code cannot interact with the system.
To be evaluable at compile time code has to be strongly pure,
that is not the case of the function you wo
On Thursday, 5 October 2023 at 18:40:36 UTC, mw wrote:
On Saturday, 24 November 2018 at 15:21:57 UTC, Anonymouse wrote:
On Saturday, 24 November 2018 at 08:44:19 UTC, Domain wrote:
I have a package named command, and many modules inside it,
such as command.build, command.pack, command.help...
I
On Friday, 22 September 2023 at 04:33:44 UTC, Vitaliy Fadeev
wrote:
On Friday, 22 September 2023 at 04:24:19 UTC, Vitaliy Fadeev
wrote:
...
Skip this thread. I see solution.
How to delete missed posts on this forum ?
It's there forever, you have to live with that error ;)
See https://forum
On Thursday, 21 September 2023 at 16:28:25 UTC, Nick Treleaven
wrote:
(Untested)
There might be a `need this` error
On Sunday, 17 September 2023 at 17:15:34 UTC, Timofey wrote:
I`ve just started learning d and have a question.
What should I write to set dinamyc rectangular array length in
both dimentions?
For example, I have declareted an array:
```d
int[][] matrix;
```
and want set it as n*n matrix.
Thank
On Monday, 11 September 2023 at 22:08:54 UTC, Christian Köstlin
wrote:
Just three remarks:
First I would recommend to use `std.process : execute` instead
of
`pipeProcess` in this usecase, as this will wait properly for
the process to exit and it also will collect its output.
Second its alway
On Saturday, 9 September 2023 at 15:44:44 UTC, Vino wrote:
Hi All,
Request your help on how to convert the output of
std.process.pipeProcess to hash string
```
auto test(in Redirect redirect=Redirect.stdout |
Redirect.stderr) {
import std.process;
import std.digest.crc;
import
On Monday, 4 September 2023 at 09:41:54 UTC, BoQsc wrote:
I've seen everyone using **datatype**`.sizeof` property.
https://dlang.org/spec/property.html#sizeof
It's great, but I wonder if it differ in any way from the
standard C function `sizeof()`.
https://www.geeksforgeeks.org/sizeof-operat
On Friday, 25 August 2023 at 21:00:08 UTC, Guillaume Piolat wrote:
The idea is to deliberately mark @system functions that need
special scrutiny to use, regardless of their memory-safety.
Function that would typically be named `assumeXXX`.
```d
class MyEncodedThing
{
Encoding encoding;
On Thursday, 23 March 2023 at 14:17:25 UTC, user1234 wrote:
not exactly thing goal yet. The doc example you have put a link
for is different, the struct with alias this a redefinition of
the "alias this"'ed thing, that just cant work in what you ask
in the first post.
omg, let's rewrite this.
On Thursday, 23 March 2023 at 14:05:07 UTC, Alexander Zhirov
wrote:
On Thursday, 23 March 2023 at 13:38:51 UTC, Alexander Zhirov
wrote:
Is it possible to convert such records inside the structure to
the assigned type?
```d
struct MyVal
{
string value;
// Here it would be possible to us
On Monday, 13 March 2023 at 14:17:57 UTC, jmh530 wrote:
I was looking at [1] for ways to prevent the compiler from
optimizing away code when trying to benchmark.
It has the following C++ code as a simpler version:
```
inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp& value) {
asm volati
On Wednesday, 8 March 2023 at 12:46:53 UTC, Hipreme wrote:
On Wednesday, 8 March 2023 at 10:49:32 UTC, Markus wrote:
Hi, sorry for the broad and vague question. I have read in
some reddit post about benchmarks, that some code didn't use
the final keyword on methods in a sense that final would m
On Friday, 24 February 2023 at 12:00:41 UTC, Elfstone wrote:
Seems like the same bug is still there after ten years.
```d
struct Bar
{
@("hello") int t;
}
static bool hasAttribute(alias F, T)()
{
bool result = false;
On Friday, 17 February 2023 at 17:03:34 UTC, ron77 wrote:
Hello, I succeeded in converting an ELIZA code from C to D, and
here are the results. although I'm sure there are better ways
to code it or to convert it...
[...]
Among the things to do the first is to drop C-style strings, so
that y
On Sunday, 5 February 2023 at 11:52:01 UTC, Alexander Zhirov
wrote:
On Saturday, 4 February 2023 at 15:56:41 UTC, Richard (Rikki)
Andrew Cattermole wrote:
[...]
I don't understand why the compiler doesn't see the library.
```sh
User@WIN-D3SHRBHN7F6 MINGW64 /home/user/pxe-restore/source
# ls -
On Saturday, 17 December 2022 at 02:42:22 UTC, Paul wrote:
I see code like this from time to time. Are the leading
underscores significant, in general, in the D language? Is it
just programmer preference? Is it a coding practice, in
general, that is common...even outside of D? Thanks for any
On Thursday, 20 October 2022 at 16:34:34 UTC, user1234 wrote:
On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote:
Hi,
I've found strange behavior where:
[...]
Shouldn't it at least protest that objects can't be passed to
the function as they aren't copyable?
it's clearly a compile
On Thursday, 20 October 2022 at 14:03:10 UTC, tchaloupka wrote:
Hi,
I've found strange behavior where:
[...]
Shouldn't it at least protest that objects can't be passed to
the function as they aren't copyable?
it's clearly a compiler bug to me. Something is not checked when
the call is verifie
On Saturday, 15 October 2022 at 01:48:15 UTC, kdevel wrote:
Is this consistent?
I think all the compilers should error on expressions like
`Type.nonStaticMethod` and instead there should be a new
__traits dedicated to that, especially because `this` is not a
formal parameter.
On Wednesday, 12 October 2022 at 02:15:55 UTC, Steven
Schveighoffer wrote:
Porting some C code to D
This results in an error:
```d
int x;
while(!(x = 5)) { break; }
```
Error is: assignment cannot be used as a condition, perhaps
`==` was meant?
...
I think D should relax the restriction and
On Monday, 10 October 2022 at 06:30:05 UTC, Arun wrote:
Stumbled upon this question on HN
https://news.ycombinator.com/item?id=33142751#33147401
Can I write template A and then apply it to itself to get
template B and then apply that onto template C to get template
D.
Does anyone have an ex
On Saturday, 8 October 2022 at 23:06:13 UTC, Anonymouse wrote:
I have some nested templated code that takes function pointers.
In many cases I pass it functions of identical signatures,
except some are `@safe` and others are `@system`. In those
cases the templates end up getting instantiated tw
On Friday, 7 October 2022 at 04:40:34 UTC, mw wrote:
Hi,
I have a LDC (1.30.0) built binary on Ubuntu 18.04.5 LTS
x86_64, the program core dumps somewhere, so I want to debug
it. However under gdb, the program fails as soon as I start it:
[...]
Try the non-stop mode maybe :
https://source
On Thursday, 22 September 2022 at 10:53:32 UTC, Salih Dincer
wrote:
Is there a more accurate way to delete the '\0' characters at
the end of the string? I tried functions in this module:
https://dlang.org/phobos/std_string.html
```d
auto foo(string s)
{
string r;
foreach(c; s)
{
if(c
On Friday, 9 September 2022 at 17:35:44 UTC, Dennis wrote:
On Friday, 9 September 2022 at 16:41:54 UTC, Andrey Zherikov
wrote:
What's about new `compileOutput` trait that returns compiler
output?
```d
static assert(__traits(compileOutput, { }) ==
"message");
```
As a compiler dev, that sou
On Tuesday, 16 August 2022 at 08:25:18 UTC, Diego wrote:
Hello everyone,
I'm a Java programmer at work but i'm learning D for pleasure.
I'm reading _The D Programming Language by Ali Çehreli_.
I noticed that DMD creates very huge executable, for example an
empty program:
```
empty.d:
void
On Thursday, 4 August 2022 at 13:18:40 UTC, kdevel wrote:
At DConf '22 day 3 Robert Schadek presented at around 07:22:00
in the YT video the function `splitIds`. Given an HTML page
from bugzilla containing a list of issues `splitIds` aims at
extracting all bug-ids referenced within a specific u
On Thursday, 28 July 2022 at 06:12:49 UTC, Alexander Zhirov wrote:
On Thursday, 28 July 2022 at 06:01:17 UTC, Alexander Zhirov
> x86- 32-bit X86: Pentium-Pro and above
I also tried with `i586` and `pentium` - the result is the same.
Pentium Pro and above means at least i686. i586 is Pentium
On Thursday, 28 July 2022 at 07:16:13 UTC, user1234 wrote:
On Thursday, 28 July 2022 at 06:12:49 UTC, Alexander Zhirov
wrote:
[...]
Pentium Pro and above means at least i686. i586 is Pentium1
which is less featured.
That means that you cant do much, however you can try to tune
the i686 targe
On Tuesday, 12 July 2022 at 19:55:46 UTC, ag0aep6g wrote:
On Tuesday, 12 July 2022 at 19:02:01 UTC, user1234 wrote:
On Tuesday, 12 July 2022 at 16:40:38 UTC, H. S. Teoh wrote:
[...]
Do not rely on this, however;
Absolutely. I'd like to add: especially as default parameter
value that's an ar
On Tuesday, 12 July 2022 at 16:40:38 UTC, H. S. Teoh wrote:
On Tue, Jul 12, 2022 at 04:27:44PM +, Antonio via
Digitalmars-d-learn wrote:
It works
```d
void main()
{
assert(null=="");
}
```
why?
Because an empty string is, by default, represented by an empty
slice of the null pointer.
On Friday, 1 July 2022 at 13:53:28 UTC, Antonio wrote:
On Friday, 1 July 2022 at 13:48:25 UTC, Antonio wrote:
-Why?
I realized Json is an struct (not an object)... and I supose,
it is managing null asignation manually (as a way to build
Json(null)).
-Whats the correct whay to test if some
On Tuesday, 14 June 2022 at 13:39:12 UTC, Andrey Zherikov wrote:
I have [pretty simple code in my
library](https://github.com/andrey-
[Line (2)
produces](https://github.com/andrey-zherikov/argparse/runs/6880350900?check_suite_focus=true#step:5:12) `undefined reference to '_D3std7sumtype__T7SumTy
On Monday, 13 June 2022 at 07:38:54 UTC, user1234 wrote:
On Thursday, 9 June 2022 at 23:50:10 UTC, user1234 wrote:
On Thursday, 9 June 2022 at 21:20:27 UTC, JG wrote:
[...]
No, for now there if there are other ways they are as hacky as
yours.
The compiler usually uses a global counter to g
On Thursday, 9 June 2022 at 23:50:10 UTC, user1234 wrote:
On Thursday, 9 June 2022 at 21:20:27 UTC, JG wrote:
[...]
No, for now there if there are other ways they are as hacky as
yours.
The compiler usually uses a global counter to generate
temporaries.
There's [been attempts] to expose it
On Thursday, 9 June 2022 at 21:20:27 UTC, JG wrote:
Hi,
As an experiment I have implemented the following kind of
pattern matching
(by parsing the part of the string before '=').
```d
struct S {
int x;
int y;
}
struct T {
int w;
S s;
}
void main()
{
mixin(matchAssign(q{auto T(fir
1 - 100 of 264 matches
Mail list logo