On Wednesday, 5 June 2024 at 06:22:34 UTC, Eric P626 wrote:
I tried the following signatures with the ref keyword and it
did not change anything:
~~~
void print_maze ( ref s_cell maze )
void print_maze ( ref s_cell [][] maze )
~~~
From what I found, arrays passed in parameters are always
pa
On Friday, 31 May 2024 at 16:07:23 UTC, Andy Valencia wrote:
I'm coding a server which takes TCP connections. I end up in
the main thread with .accept() which hands me a Socket. I'd
like to hand this off to a spawn()'ed thread to do the actual
work.
Aliases to mutable thread-local data
On Tuesday, 28 May 2024 at 23:18:46 UTC, Steven Schveighoffer
wrote:
On Tuesday, 28 May 2024 at 18:41:02 UTC, bauss wrote:
On Tuesday, 28 May 2024 at 18:29:17 UTC, Ferhat Kurtulmuş
wrote:
On Tuesday, 28 May 2024 at 17:37:42 UTC, bauss wrote:
I have two questions that I can't seem to find a solu
On Tuesday, 28 May 2024 at 18:29:17 UTC, Ferhat Kurtulmuş wrote:
On Tuesday, 28 May 2024 at 17:37:42 UTC, bauss wrote:
I have two questions that I can't seem to find a solution to
after looking at std.datetime.
First question is how do I get the current time but in
milliseconds?
Second is h
I have two questions that I can't seem to find a solution to
after looking at std.datetime.
First question is how do I get the current time but in
milliseconds?
Second is how do I construct a time ex. systime or datetime based
on milliseconds?
Thanks
On Tuesday, 28 May 2024 at 12:45:39 UTC, Steven Schveighoffer
wrote:
On Tuesday, 28 May 2024 at 12:35:42 UTC, bauss wrote:
Running into a couple of problems trying to hide the console
that opens when running an app that uses sdl2.
First of all I am trying to compile with this using dub:
```
"
On Tuesday, 30 May 2023 at 15:43:12 UTC, Steven Schveighoffer
wrote:
On 5/30/23 4:46 AM, John Xu wrote:
How to put above enum as a function parameter? Following code
wouldn't work:
string getTMember(T t, enum string memberName) {
return __traits(getMember, t, memberName);
}
On Tuesday, 30 May 2023 at 15:24:21 UTC, bauss wrote:
On Tuesday, 30 May 2023 at 08:46:43 UTC, John Xu wrote:
How to put above enum as a function parameter? Following code
wouldn't work:
string getTMember(T t, enum string memberName) {
return __traits(getMember, t, memberName);
On Tuesday, 30 May 2023 at 08:46:43 UTC, John Xu wrote:
How to put above enum as a function parameter? Following code
wouldn't work:
string getTMember(T t, enum string memberName) {
return __traits(getMember, t, memberName);
}
...
As simple as this:
```
string getTMember(T
On Thursday, 16 March 2023 at 12:32:34 UTC, Nick Treleaven wrote:
With -preview=nosharedaccess, I get:
int y = 2;
shared int x = y; // OK
assert(x == 2); // no error
y = x; // error
So for the assignment to y, reading x is an error and
atomicLoad should be used instead. But is
On Monday, 16 January 2023 at 08:17:24 UTC, Ali Çehreli wrote:
On 1/13/23 18:51, bauss wrote:
That's a good one!
It looks like you liked it four years ago as well. :) I found
where I remembered it from:
https://forum.dlang.org/post/pvdoq2$1e7t$3...@digitalmars.com
Ali
Looks like my me
On Friday, 13 January 2023 at 16:54:34 UTC, Ali Çehreli wrote:
On 1/13/23 00:48, bauss wrote:
> 1. Change your mixin template to something like this:
There was a technique as a workaround for this template mixin
limitation but I can't find it right now.
> 2. Change the place where you instan
On Thursday, 12 January 2023 at 08:03:34 UTC, John Chapman wrote:
I'm obviously doing something wrong, but don't quite understand.
```d
mixin template helper() {
mixin("writeln(12);");
}
struct Foo {
void opDispatch(string name)() {
import std.stdio;
mixin helper!();
//mixin("wr
On Tuesday, 10 January 2023 at 12:55:34 UTC, Adam D Ruppe wrote:
On Sunday, 8 January 2023 at 18:42:58 UTC, Salih Dincer wrote:
I'm wondering 2 things; firstly, does having an enum mean
there is no auto-return? Or could it be CTFE?
It means nothing. The keyword tells the parser a function is
On Monday, 9 January 2023 at 00:19:39 UTC, thebluepandabear wrote:
Fixing this will improve the quality of the language for
newcomers such as myself greatly.
This not only confuses newcomers but it gave a false illusion
of a bug within the code :/
It doesn't confuse newcomers only, also peop
On Wednesday, 4 January 2023 at 03:42:28 UTC, thebluepandabear
wrote:
...
My question is: is there a way to enforce UFCS-syntax?
None of your code actually uses UFCS.
This is UFCS:
```
class Foo {
int bar;
}
void setBar(Foo foo, int value) {
foo.bar = value;
}
void main() {
foo.setBa
On Monday, 5 December 2022 at 06:12:44 UTC, rempas wrote:
On Sunday, 4 December 2022 at 16:40:17 UTC, ag0aep6g wrote:
Not quite. Adding 10 to a T* means adding 10 * T.sizeof.
Oh! I thought it was addition. Is there a specific reasoning
for that if you are aware of?
Because it's much easier
On Thursday, 1 December 2022 at 15:35:37 UTC, Steven
Schveighoffer wrote:
On 12/1/22 3:24 AM, bauss wrote:
But probably not on every frame, have a delay between checks.
It's not anything controllable by the user. The library does
the check every frame regardless of whether you use it or not
On Thursday, 1 December 2022 at 02:06:43 UTC, Steven
Schveighoffer wrote:
On 11/30/22 8:49 PM, jwatson-CO-edu wrote:
Yes, following your instructions I have raylib 4.2.0 and
raylib-d 4.2.4 in the project directory. I am now using the
latest version of raylib-d, but this did not resolve the
On Tuesday, 15 November 2022 at 11:42:59 UTC, Alexander Zhirov
wrote:
Is there any way to get the name of class B?
```d
interface A {
string text();
}
class B : A {
override string text() {
return ": It's ok!";
}
}
void main() {
A[] a = cast(A[]) new B[3];
B b = new
On Sunday, 6 November 2022 at 03:59:55 UTC, ryuukk_ wrote:
Manually editing / moving files is not recommended for Visual
Studio installs
The manual editing was not for visual studio but for dmd to set a
different linker.
On Saturday, 5 November 2022 at 22:53:33 UTC, Hipreme wrote:
On Saturday, 5 November 2022 at 19:19:09 UTC, bauss wrote:
On Saturday, 5 November 2022 at 14:54:52 UTC, Hipreme wrote:
[...]
I have both VS 2019 and 2022, but only 2019 has c++ build
tools etc. I assume that should be fine?
[...
On Saturday, 5 November 2022 at 19:24:54 UTC, Imperatorn wrote:
On Saturday, 5 November 2022 at 13:30:43 UTC, bauss wrote:
Fresh install of DMD and when trying to use ex. std.file from
Phobos I get the following linking error: (I can trigger
different ones depending on modules imported etc.)
On Saturday, 5 November 2022 at 14:54:52 UTC, Hipreme wrote:
On Saturday, 5 November 2022 at 14:14:16 UTC, bauss wrote:
On Saturday, 5 November 2022 at 13:42:08 UTC, rikki cattermole
wrote:
Try ldc, if that works then its just a missing library that
needs to be linked against regarding MS CRT.
On Saturday, 5 November 2022 at 13:42:08 UTC, rikki cattermole
wrote:
Try ldc, if that works then its just a missing library that
needs to be linked against regarding MS CRT.
Using LDC doesn't seem to work either, it has similar linking
problems.
```
lld-link: error: undefined symbol: fileno
On Saturday, 5 November 2022 at 13:42:08 UTC, rikki cattermole
wrote:
Try ldc, if that works then its just a missing library that
needs to be linked against regarding MS CRT.
I will give it a try
On Saturday, 5 November 2022 at 13:30:43 UTC, bauss wrote:
```
lld-link: error: undefined symbol: tzset
```
I don't know if this is relevant, so I will just put it here just
in case:
```
lld-link: error: undefined symbol: tzset
referenced by
phobos64.lib(timezone_151f_37a.obj):(_D3std8dat
Fresh install of DMD and when trying to use ex. std.file from
Phobos I get the following linking error: (I can trigger
different ones depending on modules imported etc.)
```
lld-link: error: undefined symbol: tzset
```
I assume it has something to do with the C runtime or something,
but every
On Friday, 4 November 2022 at 10:57:12 UTC, Hipreme wrote:
...
I disagree completely with being against package.d.
Having used D for like a decade at this point, I've never
experienced any issues with it.
Most issues seems to be for newcomers and people who aren't
entirely familiar with ho
On Saturday, 22 October 2022 at 07:40:39 UTC, MGW wrote:
is dmd a virus?
https://www.virustotal.com report:
Cybereason --> Malicious.779f29
VBA32 --> BScope.Trojan.DShell
Yeah it's a virus. I would stay far away from it...
On Friday, 14 October 2022 at 09:00:11 UTC, Patrick Schluter
wrote:
On Thursday, 13 October 2022 at 19:27:22 UTC, Steven
Schveighoffer wrote:
On 10/13/22 3:00 PM, Sergey wrote:
[...]
It doesn't look really that far off. You can't expect floating
point parsing to be exact, as floating point d
On Thursday, 13 October 2022 at 08:48:49 UTC, rikki cattermole
wrote:
On 13/10/2022 9:42 PM, bauss wrote:
Oh and to add onto this, IFF you have to do it the hacky way,
then converting to uppercase instead of lowercase should be
preferred, because not all lowercase characters can perform
round
On Thursday, 13 October 2022 at 08:35:50 UTC, bauss wrote:
On Thursday, 13 October 2022 at 08:30:04 UTC, rikki cattermole
wrote:
On 13/10/2022 9:27 PM, bauss wrote:
This doesn't actually work properly in all languages. It will
probably work in most, but it's not entirely correct.
Ex. Turkish
On Thursday, 13 October 2022 at 08:30:04 UTC, rikki cattermole
wrote:
On 13/10/2022 9:27 PM, bauss wrote:
This doesn't actually work properly in all languages. It will
probably work in most, but it's not entirely correct.
Ex. Turkish will not work with it properly.
Very interesting article:
On Wednesday, 5 October 2022 at 17:29:25 UTC, Steven
Schveighoffer wrote:
On 10/5/22 12:59 PM, torhu wrote:
I need a case-insensitive check to see if a string contains
another string for a "quick filter" feature. It should
preferrably be perceived as instant by the user, and needs to
check a f
On Friday, 7 October 2022 at 04:40:26 UTC, matheus wrote:
Hmm well I was thinking the min/max as a range/limits, in this
case 0 to 255 or it could be -128 to 127 if signed
char casts implicitly to int, so if you really need it as an
integer type just type your variable as such.
```d
int a
On Sunday, 28 August 2022 at 22:46:17 UTC, Gavin Ray wrote:
I've put the code, stripped to a minimal example here:
- https://ldc.godbolt.org/z/fzsx3Tnnn
You can see that the single write + read version of the code
works just fine:
```
pageData[0..4] = [1, 2, 3, 4]
readData[0..4] = [1, 2, 3, 4]
On Wednesday, 24 August 2022 at 21:11:42 UTC, rikki cattermole
wrote:
For dmd you use build.d that is in the repository.
For phobos win64.mak (used for 32bit by default as well):
"# Makefile to build D runtime library phobos{64,32mscoff}.lib
for Windows MSVC"
So MSVC make.
Beyond that idk,
On Friday, 19 August 2022 at 13:47:41 UTC, Paul Backus wrote:
On Friday, 19 August 2022 at 10:22:25 UTC, bauss wrote:
Is there a reason why .stringof is implementation defined and
not clearly defined in the spec how types and declarations
should be treated when being "converted to a string"?
On Friday, 19 August 2022 at 06:34:19 UTC, Patrick Schluter wrote:
On Thursday, 18 August 2022 at 17:15:12 UTC, rikki cattermole
wrote:
On 19/08/2022 4:56 AM, IGotD- wrote:
BetterC means no arrays or strings library and usually in
terminal tools you need to process text. Full D is wonderful
f
On Thursday, 18 August 2022 at 22:00:06 UTC, Paul Backus wrote:
On Wednesday, 17 August 2022 at 11:38:31 UTC, Steven
Schveighoffer wrote:
On 8/17/22 6:38 AM, Dennis wrote:
On Wednesday, 17 August 2022 at 08:44:30 UTC, Ogi wrote:
Maybe I’m missing something?
I had the same problem, and came u
On Monday, 8 August 2022 at 13:55:02 UTC, ag0aep6g wrote:
auto x = s.x;
```
Your problem is here and not because it was __gshared.
You're copying the value and obviously it can be changed in the
meantime, that's common sense.
You shouldn't use it like that. You should access s.x di
On Monday, 8 August 2022 at 12:02:02 UTC, Dom Disc wrote:
```D
pure @nogc @safe BigInt opAssign(T : BigInt)(T x);
```
This will only be included in the object file if used.
What is the difference to declaring it like:
```D
pure @nogc @safe BigInt opAssign(BigInt x);
```
This will always
On Monday, 8 August 2022 at 10:17:57 UTC, ag0aep6g wrote:
Never ever use `__gshared` ever.
I don't agree with this entirely, it just depends on how you use
it. In general you should go with shared, but __gshared does have
its places. It's only problematic when it can be changed from
multipl
On Monday, 8 August 2022 at 07:37:16 UTC, rempas wrote:
Thank you for all the great info! Unfortunately, while there is
no problem in this example, this will
not do for my real code as I need to have the argument in the
constructor. Alternative, I have to
change the design of the program comp
On Monday, 8 August 2022 at 00:11:33 UTC, pascal111 wrote:
I don't have specific code but it was a general notice. Take
Python as in example, the same program in Python doesn't cost
much code as D code, and of course by putting in accounts that
that I assume that there are some special tasks
On Monday, 8 August 2022 at 05:38:31 UTC, rempas wrote:
In the following struct (as an example, not real code):
```
struct TestArray(ulong element_n) {
int[element_n] elements;
this(string type)(ulong number) {
pragma(msg, "The type is: " ~ typeof(type).stringof);
}
}
```
I want to c
On Tuesday, 12 July 2022 at 10:32:36 UTC, ryuukk_ wrote:
How do i achieve fast compile speed (results above were on
windows, on linux i get much faster results):
I maintain healthy project management:
This
- Imports of std: i simply don't, and i copy/paste functions i
need
- I avoid du
On Tuesday, 12 July 2022 at 07:06:37 UTC, Siarhei Siamashka wrote:
```
real0m34.371s
user0m32.883s
sys 0m1.488s
```
```
real0m14.078s
user0m12.941s
sys 0m1.129s
```
Is there an open source DUB package, which can be used to
reproduce a huge build time difference betwe
On Tuesday, 28 June 2022 at 21:58:48 UTC, Ola Fosheim Grøstad
wrote:
not-scoped variable (`a.next` is not `scope` since this
attribute is not transitive)
Well, that is a flaw, if the object is stack allocated then the
fields are too.
Not necessarily, especially if the fields aren't value
On Thursday, 23 June 2022 at 15:20:02 UTC, Jesse Phillips wrote:
On Wednesday, 22 June 2022 at 01:09:22 UTC, Steven
Schveighoffer wrote:
There are 3 situations:
1. field in json and struct. Obvious result.
2. field in json but not in struct.
3. field in struct but not in json.
I do a lot of
On Monday, 20 June 2022 at 13:56:04 UTC, Ruby The Roobster wrote:
Is there any way to define variables in an outer scope from an
inner scope? I was thinking
```d
void main()
{
int .y = 3;
}
```
would work, but it doesn't.
No and it would only lead to bugs.
If you have access to an inner
On Friday, 17 June 2022 at 13:04:47 UTC, Chris Katko wrote:
On Friday, 17 June 2022 at 12:19:33 UTC, bauss wrote:
On Friday, 17 June 2022 at 12:09:33 UTC, Chris Katko wrote:
I don't need this functionality, but I wanted to be sure.
Does function overloading not work with nested functions? I
g
On Friday, 17 June 2022 at 12:48:56 UTC, harakim wrote:
On Friday, 17 June 2022 at 12:31:45 UTC, harakim wrote:
I can generically convert a string to a type using to!type. I
have a read function that does that. I have simplified the
example below:
```d
int readNumber()
{
On Friday, 17 June 2022 at 12:09:33 UTC, Chris Katko wrote:
I don't need this functionality, but I wanted to be sure.
Does function overloading not work with nested functions? I got
a compiler error (something like "function already defined")
when I tried it.
According to the spec then neste
On Friday, 17 June 2022 at 05:17:20 UTC, Tejas wrote:
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
On Thursday, 16 June 2022 at 11:38:40 UTC, kdevel wrote:
On Thursday, 16 June 2022 at 11:28:32 UTC, bauss wrote:
[...]
https://dlang.org/spec/statement.html#scope-guard-statement
Quote (again): "A [...] scope(success) statement may not exit
with a throw [...]."
[...]
If the spec forbids it, b
On Thursday, 16 June 2022 at 10:07:23 UTC, kdevel wrote:
On Wednesday, 15 June 2022 at 20:46:56 UTC, Steven
Schveighoffer wrote:
[...]
It has not harmed my code though. I tried throwing inside a
scope guard, and it just works, I'm not sure why you can't
throw in those?
You can but that i
On Tuesday, 14 June 2022 at 08:26:53 UTC, Anonymouse wrote:
What is the correct way of making this output `0 1 2`?
```d
void delegate()[] dgs;
foreach (immutable i; 0..3)
{
dgs ~= () => writeln(i);
}
foreach (dg; dgs)
{
dg(); // outputs: `2 2 2`
}
```
You have to do it like this:
`
On Thursday, 9 June 2022 at 23:50:10 UTC, user1234 wrote:
There's [been attempts] to expose it, exactly so that users can
generate unique names, but that did not found its path in the
compiler.
[been attempts]: https://github.com/dlang/dmd/pull/10131
You can generate unique names actually
On Friday, 3 June 2022 at 12:52:30 UTC, Adam D Ruppe wrote:
On Friday, 3 June 2022 at 12:49:07 UTC, bauss wrote:
I believe it's only true in unicode for utf-32 since all
characters do fit in the 4 byte space they have
Depends how you define "character".
I guess that's true as well, unicode r
On Thursday, 2 June 2022 at 20:12:30 UTC, Steven Schveighoffer
wrote:
This statement suggests to me that you have an incorrect
perception of a string. A string is a pointer paired with a
length of how many characters after that pointer are valid.
That's it. `str.ptr` is the pointer to the fir
On Thursday, 2 June 2022 at 08:27:32 UTC, Antonio wrote:
JSON properties can be
- a value
- null
- absent
What's the standard way to define a serialziable/deserializable
structs supporting properties of any of this 4 kinds?:
* int
* int | null
* int | absent
* int | null | absent
Whats the
On Tuesday, 31 May 2022 at 09:11:41 UTC, JG wrote:
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
erro
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" paramet
On Sunday, 29 May 2022 at 01:35:23 UTC, frame wrote:
Is there a compiler switch to catch this kind of error?
```d
ulong v = 1;
writeln(v > -1);
```
IMHO the compiler should bail a warning if it sees a logic
comparison between signed and unsigned / different integer
sizes. There is 50% chance
On Monday, 23 May 2022 at 12:20:11 UTC, JG wrote:
On Monday, 23 May 2022 at 11:39:22 UTC, Adam D Ruppe wrote:
On Monday, 23 May 2022 at 09:38:07 UTC, JG wrote:
Hi,
Is there any more standard way to achieve something to the
effect of:
```d
import std.experimental.allocator;
string* name
On Monday, 23 May 2022 at 12:17:56 UTC, bauss wrote:
On Monday, 23 May 2022 at 11:39:22 UTC, Adam D Ruppe wrote:
On Monday, 23 May 2022 at 09:38:07 UTC, JG wrote:
Hi,
Is there any more standard way to achieve something to the
effect of:
```d
import std.experimental.allocator;
string* na
On Monday, 23 May 2022 at 11:39:22 UTC, Adam D Ruppe wrote:
On Monday, 23 May 2022 at 09:38:07 UTC, JG wrote:
Hi,
Is there any more standard way to achieve something to the
effect of:
```d
import std.experimental.allocator;
string* name = theAllocator.make!string;
```
Why do you want
On Friday, 20 May 2022 at 01:41:59 UTC, Ali Çehreli wrote:
On 5/19/22 16:44, Vijay Nayar wrote:
> If I remove the call from `static this()`, then the web call
works as
> normal. Any idea why calling vibe.d's `requestHTTP` function
inside of a
> module's static construction would cause an infinit
On Thursday, 19 May 2022 at 10:18:38 UTC, user1234 wrote:
On Thursday, 19 May 2022 at 10:15:32 UTC, Chris Katko wrote:
given
```D
struct COLOR
{
float r, g, b, a; // a is alpha (opposite of transparency)
}
auto red = COLOR(1,0,0,1);
auto green = COLOR(0,1,0,1);
auto blue = COLOR(0,0,1,1);
au
On Wednesday, 18 May 2022 at 19:58:09 UTC, Ali Çehreli wrote:
Hmm. Perhaps the guideline should be "all destructors must be
@nogc".
Ali
It should probably just default to that and with no exception,
since you will never end up in a situation where you don't want
@nogc for a destructor.
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 wh
On Wednesday, 18 May 2022 at 15:33:09 UTC, Steven Schveighoffer
wrote:
On 5/18/22 2:13 AM, bauss wrote:
On Wednesday, 18 May 2022 at 02:12:42 UTC, zoujiaqing wrote:
https://dlang.org/changelog/2.100.0.html#deprecation_delete
My code:
```D
import std.stdio;
class HttpClient
{
string get(s
On Wednesday, 18 May 2022 at 02:12:42 UTC, zoujiaqing wrote:
https://dlang.org/changelog/2.100.0.html#deprecation_delete
My code:
```D
import std.stdio;
class HttpClient
{
string get(string url)
{
return "";
}
string delete(string url)
{
On Tuesday, 17 May 2022 at 11:53:40 UTC, zjh wrote:
On Tuesday, 17 May 2022 at 11:50:30 UTC, zjh wrote:
Right,GC is a bad idea!
Endless use of memory without freeing.
It's totally unreasonable waste.
It's not really endless use of memory and it does free. Depending
on the strategy then it
On Tuesday, 17 May 2022 at 00:10:55 UTC, Alain De Vos wrote:
Let's say a shape is ,a circle with a radius ,or a square with
a rectangular size.
I want to pass shapes to functions, eg to draw them on the
screen,
draw(myshape) or myshape.draw();
But how do i implement best shapes ?
In addition
On Monday, 16 May 2022 at 09:46:57 UTC, IGotD- wrote:
On Sunday, 15 May 2022 at 13:26:30 UTC, vit wrote:
Hello, I want read decimal type from sql db, do some
arithmetic operations inside D program and write it back to
DB. Result need to be close to result as if this operations
was performed in
On Sunday, 15 May 2022 at 15:59:17 UTC, Alain De Vos wrote:
Can i summarize ,
structs are value-objects which live on the stack.
class instances are reference objects which live on the heap.
But that's not entirely true as you can allocate a struct on the
heap as well.
The real difference is
On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
What are you stuck at? What was the most difficult features to
understand? etc.
To make it more meaningful, what is your experience with other
languages?
Ali
dip1000
On Tuesday, 3 May 2022 at 07:11:48 UTC, Ola Fosheim Grøstad wrote:
As you see, someone will have to write a DIP to fix this bug,
as the language authors don't consider it a bug, but an
enhancement.
I don't believe those two words are mutually exclusive.
It can be a bug __and__ an enhancem
On Tuesday, 3 May 2022 at 09:52:56 UTC, cc wrote:
On Tuesday, 3 May 2022 at 09:42:45 UTC, cc wrote:
Given a runtime typeid, how can I get the equivalent
fullyQualifiedName without attempting to mangle the string
myself manually? e.g. something I can pass to
`Object.factory`.
Actually, looki
On Thursday, 28 April 2022 at 12:36:56 UTC, Dennis wrote:
On Thursday, 28 April 2022 at 12:10:44 UTC, bauss wrote:
On Wednesday, 27 April 2022 at 15:40:49 UTC, Adam D Ruppe
wrote:
but this got killed due to internal D politics. A pity.
A tale as old as time itself
In this case, it was actua
On Wednesday, 27 April 2022 at 15:40:49 UTC, Adam D Ruppe wrote:
but this got killed due to internal D politics. A pity.
A tale as old as time itself
On Monday, 25 April 2022 at 07:18:44 UTC, bauss wrote:
On Monday, 25 April 2022 at 00:18:03 UTC, Vinod K Chandran
wrote:
Hi all,
Please take a look at this code. Is this the right way to use
private constructors ?
```d
class Foo {
int p1 ;
string p2 ;
bool p3 ;
private this(in
On Monday, 25 April 2022 at 00:18:03 UTC, Vinod K Chandran wrote:
Hi all,
Please take a look at this code. Is this the right way to use
private constructors ?
```d
class Foo {
int p1 ;
string p2 ;
bool p3 ;
private this(int a, string b, bool c) {
this.p1 = a
thi
On Thursday, 21 April 2022 at 05:49:12 UTC, Alain De Vos wrote:
Following program:
```
import std.stdio;
void main() @trusted
{
int *p=null;
void myfun(){
int x=2;
p=&x;
writeln(p);
writeln(x);
}
myfun();
*p=16;
writeln(p);
writeln(*p);
}
```
outputs :
7FFFD
On Saturday, 16 April 2022 at 20:48:15 UTC, Adam Ruppe wrote:
On Saturday, 16 April 2022 at 20:41:25 UTC, WhatMeWorry wrote:
Is virtual memory entering into the equation?
Probably. Memory allocated doesn't physically exist until
written to a lot of the time.
You can also exceed your RAM in
On Tuesday, 19 April 2022 at 09:37:49 UTC, Mike Parker wrote:
On Tuesday, 19 April 2022 at 08:58:02 UTC, bauss wrote:
On Monday, 18 April 2022 at 13:41:04 UTC, Mike Parker wrote:
On Monday, 18 April 2022 at 05:27:32 UTC, Danny Arends wrote:
Any ideas how to get into contact/fix this issue ?
On Monday, 18 April 2022 at 13:41:04 UTC, Mike Parker wrote:
On Monday, 18 April 2022 at 05:27:32 UTC, Danny Arends wrote:
Any ideas how to get into contact/fix this issue ?
I've emailed Sönke and pointed him to this thread.
Wouldn't the appropriate thing to do be dub being officially a
pa
On Tuesday, 19 April 2022 at 06:05:27 UTC, Ali Çehreli wrote:
int i = 42;
file.rawWrite(*cast((int[1]*)(&i))); // Casted to be an
array of 1
I assume since we don't have a rawWriteValue, that it's rarely
needed.
However it should be fairly trivial like:
void rawWriteValue(T)(T valu
On Friday, 18 March 2022 at 03:24:10 UTC, Era Scarecrow wrote:
On Tuesday, 8 March 2022 at 22:28:27 UTC, bauss wrote:
What D just needs is a way to specify the entry point, in
which it just defaults to the first main function found, but
could be any function given.
Which is similar to what J
On Monday, 14 March 2022 at 09:40:00 UTC, zhad3 wrote:
Hey everyone, I am in need of some help. I have written this
Windows CP949 encoding table
https://github.com/zhad3/zencoding/blob/main/windows949/source/zencoding/windows949/table.d which is used to convert CP949 to UTF-16.
After some rese
On Friday, 11 March 2022 at 11:55:24 UTC, Andrey Zherikov wrote:
On Friday, 11 March 2022 at 07:06:15 UTC, bauss wrote:
Create an alias for T!() is the best you can do.
Ex.
```
alias t = T!();
```
There isn't really any better method as far as I know.
I'd like to preserve the name (`t` != `
On Friday, 11 March 2022 at 04:41:40 UTC, Andrey Zherikov wrote:
I have simple template:
```d
template T(int i=3)
{
mixin template M(int m)
{
enum t = i;
}
}
{
mixin T!1.M!1;
pragma(msg, t); // 1
}
{
mixin T!().M!1;
pragma(msg, t); // 3
On Tuesday, 8 March 2022 at 20:12:40 UTC, BoQsc wrote:
I think D Language needs and lacks conditional compilation
condition and attribute of "exclude". The exclude keyword or
code block in the exclude, would be made sure to not be
imported by any means. Now it seems all to be only workarounds.
On Tuesday, 1 March 2022 at 08:16:13 UTC, Mike Parker wrote:
On Tuesday, 1 March 2022 at 07:16:11 UTC, bauss wrote:
Right now if you want to add an additional cast then you have
to implement ALL the default behaviors and then add your
custom cast.
It's two template functions like the OP used
On Tuesday, 1 March 2022 at 04:59:49 UTC, Mike Parker wrote:
It makes sense to me, and I would say the bug is that it's not
documented.
Personally it doesn't make sense to me. I don't think it should
override default behaviors, but just add onto it, so you can add
an additional cast.
Ri
On Tuesday, 22 February 2022 at 12:48:21 UTC, frame wrote:
What am I missing here? Is this some UTF conversion issue?
```d
string a;
char[] b;
pragma(msg, typeof(a.take(1).front)); // dchar
pragma(msg, typeof(b.take(1).front)); // dchar
```
Welcome to the world of auto decoding, D's million d
On Monday, 21 February 2022 at 15:13:52 UTC, Kagamin wrote:
On Monday, 21 February 2022 at 09:04:06 UTC, bauss wrote:
Why are we even escaping them by default, it should be the
other way around, that slashes are only escaped if you ask for
it; that's how it literally is in almost every JSON lib
1 - 100 of 549 matches
Mail list logo