Re: DConf '24 Schedule & BeerConf News

2024-06-03 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 3 June 2024 at 13:26:54 UTC, Mike Parker wrote: ## The DConf '24 Schedule The DConf '24 schedule is now live: https://dconf.org/2024/index.html#schedule You'll notice that we've departed from the norm in a few places. That's because of the number of submissions we received.

Re: Limits of implicit conversion of class arrays

2024-03-23 Thread FeepingCreature via Digitalmars-d-learn
On Saturday, 23 March 2024 at 11:04:04 UTC, Dmitry Olshansky wrote: On Saturday, 23 March 2024 at 09:08:45 UTC, Per Nordlöw wrote: Is there a reason why ```d class Base {} class Derived : Base {} @safe pure nothrow unittest { Base b; Derived d; b = d; // pass

Re: Get Ready for DConf '24!

2024-02-20 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 20 February 2024 at 10:51:27 UTC, FeepingCreature wrote: I'm gonna see if I can put together enough content for a talk about effective dustmiting. Might have to be a lightning talk though. 30 minutes is gonna be a challenge to hit with that. Nevermind, I just went through the

Re: Get Ready for DConf '24!

2024-02-20 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 20 February 2024 at 03:27:31 UTC, Mike Parker wrote: It's time to start thinking more seriously about that DConf talk you've been thinking about submitting: DConf '24 is tentatively scheduled for September 17 - 20. Symmetry Investments is again our host and primary sponsor. We'll

Re: Setting field of struct object

2024-01-22 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 22 January 2024 at 08:54:54 UTC, zjh wrote: On Monday, 22 January 2024 at 08:27:36 UTC, Joel wrote: ```d import std; struct Person { string name, email; ulong age; auto withName(string name) { this.name=name; return this; } auto withEmail(string email) {

Re: Delegates and values captured inside loops

2024-01-20 Thread FeepingCreature via Digitalmars-d-learn
On Saturday, 20 January 2024 at 15:59:59 UTC, Anonymouse wrote: I remember reading this was an issue and now I ran into it myself. ```d import std.stdio; void main() { auto names = [ "foo", "bar", "baz" ]; void delegate()[] dgs; foreach (name; names) { dgs ~= () =>

Re: Nested delegates and closure allocations

2024-01-16 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 16 January 2024 at 15:39:07 UTC, Anonymouse wrote: If I make a `scope` variable of the delegate and pass *it* to `receiveTimeout`, there no longer seems to be any mention of the closure in the error (given 2.092 or later). ```d void foo(Thing thing) @nogc { void

Re: Nested delegates and closure allocations

2024-01-16 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 16 January 2024 at 10:56:58 UTC, Anonymouse wrote: I'm increasingly using nested delegates to partition code. ```d void foo(Thing thing) { void sendThing(const string where, int i) { send(thing, where, i); } sendThing("bar", 42); } ``` ... 3. Those

Re: Trying to understand map being a template

2024-01-06 Thread FeepingCreature via Digitalmars-d-learn
On Saturday, 6 January 2024 at 17:57:06 UTC, Paul Backus wrote: On Friday, 5 January 2024 at 20:41:53 UTC, Noé Falzon wrote: In fact, how can the template be instantiated at all in the following example, where no functions can possibly be known at compile time: ``` auto do_random_map(int

Re: Dirty DMD

2023-11-18 Thread FeepingCreature via Digitalmars-d-learn
On Saturday, 18 November 2023 at 18:52:07 UTC, JN wrote: Latest DMD for Windows downloaded from here: https://downloads.dlang.org/releases/2.x/2.105.3/dmd-2.105.3.exe reports version as dirty: DMD64 D Compiler v2.105.3-dirty Copyright (C) 1999-2023 by The D Language Foundation, All Rights

Re: DLF September 2023 Monthly Meeting Summary

2023-11-13 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 13 November 2023 at 00:18:35 UTC, Richard (Rikki) Andrew Cattermole wrote: Part of the problem with shared is that it is completely inverse of what it should be. It fundamentally does not annotate memory with anything extra that is useful. At the CPU level there are no guarantees

Re: Request you advise : isValidFilename

2023-09-22 Thread FeepingCreature via Digitalmars-d-learn
On Friday, 22 September 2023 at 17:52:51 UTC, FeepingCreature wrote: "Integer representation" here refers to the ANSI index or Unicode codepoint, ie. the filename must not contain `\x00` to `\x31`. Er oops, make that `\x00` to `\x1f`.

Re: Request you advise : isValidFilename

2023-09-22 Thread FeepingCreature via Digitalmars-d-learn
On Friday, 22 September 2023 at 17:44:50 UTC, Vino wrote: Hi All, Request you help in understanding why the below code is always returning true when it should return false as per the documentation. Documentation ``` filename must not contain any characters whose integer representation is

Re: dlang custom keyword for struct/class

2023-09-17 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 17 September 2023 at 15:55:37 UTC, Vitaliy Fadeev wrote: Is it possible to write like this in D? ```d struct Message { ulong timestamp; } Message LongMessage { ubyte[255] s; } // // it mean // // struct LongMessage // { // Message _super; // alias _super this; //

Re: DConf '23 Talk Videos

2023-09-17 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 17 September 2023 at 15:35:04 UTC, Mike Parker wrote: I've begun editing, rendering, and publishing the standalone videos of the DConf '23 talks. The venue gave us access to all of their footage this year rather than just a subset of it, and I'm happy to make use of it. I've also

Re: isBinary

2023-09-03 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 3 September 2023 at 10:11:22 UTC, Vino wrote: Hi All, Any update as to when the function described in the below ticked would be action-ed, I am more interested in isBinary (check a file whether is is binary file or not) http://d.puremagic.com/issues/show_bug.cgi?id=9455 From,

Re: Warning for anyone who was at DConf.

2023-09-03 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 3 September 2023 at 07:04:44 UTC, Steven Schveighoffer wrote: On Saturday, 2 September 2023 at 20:41:33 UTC, Dukc wrote: Just a while ago I was hit by some sort of a violent ailment. I first noticed it like an hour ago, and I'm shivering as I stand in a well-heated house, despite

Re: D Language Foundation August 2023 Monthly Meeting Summary

2023-09-03 Thread FeepingCreature via Digitalmars-d-announce
On Saturday, 2 September 2023 at 20:27:04 UTC, Bonarc wrote: On Wednesday, 30 August 2023 at 14:19:03 UTC, FeepingCreature wrote: When you want to react to ~every keypress in a language server impl with updated coloring, it starts to be problematic. Think in terms of "UI feedback" rather than

Re: pointer to std.algorithm.iteration : splitter

2023-08-31 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 31 August 2023 at 05:16:02 UTC, Vino wrote: Hi All, Request your help on the below error Program ``` void main() { import std.stdio:writeln; import std.algorithm.iteration : splitter; auto splitter_ptr = !((a, b) => a.splitter(b).array);

Re: D Language Foundation August 2023 Monthly Meeting Summary

2023-08-30 Thread FeepingCreature via Digitalmars-d-announce
On Friday, 25 August 2023 at 02:10:25 UTC, harakim wrote: I'm also curious why a 500ms compile time would be generally recognized as way too long. Is it because it has potential to be faster or does it cause some legitimate problem? That's a question at large, not for Matheus. When you want

Re: File size

2023-08-23 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 22 August 2023 at 16:22:52 UTC, harakim wrote: On Monday, 21 August 2023 at 11:05:36 UTC, FeepingCreature wrote: Can you print some of the wrong sizes? D's DirEntry iteration code just calls `FindFirstFileW`/`FindNextFileW`, so this *shouldn't* be a D-specific issue, and it should

Re: File size

2023-08-21 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 21 August 2023 at 07:52:28 UTC, harakim wrote: I have been doing some backups and I wrote a utility that determines if files are an exact match. As a shortcut, I check the file size. So far so good on this with millions of files until I found something odd: getSize() and DirEntry's

Re: Finding duplicate elements

2023-08-16 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 15 August 2023 at 17:59:27 UTC, vino wrote: Hi All, Request your help in finding duplicate element without sorting as per the below example ``` Example: string[] args = [" test3", "test2 ", " test1 ", " test1 ", " "]; Output Required: If duplicate element found then print

Re: toLower

2023-08-15 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 15 August 2023 at 20:09:28 UTC, Joel wrote: On Tuesday, 15 August 2023 at 16:54:49 UTC, FeepingCreature wrote: But does *not* import `std.ascii`! So there's no ambiguity inside the `sort` string expression between the two `toLower` functions.. How do I get it to work? I tried

Re: toLower

2023-08-15 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 15 August 2023 at 16:47:36 UTC, Joel wrote: How come toLower works in the sort quotes, but not in the map? ```d void main() { import std; "EzraTezla" .to!(char[]) .byCodeUnit .sort!"a.toLower c.toLower) .writeln; } ``` When you pass a string

Re: On assigning const to immutable

2023-07-13 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 13 July 2023 at 11:55:17 UTC, Ki Rill wrote: Why does the first example `class A` work, but the second one with `class B` does not? ```D class A { immutable int a; this(in int a) { this.a = a; } } class B { immutable int[] b; this(in int[] b) {

Re: Dynamic array of strings and appending a zero length array

2023-07-08 Thread FeepingCreature via Digitalmars-d-learn
On Saturday, 8 July 2023 at 17:15:26 UTC, Cecil Ward wrote: I have a dynamic array of dstrings and I’m spending dstrings to it. At one point I need to append a zero-length string just to increase the length of the array by one but I can’t have a slot containing garbage. I thought about

Re: Inheritance and arrays

2023-07-03 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 3 July 2023 at 09:50:20 UTC, Arafel wrote: Hi! I am a D user coming from java, rather than from C/C++ (although obviously also have some exposure to them), and thus apparently one of the few people here who likes OO (within reason, of course). So while I appreciate the fact that

Re: Inheritance and arrays

2023-07-03 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 3 July 2023 at 09:50:20 UTC, Arafel wrote: Hi! I am a D user coming from java, rather than from C/C++ (although obviously also have some exposure to them), and thus apparently one of the few people here who likes OO (within reason, of course). So while I appreciate the fact that

Re: Bug in usage of associative array: dynamic array with string as a key

2023-06-30 Thread FeepingCreature via Digitalmars-d-learn
On Friday, 30 June 2023 at 19:05:23 UTC, Cecil Ward wrote: I have code roughly like the following: dstring str = "name"d; uint ordinal = (( str in Decls.ordinals ) !is null) ? Decls.ordinals[ str ] : -1; struct Decls { uint[ dstring] ordinals; } //and

Re: static if - unexpected results

2023-06-23 Thread FeepingCreature via Digitalmars-d-learn
On Friday, 23 June 2023 at 18:43:06 UTC, Steven Schveighoffer wrote: It should be a spec change. Change POD to say "type" instead of "struct". The goal of `isPOD` is to determine how careful generic code needs to be to pass the type around, or copy it. Changing it to false implies that it is

Re: static if - unexpected results

2023-06-23 Thread FeepingCreature via Digitalmars-d-learn
On Friday, 23 June 2023 at 14:22:24 UTC, DLearner wrote: Hi Was looking for compile-time detection of a struct variable. However, the following test code gave the two 'FAILS' shown below. Comments? ``` void main() { import std.stdio : writeln; import std.traits; string mxnTst(string

Re: Strange behaviour of __traits(allMembers)

2023-06-18 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 18 June 2023 at 10:21:16 UTC, IchorDev wrote: On Sunday, 18 June 2023 at 10:04:14 UTC, FeepingCreature wrote: On Sunday, 18 June 2023 at 09:48:40 UTC, IchorDev wrote: Does anyone understand why this happens? Is there any way to subvert this behaviour, or is it actually a bug?

Re: Strange behaviour of __traits(allMembers)

2023-06-18 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 18 June 2023 at 09:48:40 UTC, IchorDev wrote: Does anyone understand why this happens? Is there any way to subvert this behaviour, or is it actually a bug? Yes, see also my bug report, https://issues.dlang.org/show_bug.cgi?id=20008 "__traits(allMembers) of packages is complete

Re: The DConf '23 Schedule is Live!

2023-06-12 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 6 June 2023 at 13:33:00 UTC, Mike Parker wrote: Thanks again to everyone who submitted talks for DConf '23, and congratulations to those who were accepted. We've got what looks to be another solid lineup this year. Check it out: https://dconf.org/2023/index.html And remember,

Re: Beta 2.104.0

2023-05-10 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 2 May 2023 at 00:34:45 UTC, Iain Buclaw wrote: This release comes with 11 major changes, including: - In the standard library, `std.typecons.Rebindable` now supports all types Tiny note of warning: `Rebindable` supports all types that it did not previously support, including

Re: A New Era for the D Community

2023-05-09 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 7 May 2023 at 02:15:02 UTC, monkyyy wrote: On Wednesday, 3 May 2023 at 11:13:34 UTC, Mike Parker wrote: IVY, their organizational development program Your solution to hearing luas dev saying "I dont manage anything" and whatever feedback from your survey, is you got corporate

Re: undefined reference to "main"

2023-04-05 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 5 April 2023 at 09:19:17 UTC, Alexander Zhirov wrote: How to compile the example given in the book correctly? When compiling, an error occurs that the main function is missing. If I replace `shared static this()` with `void main()', then everything starts. What does the

Re: Can nice D code get a bit slow?

2023-03-08 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 8 March 2023 at 10:49:32 UTC, Markus wrote: So, having no clue about D (just bought some books), I wanted to ask if nice looking code can become slow, in general. In the mentioned case it's just that I like the packaging of functions into some sort of scope (OOP) versus the flat

Re: How would the equivalent C type be in D?

2023-03-07 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 1 March 2023 at 09:37:48 UTC, rempas wrote: Thank you! You are amazing for explaining it! I was so focused on thinking that I'm doing something wrong with the type that I didn't noticed that the pointers, points to nowhere so the function obviously has nowhere to write to.

Re: How would the equivalent C type be in D?

2023-03-07 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 1 March 2023 at 09:37:48 UTC, rempas wrote: Thank you! You are amazing for explaining it! I was so focused on thinking that I'm doing something wrong with the type that I didn't noticed that the pointers, points to nowhere so the function obviously has nowhere to write to.

Re: How would the equivalent C type be in D?

2023-03-01 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 1 March 2023 at 08:26:07 UTC, FeepingCreature wrote: ```d uint32_t[1] value; value[0] = screen.black_pixel; xcb_create_gc(connection, black, win, mask, value.ptr); ``` To expand on this: ```d uint32_t[2] value; uint32_t* value_ptr = value.ptr; // We are allowed to access the

Re: How would the equivalent C type be in D?

2023-03-01 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 1 March 2023 at 08:12:05 UTC, rempas wrote: I'm looking into [this](https://www.x.org/releases/X11R7.7/doc/libxcb/tutorial/index.html) tutorial to learn XCB and I'm trying to write the code in D with betterC. In the section 9.1 (sorry, I cannot give a section link, the article does

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-20 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 20 February 2023 at 07:11:49 UTC, Mike Parker wrote: On Monday, 20 February 2023 at 06:26:34 UTC, FeepingCreature wrote: There have now been three pages produced by three people all agreeing with each other. At what point does it start being spam? Yes, it's all just noise

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-19 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 20 February 2023 at 05:21:44 UTC, forky wrote: On Friday, 10 February 2023 at 07:04:31 UTC, Max Samukha wrote: ... Having class-private doesn't preclude module-private. Dennis even submitted a PR implementing class-private, but it stalled because people couldn't agree on whether

Re: Non-ugly ways to implement a 'static' class or namespace?

2023-02-16 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 16 February 2023 at 02:27:23 UTC, Mike Parker wrote: On Thursday, 16 February 2023 at 02:26:44 UTC, Mike Parker wrote: Wrong. I'm arguing things: Geez. "I'm arguing 2 things:" Springboarding off this post: This thread is vastly dominated by some people who care very much

Re: Is defining get/set methods for every field overkill?

2022-11-23 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 22 November 2022 at 21:45:29 UTC, []() {}() wrote: On Tuesday, 22 November 2022 at 21:00:58 UTC, []() {}() wrote: "Being able to declare a “friend” that is somewhere in some other file runs against notions of encapsulation." (This is the motivation for that article it seems).

Re: Is defining get/set methods for every field overkill?

2022-11-21 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 17 November 2022 at 04:39:35 UTC, thebluepandabear wrote: I am creating a TUI library and I have a class with the following constant fields: ``` class Label : Renderable { const string text; const TextAlignment textAlignment; const Color color; this(Dimensions

Re: Beerconf October 2022

2022-10-29 Thread FeepingCreature via Digitalmars-d-announce
On Saturday, 29 October 2022 at 10:14:31 UTC, rikki cattermole wrote: And now for some good news! Its almost Halloween, so grab your candy and any spooky brews you may have, and join us for a ghostly chat! https://meet.jit.si/Dlang2022OctoberBeerConf I wish you'd announce the time a bit in

Re: "chain" vs "~"

2022-08-06 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 7 August 2022 at 01:22:18 UTC, pascal111 wrote: Why we use "chain" while we have "~": '''D int[] x=[1,2,3]; int[] y=[4,5,6]; auto z=chain(x,y); auto j=x~y; ''' Chain doesn't allocate any memory. This can be useful occasionally.

Re: Obsecure problem 1

2022-07-31 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 31 July 2022 at 07:43:06 UTC, Salih Dincer wrote: Why are you using const for strings? After all, they are protected by immutable. Moreover, since you do not use refs, copies are taken in every function and also you have created extra copy for results. Note sure if I'm

Re: D Language Foundation April Quarterly Meeting and Server Meeting Summaries

2022-05-05 Thread FeepingCreature via Digitalmars-d-announce
On Wednesday, 4 May 2022 at 16:21:19 UTC, Mike Parker wrote: Mario also mentioned that Mathis Beer is having "the usual problems" in his work because he is always "in the dark areas of the D compiler", but they have nothing causing them any major issues that need immediate attention. I

Re: Beta 2.098.0

2021-10-05 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 4 October 2021 at 22:40:19 UTC, Temtaime wrote: What is really discourages me that persons like Walter instead of making D great just do nothing helpful. This is just uncalled for. I'm sure you can express what you mean without pointlessly and wrongly insulting the *reason we have

Re: New library: rebindable, create a type that can stand in for any other type, but mutable (and without destructor)

2021-09-29 Thread FeepingCreature via Digitalmars-d-announce
On Wednesday, 29 September 2021 at 10:22:40 UTC, FeepingCreature wrote: Or: Turducken 2.0 The Reckoning https://code.dlang.org/packages/rebindable https://github.com/FeepingCreature/rebindable Rebindable offers a proxy type, `rebindable.DeepUnqual` (`DeepUnqual!T`) that can "stand in" for

New library: rebindable, create a type that can stand in for any other type, but mutable (and without destructor)

2021-09-29 Thread FeepingCreature via Digitalmars-d-announce
Or: Turducken 2.0 The Reckoning https://code.dlang.org/packages/rebindable https://github.com/FeepingCreature/rebindable Rebindable offers a proxy type, `rebindable.DeepUnqual` (`DeepUnqual!T`) that can "stand in" for `T` in layout, but does not share `T`'s constructor, destructor, copy

Re: alias this - am I using it wrong?

2021-08-25 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 25 August 2021 at 12:11:01 UTC, Johann Lermer wrote: Hi all, I have a little problem understanding alias this. I always thought, that alias this only makes implicit conversions from the aliased object to this. Then, why do lines 18 and 22 compile in the code below? And, btw,

Re: LDC 1.27.1

2021-08-15 Thread FeepingCreature via Digitalmars-d-announce
On Saturday, 14 August 2021 at 21:19:25 UTC, kinke wrote: A new minor version was just released: * Based on D 2.097.2 (very few fixes over v1.27.0). * Improved `-ftime-trace` implementation for compiler profiling/tracing, now excluding LLVM-internal traces, adding frontend memory tracing,

Re: Beta 2.097.2

2021-08-12 Thread FeepingCreature via Digitalmars-d-announce
On Thursday, 12 August 2021 at 15:34:48 UTC, Dennis wrote: On Thursday, 12 August 2021 at 14:14:27 UTC, FeepingCreature wrote: I can just wait for 2.098.1 otherwise though, it's not a big deal. Since Nullable is a template type, maybe you can just apply the patch on your LDC installation's

Re: Beta 2.097.2

2021-08-12 Thread FeepingCreature via Digitalmars-d-announce
On Thursday, 12 August 2021 at 13:57:28 UTC, kinke wrote: On Thursday, 12 August 2021 at 08:43:59 UTC, FeepingCreature wrote: On Wednesday, 11 August 2021 at 17:21:40 UTC, kinke wrote: I don't plan to release any LDC v1.27.1 for the very few minor fixes that made it into v2.097.2 compared to

Re: Beta 2.097.2

2021-08-12 Thread FeepingCreature via Digitalmars-d-announce
On Wednesday, 11 August 2021 at 17:21:40 UTC, kinke wrote: On Wednesday, 11 August 2021 at 13:06:24 UTC, FeepingCreature wrote: Seems to work here too :) Just waiting for ldc now. I don't plan to release any LDC v1.27.1 for the very few minor fixes that made it into v2.097.2 compared to

Re: Beta 2.097.2

2021-08-11 Thread FeepingCreature via Digitalmars-d-announce
On Saturday, 7 August 2021 at 00:31:34 UTC, kinke wrote: On Wednesday, 4 August 2021 at 17:34:32 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.097.2 point release, Thanks Martin, much appreciated. Test results at Symmetry are looking good. Seems to work here too :)

Re: using "invariant" with structs ... possible to call when a field value is set??

2021-08-08 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 8 August 2021 at 11:30:41 UTC, james.p.leblanc wrote: Hello, With structs, I understand that "invariant checking" is called (from dlang tour): It's called after the constructor has run and before the destructor is called. It's called before entering a member function

gcsnoop: Monitor D GC runs systemwide on Linux.

2021-07-23 Thread FeepingCreature via Digitalmars-d-announce
Since the GC can sometimes cause delays that can make problems for latency-sensitive programs, it may be useful to notice when it has run. To that end, I've adapted Brendan Gregg's killsnoop ( https://github.com/brendangregg/perf-tools/blob/master/killsnoop ) to `gcsnoop`, a tool to

IT'S OVER ZION! THE WAR IS OVER!

2021-06-05 Thread FeepingCreature via Digitalmars-d-announce
On Saturday, 5 June 2021 at 10:19:47 UTC, Martin Nowak wrote: Glad to announce D 2.097.0, ♥ to the 54 contributors. This release comes with a new `std.sumtype` packcage, support for `while (auto n = expression)`, an overhauled formatting package, and many more changes.

Re: General rule when not to write ;

2021-05-18 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 18 May 2021 at 16:27:13 UTC, Alain De Vos wrote: After each } i write a ; And let the compiler tell me it is an empty instruction. What are the general rules where ; is not needed after a } Is `;` ever needed after a `}`? I guess in `void delegate() dg = { writeln!"Hello World";

Re: Silicon Valley D Meetup - April 15, 2021 - "Compile Time Function Execution (CTFE)"

2021-04-27 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 26 April 2021 at 14:01:37 UTC, sighoya wrote: On Monday, 26 April 2021 at 13:17:49 UTC, FeepingCreature wrote: On Sunday, 25 April 2021 at 21:27:55 UTC, sighoya wrote: On Monday, 19 April 2021 at 06:37:03 UTC, FeepingCreature wrote: Native CTFE and macros are a beautiful thing

Re: Silicon Valley D Meetup - April 15, 2021 - "Compile Time Function Execution (CTFE)"

2021-04-26 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 25 April 2021 at 21:27:55 UTC, sighoya wrote: On Monday, 19 April 2021 at 06:37:03 UTC, FeepingCreature wrote: Native CTFE and macros are a beautiful thing though. What did you mean with native? When cx needs to execute a function at compiletime, it links it into a shared object

Re: Silicon Valley D Meetup - April 15, 2021 - "Compile Time Function Execution (CTFE)"

2021-04-19 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 19 April 2021 at 08:46:05 UTC, Ola Fosheim Grøstad wrote: I think the downsides are conceptual and technical, not social. If you can implement a version counter then you get all kinds of problems, like first compilation succeeding, then the second compilation failing with no code

Re: Silicon Valley D Meetup - April 15, 2021 - "Compile Time Function Execution (CTFE)"

2021-04-19 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 18 April 2021 at 04:41:44 UTC, Ola Fosheim Grostad wrote: On Sunday, 18 April 2021 at 00:38:13 UTC, Ali Çehreli wrote: I heard about safety issues around allowing full I/O during compilation but then the following points kind of convinced me: - If I am compiling a program, my goal

Re: What are virtual functions?

2021-04-19 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 18 April 2021 at 23:04:26 UTC, ShadoLight wrote: On Wednesday, 14 April 2021 at 14:06:18 UTC, FeepingCreature wrote: On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: [..] Covariance is related ... [..] The opposite (contravariance) happens ... [..] Nice answer

Re: What are virtual functions?

2021-04-14 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: I'm trying to understand, what virtual functions are. I found the [specs](https://dlang.org/spec/function.html#virtual-functions), but I can't make head or tail of it. - What is a `vtbl[]`? Obviously a function pointer table. But

Re: alias Nullable.get this, your time is ending

2021-03-02 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 1 March 2021 at 14:12:21 UTC, Steven Schveighoffer wrote: On 3/1/21 2:02 AM, FeepingCreature wrote: On Sunday, 28 February 2021 at 11:56:28 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.096.0 release, ♥ to the 53 contributors.

alias Nullable.get this, your time is ending

2021-02-28 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 28 February 2021 at 11:56:28 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.096.0 release, ♥ to the 53 contributors. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.096.0.html As usual please report any bugs at https://issues.dlang.org

Re: byte array to string

2021-02-24 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:47:11 UTC, Mike wrote: hi all, If i have an array: byte[3] = [1,2,3]; How to get string "123" from it? Thanks in advance. string str = format!"%(%s)"(array);

Re: byte array to string

2021-02-24 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:57:57 UTC, FeepingCreature wrote: On Thursday, 25 February 2021 at 06:47:11 UTC, Mike wrote: hi all, If i have an array: byte[3] = [1,2,3]; How to get string "123" from it? Thanks in advance. string str = format!"%(%s)"(array); Er sorry, typo, that

Re: Foo Foo = new Foo();

2021-02-21 Thread FeepingCreature via Digitalmars-d-learn
On Sunday, 21 February 2021 at 18:07:49 UTC, JN wrote: class Foo { } void main() { Foo Foo = new Foo(); } this kind of code compiles. Is this expected to compile? Yes, why wouldn't it? main is a different scope than global; you can override identifiers from global in main. And "Foo"

Re: 200-600x slower Dlang performance with nested foreach loop

2021-01-27 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 27 January 2021 at 02:14:39 UTC, H. S. Teoh wrote: Yes, definitely try this. This will completely eliminate the overhead of using an AA, which has to allocate memory (at least) once per entry added. Especially since the data has to be sorted eventually anyway, you might as well

Re: F*cked by memory corruption after assiging value to associative array

2021-01-25 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 25 January 2021 at 11:15:28 UTC, frame wrote: After a while my program crashes. I'm inspecting in the debugger that some strings are overwritten after a struct is assigned to an associative array. - I have disabled the GC. - All happens in the same thread. - The strings belong to

Re: Handling referencing class parent instances in a GC friendly way.

2020-11-30 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 30 November 2020 at 14:33:22 UTC, realhet wrote: Hi, class A{ A parent; A[] items; void myDestroy(){ items.each!(i => i.myDestroy); parent = null; // after this point I think the GC will release it automatically, and it will call ~this() too. Am I right? } } I

Re: DConf Online 2020 was a big success!

2020-11-23 Thread FeepingCreature via Digitalmars-d-announce
yaaay

Re: DConf Online 2020...

2020-10-04 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 8 September 2020 at 09:17:10 UTC, Mike Parker wrote: I was on the verge to cutting the schedule down to one day, but thanks to some last-minute submissions, looks like we'll have enough content now to stretch across two days! Thanks to everyone who submitted a proposal. I'll be in

Re: Beta 2.094.0

2020-09-14 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 13 September 2020 at 19:16:24 UTC, Steven Schveighoffer wrote: Yeah, I don't know the intention originally. But I have definitely done exactly what the thread author stated (used __traits(getMember) on all the module to look for certain symbols). So my code would be broken too.

Re: DConf Online 2020...

2020-09-09 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 8 September 2020 at 09:17:10 UTC, Mike Parker wrote: I was on the verge to cutting the schedule down to one day, but thanks to some last-minute submissions, looks like we'll have enough content now to stretch across two days! Yay! How close was it? Half the submissions in the

Re: DConf Online 2020 Submission Deadline Extended

2020-09-05 Thread FeepingCreature via Digitalmars-d-announce
On Saturday, 5 September 2020 at 04:01:43 UTC, Mike Parker wrote: On Monday, 31 August 2020 at 08:36:09 UTC, Mike Parker wrote: I've received exactly one submission for DConf Online. Two keynotes + one talk does not make a conference. So this is the last call. The deadline has been extended

Re: `enum x;` - what is it?

2020-08-19 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 19 August 2020 at 14:43:22 UTC, Victor Porton wrote: On Wednesday, 19 August 2020 at 14:06:16 UTC, Victor Porton wrote: This declaration does compile: enum x; But what is it? Is it an equivalent of enum x { } ? What in the specification allows this looking a nonsense enum x;

Re: `enum x;` - what is it?

2020-08-19 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 19 August 2020 at 14:06:16 UTC, Victor Porton wrote: This declaration does compile: enum x; But what is it? Is it an equivalent of enum x { } ? What in the specification allows this looking a nonsense enum x; ? It's an enum type whose members we don't know. So we can't

Re: D on lm32-CPU: string argument on stack instead of register

2020-08-05 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 4 August 2020 at 17:36:53 UTC, Michael Reese wrote: Thanks for suggesting! I tried, and the union works as well, i.e. the function args are registered. But I noticed another thing about all workarounds so far: Even if calls are inlined and arguments end up on the stack, the linker

Re: From the D Blog: A Pattern for Head-mutable Structures

2020-06-25 Thread FeepingCreature via Digitalmars-d-announce
On Thursday, 25 June 2020 at 11:55:14 UTC, Mike Parker wrote: Simen Kjærås outlines an approach to supporting head-mutable types in D without the need for compiler or language changes. The blog: https://dlang.org/blog/2020/06/25/a-pattern-for-head-mutable-structures/ Reddit:

Re: How to compile to .bin/.iso format

2020-06-17 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 17 June 2020 at 12:39:11 UTC, FeepingCreature wrote: On Wednesday, 17 June 2020 at 12:30:24 UTC, Quantium wrote: Hi all! I have a programm in D (The simplest OS), which should be compiled into .bin or .iso format to be possible to run it on VirtualBox. How can I compile it to

Re: How to compile to .bin/.iso format

2020-06-17 Thread FeepingCreature via Digitalmars-d-learn
On Wednesday, 17 June 2020 at 12:30:24 UTC, Quantium wrote: Hi all! I have a programm in D (The simplest OS), which should be compiled into .bin or .iso format to be possible to run it on VirtualBox. How can I compile it to .bin / .iso format and which compiler should I use? Try this page?

Re: What's the best way to find out which exceptions may be thrown ?

2020-06-03 Thread FeepingCreature via Digitalmars-d-learn
On Tuesday, 2 June 2020 at 13:58:13 UTC, Bienlein wrote: Because of the problems with checked exceptions they were deliberately left out in C#. Here is an interview with Anders Hejlsberg, the creator of C# at MS, where he explains the reasons for this decision:

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-26 Thread FeepingCreature via Digitalmars-d-announce
On Thursday, 27 February 2020 at 03:50:35 UTC, Walter Bright wrote: On 2/26/2020 4:46 PM, Adam D. Ruppe wrote: But DIP1027 had a fatal flaw: it made type safety impossible. I don't see how that is true. Because it turned a format string into a list of built-in types indistinguishable from

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-26 Thread FeepingCreature via Digitalmars-d-announce
On Wednesday, 26 February 2020 at 11:13:12 UTC, Petar Kirov [ZombineDev] wrote: On Wednesday, 26 February 2020 at 09:45:55 UTC, Walter Bright wrote: It is lowered to: f("hello %s", a); as designed. I don't know what's unwanted about it. In all other languages with string interpolation

Re: DIP 1027---String Interpolation---Format Assessment

2020-02-24 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 24 February 2020 at 22:11:08 UTC, Walter Bright wrote: The semantics of an interpolated string must be defined by the DIP, not deferred to some template. If the implementation of those defined language features is done by a template, that is an implementation choice, not part of the

Re: From [Tuple!(A,B), ...] to Tuple!(A[], B[])

2020-02-17 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 17 February 2020 at 11:07:33 UTC, foozzer wrote: Hi all, There's something in Phobos for that? Thank you Here you go: import std; // extract the types that make up the tuple auto transposeTuple(T : Tuple!Types[], Types...)(T tuples) { // templated function that extracts the

Re: dub dustmite struggles

2020-01-19 Thread FeepingCreature via Digitalmars-d-learn
On Monday, 20 January 2020 at 06:48:08 UTC, DanielG wrote: I can't seem to figure out what dub's dustmite command is looking for with its regexes. No matter what I try - no matter how simple - the initial test fails. I am able to run dustmite standalone just fine with the following test

Re: dud: A dub replacement

2019-11-15 Thread FeepingCreature via Digitalmars-d-announce
On Monday, 11 November 2019 at 13:44:28 UTC, Robert Schadek wrote: Now that dud can parse dub files, the next step will be a semantic phase, checking the input for errors. After that, path expansion and dependency resolution. PR's are always welcome. Destroy! [1]

Re: Beta 2.089.0

2019-10-29 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 29 October 2019 at 06:06:56 UTC, FeepingCreature wrote: On Sunday, 27 October 2019 at 16:50:00 UTC, baz wrote: What does the author of the deprecation think about this case ("feep" IIRC ) ? Yeah that's a non-fix. It's a blind replacement of "a" with "a.get" that ignores the fact

Re: Beta 2.089.0

2019-10-29 Thread FeepingCreature via Digitalmars-d-announce
On Sunday, 27 October 2019 at 16:50:00 UTC, baz wrote: On Sunday, 27 October 2019 at 16:38:30 UTC, baz wrote: On Sunday, 27 October 2019 at 15:04:34 UTC, drug wrote: 27.10.2019 17:20, baz пишет: On Sunday, 27 October 2019 at 12:59:52 UTC, baz wrote: On Thursday, 17 October 2019 at 06:02:33

Re: Oberon to D

2019-10-16 Thread FeepingCreature via Digitalmars-d-announce
On Tuesday, 15 October 2019 at 18:02:28 UTC, Mario Kröplin wrote: https://github.com/linkrope/oberon2d is a simple tool that translates source code from Oberon to D. It was intended to be thrown away after the resurrection of a single Oberon project. (So, don't expect too much.) But then,

  1   2   >