Re: Windows printing

2021-10-12 Thread frame via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 17:36:06 UTC, Imperatorn wrote: On Thursday, 7 October 2021 at 01:55:15 UTC, frame wrote: Is there some Windows expert or someone you can tell me if I do things wrong? [...] https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printerconfiguration

Re: tkd does not build anymore after 2.096

2021-10-12 Thread rikki cattermole via Digitalmars-d-learn
The repo itself hasn't been archived as of this writing. So a PR may succeed. But yeah the guy is gone by the looks. If he is willing this could be a possible candidate for moving it to dlang-community although it'll need someone to shepherd it. https://github.com/nomad-software/tkd

Re: tkd does not build anymore after 2.096

2021-10-12 Thread russhy via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 18:18:45 UTC, tastyminerals wrote: On Tuesday, 12 October 2021 at 17:35:53 UTC, russhy wrote: Recent version for nullable removed implicit conversion, you must call .get now.. wich is a pain to update i suggest using a previous version of ``struct Nullable`` ht

Re: problem with alias this and Tuple

2021-10-12 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 15:55:40 UTC, Johann Lermer wrote: Thanks, understood. But isn't this a deficiency in the library that should be fixed? The problem extends to more than just `toHash`. Take a look at this DConf 2019 presentation by Eduard Staniloiu on ProtoObject (as proposed by

Re: How to test if a string is pointing into read-only memory?

2021-10-12 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 21:42:45 UTC, IGotD- wrote: On Tuesday, 12 October 2021 at 09:20:42 UTC, Elronnd wrote: There is no good way. Can't it be done using function overloading? Function overloading lets you distinguish between arguments with different types, but strings in read-on

Re: How to test if a string is pointing into read-only memory?

2021-10-12 Thread IGotD- via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 09:20:42 UTC, Elronnd wrote: There is no good way. Can't it be done using function overloading?

Re: How to test if a string is pointing into read-only memory?

2021-10-12 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 08:19:01 UTC, jfondren wrote: and string literals weren't reliably in read-only memory as recently as early 2017: https://github.com/dlang/dmd/pull/6546#issuecomment-280612721 Sometimes sections have defined symbols for start and end, you can check if the string

Re: tkd does not build anymore after 2.096

2021-10-12 Thread tastyminerals via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 17:35:53 UTC, russhy wrote: Recent version for nullable removed implicit conversion, you must call .get now.. wich is a pain to update i suggest using a previous version of ``struct Nullable`` https://github.com/dlang/phobos/blob/v2.096.1/std/typecons.d create

Re: Windows printing

2021-10-12 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 7 October 2021 at 01:55:15 UTC, frame wrote: Is there some Windows expert or someone you can tell me if I do things wrong? [...] https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printerconfiguration

Re: tkd does not build anymore after 2.096

2021-10-12 Thread russhy via Digitalmars-d-learn
Recent version for nullable removed implicit conversion, you must call .get now.. wich is a pain to update i suggest using a previous version of ``struct Nullable`` https://github.com/dlang/phobos/blob/v2.096.1/std/typecons.d create a nullable.d file in tkd project, and replace the imports

Re: problem with alias this and Tuple

2021-10-12 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 15:55:40 UTC, Johann Lermer wrote: Thanks, understood. But isn't this a deficiency in the library that should be fixed? You mean the part about how `Object.toHash` doesn't work with `const`? Yes, it is a deficiency in the library. The problem is, it cannot be fi

Re: problem with alias this and Tuple

2021-10-12 Thread Johann Lermer via Digitalmars-d-learn
Thanks, understood. But isn't this a deficiency in the library that should be fixed?

tkd does not build anymore after 2.096

2021-10-12 Thread tastyminerals via Digitalmars-d-learn
There have been numerous deprecation warnings for nice **tkd** library: https://github.com/nomad-software/tkd and with the current ldc 1.27.1 it fails to build. ``` x11 1.0.21: building configuration "tcltk-import"... tcltk 8.6.5: building configuration "library"... tkd 1.1.13: building configu

Re: problem with alias this and Tuple

2021-10-12 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 09:30:57 UTC, Johann Lermer wrote: Hi all, I have a problem with Tuples and struct templates that contain an alias this: ```d import std; struct Element(T) { T payload; alias payload this; this (T p) { payload = p

Re: How to test if a string is pointing into read-only memory?

2021-10-12 Thread ag0aep6g via Digitalmars-d-learn
On 12.10.21 10:19, jfondren wrote: ```d /+ Unfortunately, this isn't reliable.  We could make this work if string literals are put  in read-only memory and we test if s[] is pointing into  that.  /* Peek past end of s[], if it's 0, no conversion necessary.  * Note that the compiler will put

Re: Linker error

2021-10-12 Thread bauss via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 00:01:25 UTC, jfondren wrote: On Monday, 11 October 2021 at 23:43:17 UTC, Ruby The Roobster wrote: package mixin template move__() { pragma(inline) package void mv(Point moveby, ref Skeleton tomove) { foreach(i;tomove.faces) {

problem with alias this and Tuple

2021-10-12 Thread Johann Lermer via Digitalmars-d-learn
Hi all, I have a problem with Tuples and struct templates that contain an alias this: ```d import std; struct Element(T) { T payload; alias payload this; this (T p) { payload = p; } } class Item {} void main () { auto e = Eleme

Re: How to test if a string is pointing into read-only memory?

2021-10-12 Thread Elronnd via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 09:20:42 UTC, Elronnd wrote: problematic wrt threading Not to mention signals. Reentrancy's a bitch.

Re: How to test if a string is pointing into read-only memory?

2021-10-12 Thread Elronnd via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 08:19:01 UTC, jfondren wrote: What's a reliable test that could be used in a toStringz that skips allocation when given a string in read-only memory? There is no good way. - You could peek in /proc, but that's not portable - You could poke the data and catch the

Re: Managing malloced memory

2021-10-12 Thread anon via Digitalmars-d-learn
On Wednesday, 6 October 2021 at 18:29:34 UTC, Steven Schveighoffer wrote: ```d struct GCWrapped(T) { private T *_val; this(T* val) { _val = val; } ref T get() { return *_val; } alias get this; // automatically unwrap ~this() { free(_val); _val = null; } @disable this(this); // d

How to test if a string is pointing into read-only memory?

2021-10-12 Thread jfondren via Digitalmars-d-learn
std.string.toStringz always allocates a new string, but it has this note: ```d /+ Unfortunately, this isn't reliable. We could make this work if string literals are put in read-only memory and we test if s[] is pointing into that. /* Peek past end of s[], if it's 0, no conversion necessary.