On Mon, Feb 06, 2023 at 03:54:40PM +, bachmeier via Digitalmars-d-learn
wrote:
> On Sunday, 5 February 2023 at 08:48:34 UTC, Tamas wrote:
[...]
> > This is the specification for the D Programming Language.
>
> I've been bitten by that a few times over the years, though to be
> honest, I'm
On Tue, Jan 31, 2023 at 11:25:02AM +1300, Richard (Rikki) Andrew Cattermole via
Digitalmars-d-announce wrote:
> Like this? https://docs.webfreak.org/getting-started/first-steps/
Not bad! Looks much more promising than the original page for sure.
Still ran into some issues though. The linked
On Mon, Jan 30, 2023 at 08:39:33PM +, bachmeier via Digitalmars-d-announce
wrote:
> On Monday, 30 January 2023 at 04:40:48 UTC, Siarhei Siamashka wrote:
> > On Monday, 30 January 2023 at 02:44:50 UTC, bachmeier wrote:
> > > if you put your code in directories that match the modules you
> > >
On Mon, Jan 30, 2023 at 03:59:52PM +, Adam D Ruppe via Digitalmars-d-learn
wrote:
> On Monday, 30 January 2023 at 15:37:56 UTC, Guillaume Piolat wrote:
> > Why not XML? :) It has comments, you can use backslashes too.
>
> no kidding, xml is an underrated format.
XML is evil.
Let me qualify
On Mon, Jan 23, 2023 at 08:43:03PM +, Adam D Ruppe via
Digitalmars-d-announce wrote:
> On Monday, 23 January 2023 at 20:06:46 UTC, H. S. Teoh wrote:
> > There should be a tool for auto-generating JS wrappers, perhaps even
> > HTML snippets, so that a user literally can just write:
> >
> >
On Mon, Jan 23, 2023 at 08:06:28PM +, Alain De Vos via Digitalmars-d-learn
wrote:
> Mixing D with C or C++ or Python is looking for problems.
> Better write something in D.
> And write something in C/C++/Python.
> And have some form of communication between both.
I don't know about Python,
On Sat, Jan 21, 2023 at 04:29:28AM +, Mike Parker via
Digitalmars-d-announce wrote:
[...]
> __CTFE writeln__
>
> Razvan next brought up [a PR to implement a `__ctfeWriteln`
> built-in](https://github.com/dlang/dmd/pull/12412). It was currently
> stalled and needed Walter's approval. Walter
On Fri, Jan 20, 2023 at 01:32:22PM -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 1/20/23 07:01, torhu wrote:
>
> > But why not have drawLine just be a free function?
>
> Exactly.
>
> If I'm not mistaken, and please teach me if I am wrong, they are
> practically free functions in Java
On Fri, Jan 20, 2023 at 12:49:54PM +, Ruby The Roobster via
Digitalmars-d-learn wrote:
[...]
> Thank you. I didn't know that there was such a property `.array`.
It's not a property, it's a Phobos function from std.array.
T
--
INTEL = Only half of "intelligence".
On Fri, Jan 20, 2023 at 03:34:43AM +, Ruby The Roobster via
Digitalmars-d-learn wrote:
> On Friday, 20 January 2023 at 03:30:56 UTC, Steven Schveighoffer wrote:
> > On 1/19/23 10:11 PM, Ruby The Roobster wrote:
> > ...
> >
> > The point is to be a range over the original input, evaluated
> >
On Fri, Jan 20, 2023 at 03:11:33AM +, Ruby The Roobster via
Digitalmars-d-learn wrote:
> Take this example:
>
> ```d
> import std;
> void main()
> {
> auto c = "a|b|c|d|e".splitter('|');
> c.writeln;
> string[] e = ["a", "b", "c", "d", "e"];
> assert(c.equal(e));
>
On Tue, Jan 17, 2023 at 11:08:19PM +, Siarhei Siamashka via
Digitalmars-d-learn wrote:
> On Tuesday, 17 January 2023 at 21:50:06 UTC, matheus wrote:
> > Question: Have you compared the timings between this way (With
> > ranges) and a normal way (Without ranges)?
>
> If you are intensively
On Sun, Jan 15, 2023 at 01:53:51PM +, Dmytro Katyukha via
Digitalmars-d-announce wrote:
[...]
> Also, this lib contains function
> [createTempDirectory](https://github.com/katyukha/thepath/blob/master/source/thepath/utils.d),
> that, i think, would be nice to have it in Phobos.
Yes it would
On Fri, Jan 13, 2023 at 08:31:17AM -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 1/13/23 07:07, Gavin Ray wrote:
>
> > This is "valid" D I hope?
>
> Yes because static arrays are just elements side-by-side in memory.
> You can cast any piece of memory to a static array provided the
On Fri, Jan 13, 2023 at 02:22:34PM +, Sergei Nosov via Digitalmars-d-learn
wrote:
> Hey, everyone!
>
> I was wondering if there's a strong reason behind not implementing
> elementwise operations on tuples?
>
> Say, I've decided to store 2d points in a `Tuple!(int, int)`. It would
> be
On Wed, Jan 11, 2023 at 02:15:13AM +, Joel via Digitalmars-d-learn wrote:
> I get this error after a while (seems append doesn't close the file
> each time):
> std.file.FileException@std/file.d(836): history.txt: Too many open files
>
> ```d
> auto jm_addToHistory(T...)(T args) {
>
On Tue, Jan 10, 2023 at 03:18:54AM +, matheus via Digitalmars-d-learn wrote:
> On Tuesday, 10 January 2023 at 01:22:33 UTC, H. S. Teoh wrote:
> > ...
> >
> > Here's a challenge. Given an input year, for example, "2023",
> > write a program that outputs (for the corresponding year):
> > ...
>
On Tue, Jan 10, 2023 at 12:17:18AM +, Paul via Digitalmars-d-learn wrote:
> Greetings Dlang-ers
> I was wondering if anyone knew of any coding challenges available
> where the input and output are specified and its left to the
> programmer to find a solution?
Here's a challenge. Given an
On Fri, Jan 06, 2023 at 12:52:43PM +, Hipreme via Digitalmars-d-announce
wrote:
> Hello people. I have tried working again with adam's wasm minimal
> runtime, and yesterday I was able to make a great progress on it.
[...]
> All those tests are currently passing. That means we almost got all
>
On Fri, Jan 06, 2023 at 04:07:12AM +, areYouSureAboutThat via
Digitalmars-d-announce wrote:
[...]
> btw. Linus one said, more or less, that one reason he likes C so much, is
> because when he is typing it, he can visualise what assembly will be
> produced (i.e. his mind is always intune with
On Thu, Jan 05, 2023 at 10:46:07PM +, thebluepandabear via
Digitalmars-d-learn wrote:
> On Thursday, 5 January 2023 at 17:36:55 UTC, H. S. Teoh wrote:
[...]
> > ```D
> > foreach (BoardSize boardSize; arr) {
> > Button button = new Button();
> > button.text = format("%sx%s",
On Thu, Jan 05, 2023 at 08:18:42PM +, DLearner via Digitalmars-d-learn
wrote:
> On Thursday, 5 January 2023 at 19:54:01 UTC, H. S. Teoh wrote:
[...]
> > core.stdc.stdlib.{malloc,free} *is* the exact same malloc/free that
> > C uses, it has nothing to do with the GC. The allocated memory is
>
On Thu, Jan 05, 2023 at 07:49:38PM +, DLearner via Digitalmars-d-learn
wrote:
> Suppose there is a D main program (not marked anywhere with @nogc),
> that _both_
>
> A: Calls one or more C functions that themselves call malloc/free; and
> also
> B: Calls one or more D functions that
On Thu, Jan 05, 2023 at 02:32:17PM +, Dom DiSc via Digitalmars-d-learn
wrote:
[...]
> I think this is really another usecase for @property: we should forbid the
> function call syntax for them (so one needs to use them like a variable).
[...]
> Properties are not functions. If you want a
On Thu, Jan 05, 2023 at 11:55:33AM +, thebluepandabear via
Digitalmars-d-learn wrote:
[...]
> ```D
> foreach (BoardSize boardSize; arr) {
> Button button = new Button();
> button.text = format("%sx%s", boardSize[0], boardSize[1]);
> button.onButtonClick = {
>
On Thu, Jan 05, 2023 at 06:32:47AM +, areYouSureAboutThat via
Digitalmars-d-learn wrote:
[...]
> Second, to be sure your getting the correct results, it would be nice
> if there was a 'category of type' in std.traits for:
>
> isAllocatedOnStack
> isAllocatedOnHeap
>
> As it is, your just
On Wed, Jan 04, 2023 at 01:20:12PM -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 1/4/23 12:02, Steven Schveighoffer wrote:
> > On 1/4/23 2:27 PM, Ali Çehreli wrote:
>
> >> I put the objects into a 2-length
> >> static array but the difference was still 0x20. (?)
> >
> > Are you putting
On Wed, Jan 04, 2023 at 09:51:05AM -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 1/3/23 20:01, Paul wrote:
>
> > Size Alignment Type
> > =
> >17 8 MyClass
> >
> > MyClassObj1 MyClassObj2
> > 27727202000 27727202020
> > ```
> > If my
On Tue, Jan 03, 2023 at 05:13:53PM +1300, Richard (Rikki) Andrew Cattermole via
Digitalmars-d-announce wrote:
> On 03/01/2023 10:24 AM, Dukc wrote:
> > Other things coming to mind: Bidirectional grapheme iteration,
> > Word break and line break algorithms, lazy normalisation. Indeed,
> > lots of
On Sun, Jan 01, 2023 at 02:18:23AM +, Salih Dincer via Digitalmars-d-learn
wrote:
> On Sunday, 1 January 2023 at 01:20:02 UTC, Ali Çehreli wrote:
> > On 12/31/22 16:42, H. S. Teoh wrote:
> >
> > - runtime: The D runtime.
>
> Sometimes I see runtime facilities used as compile time and I'm
On Sun, Jan 01, 2023 at 12:35:40AM +, Paul via Digitalmars-d-learn wrote:
> Hello. Thanks for any assistance.
>
> Can I acquire the address of a class object, not a class variable
> (i.e. the instantiations of the class) but the object definition
> itself?
>
> ```d
> class MyClass {char c}
On Wed, Dec 28, 2022 at 02:31:45AM +, thebluepandabear via
Digitalmars-d-learn wrote:
> I am reading through the free book on learning D by Ali Çehreli and I
> am having difficulties understanding the difference between compile
> time execution and run time execution in D language.
It's very
On Fri, Dec 23, 2022 at 03:21:24PM +, jwatson-CO-edu via
Digitalmars-d-learn wrote:
> On Friday, 23 December 2022 at 00:00:06 UTC, H. S. Teoh wrote:
[...]
> > My personal guess is that you forgot a `ref` somewhere when you pass
> > the RNG to a function. Given that due to historical accident
On Thu, Dec 22, 2022 at 08:17:56PM +, jwatson-CO-edu via
Digitalmars-d-learn wrote:
> On Thursday, 22 December 2022 at 17:33:48 UTC, Paul Backus wrote:
> > So, as far as I can tell, there is nothing wrong with your code, and
> > the random number generator is working as intended.
> >
> >
On Thu, Dec 22, 2022 at 12:43:28AM +, thebluepandabear via
Digitalmars-d-learn wrote:
> Say you have the following function that takes in a `ref` parameter:
>
> ```D
> void modify(ref int num) {
> num += 5;
> }
> ```
>
> Does the compiler turn that into the code below?
>
> ```D
> void
On Tue, Dec 20, 2022 at 07:46:36PM +, John Colvin via
Digitalmars-d-announce wrote:
[...]
> > There's also my little experimental csv parser that was designed to
> > be as fast as possible:
> >
> > https://github.com/quickfur/fastcsv
> >
> > However it can only handle input that fits in
On Mon, Dec 19, 2022 at 04:16:57PM -0800, Walter Bright via
Digitalmars-d-announce wrote:
> On 12/19/2022 4:35 AM, Adam D Ruppe wrote:
> > On Monday, 19 December 2022 at 09:55:47 UTC, Walter Bright wrote:
> > > Curious why CSV isn't in the list.
> >
> > Maybe std.csv is already good enough?
>
>
On Sat, Dec 17, 2022 at 02:36:10AM +, thebluepandabear via
Digitalmars-d-learn wrote:
[...]
> Thanks, I've tried to mark it with `@safe` and it did give me a
> warning.
>
> I was also wondering, why is this code valid?
>
> ```D
> int[] numbersForLaterUse;
>
> @safe void foo(int[] numbers)
On Fri, Dec 16, 2022 at 05:39:08PM -0800, H. S. Teoh via Digitalmars-d-learn
wrote:
[...]
> If you really want to see what could possibly have gone wrong, try
> this version of the code:
[...]
> The results will likely differ depending on your OS and specific
> environment; but
On Sat, Dec 17, 2022 at 12:23:32AM +, thebluepandabear via
Digitalmars-d-learn wrote:
[...]
> ```D
> int[] numbersForLaterUse;
>
> void foo(int[] numbers...) {
>numbersForLaterUse = numbers;
> }
>
> struct S {
> string[] namesForLaterUse;
>
> void foo(string[] names...) {
>
On Fri, Dec 09, 2022 at 12:51:27PM +0100, Christian Köstlin via
Digitalmars-d-learn wrote:
> On 09.12.22 02:27, H. S. Teoh wrote:
[...]
> > https://github.com/dlang/phobos/pull/8646
[...]
> Thanks a lot ...
> that was fast.
It only took a minute to fix. :-D
> Is there also an implementation
On Thu, Dec 08, 2022 at 05:21:52PM -0800, H. S. Teoh via Digitalmars-d-learn
wrote:
[...]
> I'll see if I can reword this to be more explicit.
[...]
https://github.com/dlang/phobos/pull/8646
T
--
Don't modify spaghetti code unless you can eat the consequences.
On Thu, Dec 08, 2022 at 09:15:45PM +0100, Christian Köstlin via
Digitalmars-d-learn wrote:
> Recently I stumbled upon a small issue in dlang's docs.
> I wanted to look up uniq in std.algorithm. Started from
> https://dlang.org/phobos/std_algorithm.html and clicked uniq, no
> problem, all good.
On Tue, Dec 06, 2022 at 11:07:32PM +, johannes via Digitalmars-d-learn
wrote:
> //-- the result should be f.i. "the sun is shining"
> //-- sqlite3_column_text returns a constant char* a \0 delimited c-string
> printf("%s\n",sqlite3_column_text(res, i));
> writeln(sqlite3_column_text(res, i));
On Sun, Dec 04, 2022 at 04:33:35PM +, rempas via Digitalmars-d-learn wrote:
> First a little bit of theory. A pointer just points to a memory
> address which is a number. So when I add "10" to this pointer, it will
> point ten bytes after the place it was pointing to, right?
This is true only
On Fri, Dec 02, 2022 at 11:47:30PM +, thebluepandabear via
Digitalmars-d-learn wrote:
> On Friday, 2 December 2022 at 23:44:28 UTC, thebluepandabear wrote:
> > > :-D
> > >
> > > (Exercise for the reader: what's the Hausdorff dimension of the
> > > set of strings over Unicode space? :-P)
> >
On Fri, Dec 02, 2022 at 02:32:47PM -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 12/2/22 13:44, rikki cattermole wrote:
>
> > Yeah you're right, its code unit not code point.
>
> This proves yet again how badly chosen those names are. I must look it
> up every time before using one or
On Fri, Dec 02, 2022 at 09:18:44PM +, thebluepandabear via
Digitalmars-d-learn wrote:
> Hello (noob question),
>
> I am reading a book about D by Ali, and he talks about the different
> char types: char, wchar, and dchar. He says that char stores a UTF-8
> code unit, wchar stores a UTF-16
On Wed, Nov 30, 2022 at 03:07:44AM +, thebluepandabear via
Digitalmars-d-learn wrote:
> I am reading through Ali's book about D, and he gives the following
> examples for an overflow:
[...]
> The result overflows and is 1705032704.
>
> Also for the second example, it overflows and comes up
On Fri, Nov 18, 2022 at 11:51:42AM +, thebluepandabear via
Digitalmars-d-learn wrote:
A question I have been thinking about whilst using D is how
often I
should be using const.
You should use it as often as you need to use it, and no more.
If you
don't need to use it, don't use it.
On Thu, Nov 17, 2022 at 10:16:04PM +, jwatson-CO-edu via
Digitalmars-d-learn wrote:
> On Thursday, 17 November 2022 at 21:05:43 UTC, H. S. Teoh wrote:
[...]
> > struct Atom {
> > F_Type kind;
> > union { // anonymous union
> > Atom*
On Thu, Nov 17, 2022 at 08:54:46PM +, jwatson-CO-edu via
Digitalmars-d-learn wrote:
[...]
> ```d
> enum F_Type{
> CONS, // Cons pair
> STRN, // String/Symbol
> NMBR, // Number
> EROR, // Error object
> BOOL, // Boolean value
> FUNC, // Function
> }
>
> struct Atom{
>
On Wed, Nov 16, 2022 at 10:51:31PM +, bioinfornatics via
Digitalmars-d-learn wrote:
> Dear community,
>
> I look some day ago to the D wasm page:
> -> https://wiki.dlang.org/Generating_WebAssembly_with_LDC
>
> And since then I ask myself can we at compile time convert a D code
> to an
On Thu, Nov 10, 2022 at 11:26:45PM +, Alexander Zhirov via
Digitalmars-d-learn wrote:
> I have an array of self-written class `A`. I'm sorry for my tactlessness,
> but I'm confused about the modules. How do I correctly find a specific
> object `fragment` inside the array and delete it? I
On Thu, Nov 10, 2022 at 07:07:33PM +, Imperatorn via Digitalmars-d-learn
wrote:
> On Thursday, 10 November 2022 at 16:34:53 UTC, Ali Çehreli wrote:
> > On 11/9/22 11:30, Vladimir Panteleev wrote:
> > > On Wednesday, 9 November 2022 at 19:05:58 UTC, Ali Çehreli
> > > wrote:
> > >> Running the
Happened to stumble across this today, which I thought is a relevant, if
sadly humorous, take on build systems:
https://pozorvlak.dreamwidth.org/174323.html
T
--
ASCII stupid question, getty stupid ANSI.
On Fri, Nov 04, 2022 at 11:19:17PM +, Anonymouse via Digitalmars-d-learn
wrote:
> [#20699](https://issues.dlang.org/show_bug.cgi?id=20699) must be
> non-trivial to fix, so I'm exploring makefiles. If possible I'd like
> to keep dub for dependency management though, just not for actual
>
On Fri, Nov 04, 2022 at 07:34:58PM +, jmh530 via Digitalmars-d-learn wrote:
> On Friday, 4 November 2022 at 19:17:04 UTC, Adam D Ruppe wrote:
> > On Friday, 4 November 2022 at 19:10:33 UTC, jmh530 wrote:
> > > If you don't plan to use private(package_name), then I don't know
> > > what the
On Fri, Nov 04, 2022 at 03:57:05PM +, Bastiaan Veelo via
Digitalmars-d-announce wrote:
> On Wednesday, 2 November 2022 at 18:20:42 UTC, H. S. Teoh wrote:
> > On Wed, Nov 02, 2022 at 06:11:12PM +, M. M. via
> > Digitalmars-d-announce wrote:
> > > Thank you to Martin Nowak for all his as
On Wed, Nov 02, 2022 at 09:16:22PM +0100, Christian Köstlin via
Digitalmars-d-learn wrote:
> On 02.11.22 20:16, H. S. Teoh wrote:
[...]
> > IMO, the ideal situation is a hybrid situation: the underlying build
> > mechanism should be purely declarative, because otherwise the
> > complexity just
On Thu, Nov 03, 2022 at 08:51:52AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 11/3/22 03:00, Bruno Pagis wrote:
>
> >void print() {
> > writeln("array = ", this.array);
> >}
>
> Similar to Paul Backus's program but I would try to avoid the file system
> for unit tests
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 "foo"
> A a2;
> a2.foo(); // Segmentation fault
On Wed, Nov 02, 2022 at 03:08:36PM +, JN via Digitalmars-d-learn wrote:
> On Tuesday, 1 November 2022 at 23:40:22 UTC, Christian Köstlin wrote:
> > sh("touch %s".format(t.name));
>
> One of the problems of many Make-like tools is that they offer lots of
> freedom, especially
On Wed, Nov 02, 2022 at 06:11:12PM +, M. M. via Digitalmars-d-announce
wrote:
> On Wednesday, 2 November 2022 at 04:42:06 UTC, Mike Parker wrote:
> > The D Language Foundation's October 2022 meeting was a quarterly,
> > meaning that several industry representatives attended. It took
> > place
On Tue, Nov 01, 2022 at 10:37:57AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 11/1/22 10:27, H. S. Teoh wrote:
>
> > Maybe try running Digger to reduce the code for you?
>
> Did you mean dustmite, which is accessible as 'dub dustmite
> ' but I haven't used it.
Oh yes, sorry, I
On Tue, Nov 01, 2022 at 05:19:56PM +, mw via Digitalmars-d-learn wrote:
> My program received signal SIGSEGV, Segmentation fault.
>
> Its simplified structure looks like this:
>
> ```
> void foo() {
> ...
> writeln("done"); // saw this got printed!
> }
>
> int main() {
> foo();
>
On Thu, Oct 27, 2022 at 06:20:10PM +, Imperatorn via Digitalmars-d-learn
wrote:
> On Thursday, 27 October 2022 at 17:17:01 UTC, ab wrote:
> > Hi,
> >
> > when trying to compare different implementations of the optimized
> > builds of a pure function using benchmark from
> >
On Wed, Oct 26, 2022 at 04:20:01PM +, DLearner via Digitalmars-d-learn
wrote:
> Hi
>
> Never used DUB before.
> Wanted to use a function stored in a module outside the main source.
>
> Main source has `import ;`
>
> Put a line into the JSON: `"importPaths": "C:\\Users\\..."` pointing
> to
On Wed, Oct 26, 2022 at 12:16:55AM +, Salih Dincer via Digitalmars-d-learn
wrote:
[...]
> I've known D for more than 10 years, but the topic we're talking about
> still seems strange to me. The explanations given are not enough for
> me, I'm sorry.
>
> Can anyone tell me what happens when I
On Mon, Oct 24, 2022 at 09:26:14PM +, Per Nordlöw via Digitalmars-d-learn
wrote:
> What property of a container (type) `T` enables iteration as
>
> ```d
> foreach (k, v; T.init)
> {
> ...
> }
> ```
>
> ? I thought it sufficed to define `T.byKeyValue` but its presence seem
> to have no
On Sun, Oct 23, 2022 at 01:32:44PM +, matheus via Digitalmars-d-learn wrote:
> Hi,
>
> I have a design question and I'd like to hear some advice. Let's say
> that I want to create a method to sort an array:
>
> arr.sort(asc);
>
> I think usually this would usually return a new set of
On Fri, Oct 21, 2022 at 04:32:17PM +, Hipreme via Digitalmars-d-learn wrote:
> Hey guys, I have been complaining a lot of time right now from D
> compilation speed at least for my project.
>
> I have:
> - Underused CTFE
> - Underused Templates
> - Avoided importing standard libraries
> -
On Wed, Oct 19, 2022 at 01:15:37AM +, Adam D Ruppe via Digitalmars-d-learn
wrote:
> On Wednesday, 19 October 2022 at 00:57:31 UTC, H. S. Teoh wrote:
> > Has it really been implemented? I tested the latest git master, the
> > following code doesn't compile:
>
> it only applies to types, not
On Sat, Oct 15, 2022 at 12:47:02AM +, Mike Parker via Digitalmars-d-learn
wrote:
> On Friday, 14 October 2022 at 22:17:52 UTC, H. S. Teoh wrote:
>
> > Given that this particular trap crops up regularly, perhaps some
> > sort of warning ought to be added. Once the @nodiscard DIP is
> >
On Fri, Oct 14, 2022 at 09:51:54PM +, WhatMeWorry via Digitalmars-d-learn
wrote:
>
> I lost about a half an hour troubleshooting some code of mine which as it
> turned out to be resolved with just one line.
>
>
> // paths.remove(i); // compiles fine but does nothing
>
> paths =
On Wed, Oct 05, 2022 at 04:57:57PM +, Paul via Digitalmars-d-learn wrote:
>I'm sure I'm making this more difficult than it needs to be. I'm
> trying to convert an integer to a dchar. The solution below works but
> seems like overkill.
>
> dstring dstrValue = to!dstring(5);
>
On Mon, Oct 03, 2022 at 05:38:25PM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
[...]
> Good catch but I think what we want is a copy of the front element, at
> least for InputRanges (.save does not work for File.byLine :/).
One of the things we need to settle in Phobos v2 is what to do
On Sat, Oct 01, 2022 at 01:20:08PM +, realhet via Digitalmars-d-learn wrote:
> Hello,
>
> I just wanted to optimize a byte -> index lookup, by using a 256
> element table instead of using [1, 2, 3].countUntil(x) and I was
> amazed what I've found.
> My solution lookup[x] was not faster at
On Sat, Sep 17, 2022 at 12:19:16AM +, frame via Digitalmars-d-learn wrote:
> On Friday, 16 September 2022 at 23:06:35 UTC, H. S. Teoh wrote:
>
> > Basically, if you pass something to .fun by value, then that value
> > must be destroyed by .fun once it's ready to return. So if the
> > value
On Fri, Sep 16, 2022 at 10:43:43PM +, frame via Digitalmars-d-learn wrote:
> ```d
> import std.variant;
>
> // error: destructor `std.variant.VariantN!32LU.VariantN.~this` is not
> `nothrow`
> void fun(Variant v) nothrow
> {
>
> }
>
> void main()
> {
>fun(Variant());
> }
> ```
>
> A
On Mon, Sep 12, 2022 at 02:29:58PM -0400, Steven Schveighoffer via
Digitalmars-d-learn wrote:
[...]
> If your intent is to *enforce* pure functions only, then that's what
> you do. If your intent instead is to ensure that given proper
> parameters, the function will be pure, then the answer is
On Mon, Sep 12, 2022 at 10:08:29AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
[...]
> What I meant was
>
> - if I put 'pure' etc. on my templatized code,
>
> - and then tested with a 'pure' unittest,
>
> I wouldn't know that the gratuitous use of my 'pure' on the member
> function was
On Mon, Sep 12, 2022 at 09:14:42AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
[...]
> struct Foo(R) {
> R r;
> int i;
>
> bool empty() @nogc nothrow pure @safe scope {
> return r.empty;
> }
>
> auto front() @nogc nothrow pure @safe scope {
> return
On Sat, Sep 10, 2022 at 04:59:50PM +, Injeckt via Digitalmars-d-learn wrote:
> I'm trying use classes in my project, but when i'm try inherit class,
> I get error:
>
> Error: import `Server.Console` is used as a type
[...]
Don't name the module the same thing as the class. Rename it
On Wed, Sep 07, 2022 at 06:11:14PM +, Injeckt via Digitalmars-d-learn wrote:
> I need to include this Ws2tcpip.h header file to my project. How can I
> do this? It's all because I need inet_ntop function from this header
> file.
If that's the only function you need, you can just copy the
On Fri, Aug 19, 2022 at 11:36:09AM +, Iain Buclaw via
Digitalmars-d-announce wrote:
> Hi,
>
> GCC version 12.2 has been released.
[...]
> - Updated the D front-end from v2.100.0-rc1 to v2.100.1.
[...]
:-O TOTAL AWESOMENESS!!! Now GDC is officially up-to-date with the
latest version of the
On Fri, Aug 12, 2022 at 12:12:13AM +, Adam D Ruppe via Digitalmars-d-learn
wrote:
> On Thursday, 11 August 2022 at 23:50:58 UTC, H. S. Teoh wrote:
> > I think the OP's idea is somewhat different: adding contextual
> > information to a propagating exception that the throwing code may
> > not
On Thu, Aug 11, 2022 at 11:06:45PM +, Adam D Ruppe via Digitalmars-d-learn
wrote:
> You might find my recent blog post interesting too:
>
> http://dpldocs.info/this-week-in-d/Blog.Posted_2022_08_01.html#exception-template-concept
>
> and a draft of some more concepts:
>
On Sat, Aug 06, 2022 at 03:37:32PM +, pascal111 via Digitalmars-d-learn
wrote:
> On Friday, 5 August 2022 at 04:05:08 UTC, Salih Dincer wrote:
> > On Thursday, 4 August 2022 at 22:54:42 UTC, pascal111 wrote:
> > >
> > > I didn't notice that all what we needs to pop a range forward is
> > >
On Fri, Aug 05, 2022 at 10:14:24PM -0400, Steven Schveighoffer via
Digitalmars-d-announce wrote:
> On 8/5/22 8:51 PM, Don Allen wrote:
>
> > And this, from Section 32.2 of the Language Reference Manual:
> >
> > If pointers to D garbage collector allocated memory are passed to C
> >
On Fri, Aug 05, 2022 at 08:06:00AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> [...] I realized that the following fails with a RangeError:
>
> void main() {
> auto arr = [1, 2, 3];
> arr[0..$-1] = arr[1..$];// <-- Runtime error
> }
>
> I suspect the length of the array is
On Fri, Aug 05, 2022 at 02:23:15PM +, Ruby The Roobster via
Digitalmars-d-learn wrote:
> On Friday, 5 August 2022 at 14:11:09 UTC, H. S. Teoh wrote:
> > On Fri, Aug 05, 2022 at 01:56:40PM +, Ruby The Roobster via
> > Digitalmars-d-learn wrote: [...]
> > > public import dutils.math.core;
>
On Fri, Aug 05, 2022 at 01:56:40PM +, Ruby The Roobster via
Digitalmars-d-learn wrote:
[...]
> public import dutils.math.core;
Is the imported module available anywhere? I'm trying to run your code
sample to determine what's going on, but it's not compiling because you
didn't post the code
On Thu, Aug 04, 2022 at 11:52:48PM +, pascal111 via Digitalmars-d-learn
wrote:
> On Thursday, 4 August 2022 at 21:35:37 UTC, Adam D Ruppe wrote:
> > On Thursday, 4 August 2022 at 21:15:39 UTC, pascal111 wrote:
> > > > https://github.com/adamdruppe/arsd/blob/master/terminal.d
> > >
> > > How
On Thu, Aug 04, 2022 at 07:22:04AM +, Domain via Digitalmars-d-learn wrote:
> On Wednesday, 3 August 2022 at 12:27:32 UTC, frame wrote:
> > On Wednesday, 3 August 2022 at 03:36:55 UTC, Domain wrote:
> > > I want to find out all public functions in all modules in a package.
> > > Can I do that
On Thu, Aug 04, 2022 at 12:45:44AM +, Ruby The Roobster via
Digitalmars-d-learn wrote:
> How exactly can one store the string representation of a BigInt? The
> seemingly obvious
>
> ```d
> //...
> dchar[] ret; //dchar[] is necessary for my project
> //Assume that val is a BigInt with a
On Thu, Aug 04, 2022 at 12:35:55AM +, Alex Burton via Digitalmars-d-learn
wrote:
> Hi,
> I want to use MmFile to manage memory mapped files. I want multiple
> processes to be able to read in many files using the virtual memory
> system to page them in and reuse the memory.
>
> If I read the
On Wed, Aug 03, 2022 at 04:28:57AM +, anonymouse via Digitalmars-d-learn
wrote:
> How do I go about tracking down what's causing the following error:
>
> ```
> Undefined symbols for architecture x86_64:
> "__D3std8internal6memory12__ModuleInfoZ", referenced from:
>
On Tue, Aug 02, 2022 at 11:10:27AM +, Alexander Zhirov via
Digitalmars-d-learn wrote:
[...]
> ```d
> auto result = db.query("select tcxs.settings_file as dbfile from
> amts.t_client_xrdp_settings tcxs where tcxs.pid_client = ?", id);
> ubyte[] bytes = cast(ubyte[])result.front()["dbfile"];
>
On Fri, Jul 29, 2022 at 10:32:11PM +, pascal111 via Digitalmars-d-learn
wrote:
[...]
> I want searching for value 54 in array y "54.among(y).writeln;", but
> it seems compiler complaints because the data type is "int[]", so I
> tried to convert "y" to "uint[]".
You're using the wrong
101 - 200 of 4212 matches
Mail list logo