Hello all,
I have an older system I am trying to build dmd-2.102.2 on from source:
stock Slackware 14.0 x86_64
binutils 2.22.52.0.2, gcc 4.7.1, glibc 2.15, kernel 3.2.x, and
dmd-2.102.1 installed (which I built from source on this system)
I started with dmd-2.067.1, bootstrapped it with only a
cgenie via Digitalmars-d-learn wrote:
Hello,
I created a short guide on getting started with D:
https://blog.mmksoft.uk/#A%20short%20guide%20on%20getting%20started%20with%20D%20programming
This is because I recently I started to explore the language and, having
read the forum, I see DUB be
DLearner via Digitalmars-d-learn wrote:
Wanted to try out linking two source files independantly compiled.
ExtCallee.d source file:
```
extern(C) void ExtCallee() {
import std.stdio;
writeln("Entered: ", __FUNCTION__);
writeln("Exiting: ", __FUNCTION__);
}
```
ExtMain.d source file:
DLearner via Digitalmars-d-learn wrote:
On Tuesday, 18 April 2023 at 21:31:21 UTC, thinkunix wrote:
[...]
If not calling C code, why use extern(C) for D code?
Wanted to test out options of calling D routine (possibly -betterC) from
both C and (full) D.
OK, thanks.
This is a followup to my original post on March 9 about issues building
dmd-2.102.2 on an old Linux x86_64 system.
See bugzilla:
https://issues.dlang.org/show_bug.cgi?id=23846
The short answer is it is fixed as of dmd-2.104.0-beta.1, that version
now builds dmd and phobos successfully.
matheus via Digitalmars-d-learn wrote:
On Wednesday, 31 May 2023 at 16:24:38 UTC, Cecil Ward wrote:
...
So my question: would I get lynched for the following? (below)
...
I don't know nothing about all this but looking your example code, I
write and I'd prefer to read something like this (Edi
denis via Digitalmars-d-learn wrote:
```
$ zypper install dmd
$ dmd main.d
Error: cannot find source code for runtime library file 'object.d'
dmd might not be correctly installed. Run 'dmd -man' for
installation instructions.
config file: /etc/dmd.conf
I would say the package
denis via Digitalmars-d-learn wrote:
On Monday, 20 November 2023 at 07:50:22 UTC, thinkunix wrote:
denis via Digitalmars-d-learn wrote:
```
$ zypper install dmd
$ dmd main.d
Error: cannot find source code for runtime library file 'object.d'
dmd might not be correctly installed. Run 'dmd
DLearner via Digitalmars-d-learn wrote:
On Monday, 4 December 2023 at 21:55:29 UTC, Mike Shah wrote:
[...]
Is something like this what you had in mind?
```
void main() {
import std.stdio;
mixin template A() {
int I1;
int I2;
char X;
}
struct B {
mixin A;
BoQsc via Digitalmars-d-learn wrote:
This is something I've searched on the forum and couldn't find exact
answer.
TLDR: `r"^."` is matching the very first two character in the `input`
string.
Don't you need two dots to match two characters?
Each dot being the regex to match a single characte
Gavin Gray via Digitalmars-d-learn wrote:
The following code:
ulong charlie = 11;
long johnstone = std.algorithm.comparison.max(0, -charlie);
writeln(format!"johnstone %s"(johnstone));
Results in (without any warning(s)):
johnstone -11
However you choose to look at it, this means -11
Kevin Bailey via Digitalmars-d-learn wrote:
How many times does the following loop print? I ran into this twice
doing the AoC exercises. It would be nice if it Just Worked.
```
import std.stdio;
int main()
{
char[] something = ['a', 'b', 'c'];
for (auto i = -1; i < something.length; ++i)
Kevin Bailey via Digitalmars-d-learn wrote:
On Thursday, 8 February 2024 at 08:23:12 UTC, thinkunix wrote:
I would never write code like this.
By all means, please share with us how you would have written that just
as elegantly but "correct".
First off I, I am just a beginner with D. I jo
Per Nordlöw via Digitalmars-d-learn 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 - 'a';
case 'A': .. case 'F':
ret
Jonathan M Davis via Digitalmars-d-learn wrote:
Well, I don't think that auto is a particularly controversial topic among D
programmers...
Thank you Jonathan for that very detailed response.
This thread can end now unless others really feel the need to comment.
I got two outstanding responses
H. S. Teoh via Digitalmars-d-learn wrote:
In idiomatic D, you'd use `auto` when either (1) you don't care what the
type is, you just want whatever value you get to be shoved into a
variable, or (2) you *shouldn't* care what the type is, because your
code shouldn't be depending on it, e.g., when y
monkyyy via Digitalmars-d-learn wrote:
On Friday, 27 September 2024 at 04:23:32 UTC, thinkunix wrote:
What about using 'auto' as the return type?
I tried it and it seemed to work OK.
Wondering if there are any good reasons to use auto,
or bad reasons why not to use auto here?
You have starte
17 matches
Mail list logo