Re: "in" operator gives a pointer result from a test against an Associative Array?

2024-05-09 Thread Meta via Digitalmars-d-learn
On Friday, 10 May 2024 at 00:18:16 UTC, Andy Valencia wrote: tst7.d(6): Error: cannot implicitly convert expression `e in this.members` of type `bool*` to `bool` tst7.d(15): Error: template instance `tst7.Foo!uint` error instantiating I'm getting this for this bit of source (trimmed from the

Re: Is D programming friendly for beginners?

2024-03-12 Thread Meta via Digitalmars-d-announce
On Tuesday, 12 March 2024 at 16:20:29 UTC, matheus. wrote: On Tuesday, 12 March 2024 at 14:52:32 UTC, Mike Shah wrote: ... I really think D would be a wonderful first language.  Fast feedback, no need to manage memory, and easy to use built-in data structures would make for a nice intro

Re: Preparing for the New DIP Process

2024-01-26 Thread Meta via Digitalmars-d-announce
On Thursday, 25 January 2024 at 15:03:41 UTC, Max Samukha wrote: On Monday, 22 January 2024 at 23:28:40 UTC, Jonathan M Davis wrote: Of course, ultimately, different programmers have different preferences, and none of us are going to be happy about everything in any language. It's not

Re: DIP 1043---Shortened Method Syntax---Accepted

2022-09-21 Thread Meta via Digitalmars-d-announce
On Wednesday, 21 September 2022 at 10:40:42 UTC, Mike Parker wrote: On Wednesday, 21 September 2022 at 10:39:27 UTC, Mike Parker wrote: DIP 1043, "Shortened Method Syntax", has been accepted. https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1043.md That's awesome! Congrats to

Re: A look inside "filter" function defintion

2022-08-09 Thread Meta via Digitalmars-d-learn
On Monday, 1 August 2022 at 23:35:13 UTC, pascal111 wrote: This is the definition of "filter" function, and I think it called itself within its definition. I'm guessing how it works? '''D template filter(alias predicate) if (is(typeof(unaryFun!predicate))) { /** Params: range =

Re: Fix template parameter

2022-08-09 Thread Meta via Digitalmars-d-learn
On Monday, 8 August 2022 at 12:02:02 UTC, Dom Disc wrote: Hello. I found in the documentation functions declared like this: ```D pure @nogc @safe BigInt opAssign(T : BigInt)(T x); ``` This is a template function, even if T is constrained to always be BigInt (it may also include anything that

Re: Release D 2.099.0

2022-03-09 Thread meta via Digitalmars-d-announce
On Wednesday, 9 March 2022 at 12:06:40 UTC, evilrat wrote: On Wednesday, 9 March 2022 at 10:08:50 UTC, meta wrote: On Wednesday, 9 March 2022 at 09:04:03 UTC, Martin Nowak wrote: Glad to announce D 2.099.0, ♥ to the 100 contributors. This release comes with __traits(parameters), unittests

Re: Release D 2.099.0

2022-03-09 Thread meta via Digitalmars-d-announce
On Wednesday, 9 March 2022 at 09:04:03 UTC, Martin Nowak wrote: Glad to announce D 2.099.0, ♥ to the 100 contributors. This release comes with __traits(parameters), unittests only from root modules, throw expressions, and plenty of more changes. http://dlang.org/download.html

Re: trash-d version 15

2022-03-08 Thread meta via Digitalmars-d-announce
On Tuesday, 8 March 2022 at 14:29:07 UTC, rushsteve1 wrote: Hello! I thought I would give an update on `trash-d`, the utility that I've been writing in D for the last several months. https://github.com/rushsteve1/trash-d Previous announcement thread:

Re: Colors in Raylib

2022-03-03 Thread meta via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 15:37:55 UTC, Ali Çehreli wrote: On 3/1/22 07:19, Mike Parker wrote: > On Tuesday, 1 March 2022 at 13:15:09 UTC, meta wrote: > >> >> enum Color >> { GRAY } >> >> void setColor(Color color); >> >> setColor(GRAY); > > Then that defeats the purpose of

Re: Colors in Raylib

2022-03-01 Thread meta via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 12:29:56 UTC, Steven Schveighoffer wrote: On 3/1/22 7:22 AM, meta wrote: If the type is ``Color`` I think the compiler should allow ``GRAY`` if it is a member of ``Color``, isn't how strong statically typed language should work? I wonder what is the rational

Re: Colors in Raylib

2022-03-01 Thread meta via Digitalmars-d-learn
If the type is ``Color`` I think the compiler should allow ``GRAY`` if it is a member of ``Color``, isn't how strong statically typed language should work? I wonder what is the rational against it? How hard would it be to allow it?

Re: D Language Foundation Monthly Meeting for February 2022

2022-02-28 Thread meta via Digitalmars-d-announce
On Sunday, 27 February 2022 at 11:53:18 UTC, Mike Parker wrote: ### Vladimir Vladimir opened with a progress report. Back in December, [we discussed migrating our Bugzilla issues to Github](https://forum.dlang.org/post/wnnwxyjtizvhyswwq...@forum.dlang.org). An alternative solution is to

Re: https://run.dlang.io/ vs All dmd compilers (2.060 - latest)

2022-02-27 Thread meta via Digitalmars-d-learn
Is the source of 'run.dlang.io' available somewhere?

Re: split Error - no overload matches

2022-02-15 Thread meta via Digitalmars-d-learn
A trick i use often: ```D import std; void main() { import uni = std.uni; writeln("Learning D is fun".split!(uni.isWhite)); } ``` Under-rated way of importing things, you don't bloat your scope anymore

Re: Added copy constructors to "Programming in D"

2022-02-10 Thread Meta via Digitalmars-d-announce
On Thursday, 10 February 2022 at 20:34:29 UTC, Walter Bright wrote: On 2/10/2022 12:06 AM, Mathias LANG wrote: I think an *immediate* improvement we could make to ease people's life is to make `auto` peel the outermost qualifier level inside functions. So that: ```D const int* ptr; auto p2 =

Re: Added copy constructors to "Programming in D"

2022-02-09 Thread Meta via Digitalmars-d-announce
Why do we even bother with `in` when we can do: alias In(T) = const scope T; void test(In!int n) { pragma(msg, typeof(n)); } ? onlineapp.d(3): Deprecation: storage class `scope` has no effect in type aliases const(int) ...oh

Re: What is the meaning of @future ?

2021-09-17 Thread Meta via Digitalmars-d-learn
On Friday, 17 September 2021 at 10:31:34 UTC, bauss wrote: On Thursday, 16 September 2021 at 20:53:34 UTC, Elmar wrote: Hello D community. I was browsing the `__traits` keywords and I found `isFuture` whose descriptions says something about `@future`-annotated variables.

Re: nothrow and std.exception.ifThrown

2021-04-30 Thread Meta via Digitalmars-d-learn
On Friday, 30 April 2021 at 13:42:49 UTC, Steven Schveighoffer wrote: On 4/30/21 9:24 AM, Meta wrote: My point is that I think marking the *function* nothrow is not correct, it's the second parameter that dictates the throwing of the result. And you can probably fix the second parameter to

Re: nothrow and std.exception.ifThrown

2021-04-30 Thread Meta via Digitalmars-d-learn
On Thursday, 29 April 2021 at 20:00:23 UTC, novice2 wrote: i dont understand why (templates too dificult for me yet), but if i comment "lazy" from T2, then compiler allow add "nothrow" to "ifThrown" ```d CommonType!(T1, T2) ifThrown(E : Throwable = Exception, T1, T2)(lazy scope T1 expression,

Re: nothrow and std.exception.ifThrown

2021-04-30 Thread Meta via Digitalmars-d-learn
On Friday, 30 April 2021 at 13:05:00 UTC, Steven Schveighoffer wrote: On 4/29/21 1:50 PM, Meta wrote: The reason for this, apparently, is in the definition of `ifThrown`: ``` CommonType!(T1, T2) ifThrown(E : Throwable = Exception, T1, T2)(lazy scope T1 expression, lazy scope T2

Re: nothrow and std.exception.ifThrown

2021-04-29 Thread Meta via Digitalmars-d-learn
On Thursday, 29 April 2021 at 16:02:20 UTC, novice2 wrote: Hello. I need use std.format.format() in nothrow function. format() can throw. For this case i have special default string. I don't want embrace format into try..catch block, and i found elegant std.exception.ifThrown. But DMD say

Re: Is there a more elegant way to do this in D?

2021-04-08 Thread Meta via Digitalmars-d-learn
On Thursday, 8 April 2021 at 18:01:56 UTC, Meta wrote: On Thursday, 8 April 2021 at 12:19:29 UTC, WebFreak001 wrote: ```d string to01String(int[] x) @safe { auto conv = x.to!(ubyte[]); // allocates new array, so later cast to string is OK conv[] += '0'; // assume all numbers are 0-9,

Re: Is there a more elegant way to do this in D?

2021-04-08 Thread Meta via Digitalmars-d-learn
On Thursday, 8 April 2021 at 12:19:29 UTC, WebFreak001 wrote: ```d string to01String(int[] x) @safe { auto conv = x.to!(ubyte[]); // allocates new array, so later cast to string is OK conv[] += '0'; // assume all numbers are 0-9, then this gives the correct result return (()

Re: Is this bug ? format %(%)

2021-04-07 Thread Meta via Digitalmars-d-learn
On Wednesday, 7 April 2021 at 17:31:09 UTC, Paul Backus wrote: On Wednesday, 7 April 2021 at 17:04:56 UTC, novice2 wrote: On Wednesday, 7 April 2021 at 13:43:18 UTC, Paul Backus wrote: So, you should change your code to writefln("%-(%s, %)", s); sorry i dont read docs so carefully

Re: Immutable

2021-03-27 Thread Meta via Digitalmars-d-learn
On Saturday, 27 March 2021 at 20:44:12 UTC, Brad wrote: I was looking through lots of sample code on Rosetta Code. D has a lot of solutions out there. That is really nice but it has me wondering - coming from other languages that do not support the concept of immutability - do real world

Re: Release D 2.096.0

2021-03-13 Thread Meta via Digitalmars-d-announce
On Sunday, 14 March 2021 at 05:31:27 UTC, Max Haughton wrote: On Sunday, 14 March 2021 at 03:25:28 UTC, starcanopy wrote: On Saturday, 13 March 2021 at 21:33:20 UTC, Meta wrote: It's pretty neat, but a DIP has to be drafted and approved for it to be enabled by default, right? (Unless I missed

Re: Release D 2.096.0

2021-03-13 Thread Meta via Digitalmars-d-announce
On Saturday, 13 March 2021 at 21:15:40 UTC, Martin Nowak wrote: Glad to announce D 2.096.0, ♥ to the 54 contributors. This release comes with improved ABI compatibility for complex types, clarified copy constructor and postblit interaction, optional libunwind based backtraces,

Re: Very confusing error message when calling a class method from an invariant

2021-03-09 Thread Meta via Digitalmars-d-learn
On Wednesday, 10 March 2021 at 04:57:19 UTC, Paul Backus wrote: On Wednesday, 10 March 2021 at 03:39:15 UTC, Meta wrote: class Human { static immutable MAX_AGE = 122; bool alive = true; int age = 0; //Error: mutable method onlineapp.Human.checkAge is not callable using a const

Very confusing error message when calling a class method from an invariant

2021-03-09 Thread Meta via Digitalmars-d-learn
class Human { static immutable MAX_AGE = 122; bool alive = true; int age = 0; //Error: mutable method onlineapp.Human.checkAge is not callable using a const object invariant(checkAge()); void growOlder() in(alive) out(; checkAge()) { age++;

Re: Bubel ECS - Entity-Component-System architecture implementation

2021-03-09 Thread Meta via Digitalmars-d-announce
On Tuesday, 9 March 2021 at 15:21:26 UTC, Mergul wrote: On Tuesday, 9 March 2021 at 14:29:37 UTC, Meta wrote: Awesome! In the demo, I noticed that if there are >3000 entities spawned, there will be periodic dips in the FPS. Could this be Javascript's GC kicking in? What browser are you

Re: Bubel ECS - Entity-Component-System architecture implementation

2021-03-09 Thread Meta via Digitalmars-d-announce
On Tuesday, 9 March 2021 at 16:36:31 UTC, ryuukk_ wrote: That's impressive, and shows the D capabilities, the future is WASM!!! glad to see D ready for it! Yes, I forgot to mention this, but WASM support out of the box is awesome!

Re: Bubel ECS - Entity-Component-System architecture implementation

2021-03-09 Thread Meta via Digitalmars-d-announce
On Monday, 8 March 2021 at 19:45:58 UTC, Mergul wrote: Hello everyone, I'm glad to announce release of my Bubel ECS library. Bubel ECS is Entity-Component-System architectural pattern implementation in D language. Library aims to delivery fast and flexible architecture for developing games.

Re: Beta 2.096.0

2021-02-28 Thread Meta 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: DIP 1034--Add a Bottom Type (reboot)--Formal Assessment Concluded

2021-02-16 Thread Meta via Digitalmars-d-announce
On Tuesday, 16 February 2021 at 07:07:09 UTC, Mike Parker wrote: When I emailed Walter and Atila to officially launch the Formal Assessment of DIP 1034, "Add a Bottom Type (reboot)", I expected it would be three or four weeks before I received their final decision. So I was surprised when

Re: Say Hello to Our Two New Pull-Request/Issue Managers

2021-01-13 Thread Meta via Digitalmars-d-announce
On Wednesday, 13 January 2021 at 11:33:44 UTC, Mike Parker wrote: I'm very, very happy that I can finally announce the news. Some of you may recall the job announcements I put out on the blog back in September [1]. Symmetry Investments offered to fund one full-time, or two part-time, Pull

Re: Our community seems to have grown, so many people are joining the Facebook group

2020-12-30 Thread Meta via Digitalmars-d-announce
On Monday, 28 December 2020 at 17:31:21 UTC, Murilo wrote: In the past 2 weeks we went from 225 to 240 members in our Facebook group(https://www.facebook.com/groups/ProgrammingInDlang), an average of a person per day. First it was an average of a person per month or less. I wonder if someone

Re: Release D 2.094.0

2020-10-01 Thread Meta via Digitalmars-d-announce
On Thursday, 1 October 2020 at 21:19:02 UTC, Seb wrote: On Thursday, 1 October 2020 at 21:09:55 UTC, Meta wrote: On Thursday, 1 October 2020 at 20:40:39 UTC, Seb wrote: [...] Okay, fair enough. Should this still not have had approval from either Walter or Atila before being merged in? Or is

Re: Release D 2.094.0

2020-10-01 Thread Meta via Digitalmars-d-announce
On Thursday, 1 October 2020 at 20:40:39 UTC, Seb wrote: On Thursday, 1 October 2020 at 18:29:14 UTC, Meta wrote: I've read the discussion but skipped the presentation. All I see is Atila expressing distaste for the compiler choosing how to pass values, and no explicit sign-off from either

Re: Release D 2.094.0

2020-10-01 Thread Meta via Digitalmars-d-announce
On Thursday, 1 October 2020 at 20:37:04 UTC, kinke wrote: On Thursday, 1 October 2020 at 18:29:14 UTC, Meta wrote: If W or A did approve it and I just wasn't aware, then I apologize and retract my objection. https://github.com/dlang/dmd/pull/11000#issuecomment-675605193 As far as I

Re: Release D 2.094.0

2020-10-01 Thread Meta via Digitalmars-d-announce
On Thursday, 1 October 2020 at 16:19:48 UTC, Steven Schveighoffer wrote: On 10/1/20 10:36 AM, Meta wrote: On Thursday, 1 October 2020 at 09:49:36 UTC, Mathias LANG wrote: Author here. The most complete way to know would be to read the changelog:

Re: Release D 2.094.0

2020-10-01 Thread Meta via Digitalmars-d-announce
On Thursday, 1 October 2020 at 09:49:36 UTC, Mathias LANG wrote: Author here. The most complete way to know would be to read the changelog: https://dlang.org/changelog/2.094.0.html#preview-in The TL;DR is that, in addition to `const scope`, `in` now automatically behaves as `ref` when "it makes

Re: opBinary : Static ifs or specialization?

2020-06-23 Thread Meta via Digitalmars-d-learn
On Tuesday, 23 June 2020 at 23:53:36 UTC, claptrap wrote: So you have opBinary and half a dozen operators to implement. Do you use a separate method for each operator or do you have one method and a big static if else if to select code path? I assume they are functionally equivalent? So its

Re: News on the D Blog: SAOC 2020 and More

2020-06-23 Thread Meta via Digitalmars-d-announce
On Tuesday, 23 June 2020 at 13:45:56 UTC, user1234 wrote: On Tuesday, 23 June 2020 at 12:00:30 UTC, Mike Parker wrote: On Tuesday, 23 June 2020 at 12:00:06 UTC, Mike Parker wrote: Symmetry Autumn of Code 2020 is on! My latest news post on the D Blog talks about that, some D Language Foundation

Re: Should a parser type be a struct or class?

2020-06-18 Thread Meta via Digitalmars-d-learn
On Wednesday, 17 June 2020 at 11:50:27 UTC, Per Nordlöw wrote: Should a range-compliant aggregate type realizing a parser be encoded as a struct or class? In dmd `Lexer` and `Parser` are both classes. In general how should I reason about whether an aggregate type should be encoded as a

Re: DIP 1028 "Make @safe the Default" is dead

2020-05-29 Thread Meta via Digitalmars-d-announce
On Friday, 29 May 2020 at 12:22:07 UTC, Steven Schveighoffer wrote: On 5/29/20 12:53 AM, Walter Bright wrote: The subject says it all. If you care about memory safety, I recommending adding `safe:` as the first line in all your project modules, and annotate individual functions otherwise as

Re: Retrieve the return type of the current function

2020-05-05 Thread Meta via Digitalmars-d-learn
On Tuesday, 5 May 2020 at 18:19:00 UTC, Meta wrote: mixin template magic() { alias CallerRet = typeof(return); CallerRet magic() { return CallerRet.init; } } Small edit: you can remove the "CallerRet" alias by doing the following: mixin template magic() {

Re: Retrieve the return type of the current function

2020-05-05 Thread Meta via Digitalmars-d-learn
On Tuesday, 5 May 2020 at 17:11:53 UTC, learner wrote: On Tuesday, 5 May 2020 at 16:41:06 UTC, Adam D. Ruppe wrote: typeof(return) Thank you, that was indeed easy! Is it possible to retrieve also the caller return type? Something like: ``` int foo() { return magic(); } auto

Re: Checked!({short, ushort, byte, char}, Throw): compilation fails

2020-04-16 Thread Meta via Digitalmars-d-learn
Unlike C/C++, char is not a numeric type in D; It's a UTF-8 code point: import std.traits; void main() { pragma(msg, isNumeric!char); //Prints false }

Re: Discord bot written in D

2020-04-07 Thread Meta via Digitalmars-d-learn
On Monday, 6 April 2020 at 21:23:22 UTC, Quantium wrote: Are there any libraries to creade a simple discord bot using D? And if you know these libraries, could you day me their pros and cons? I've used https://github.com/b1naryth1ef/dscord to build a Discord bot, a little over a year ago.

Re: Our HOPL IV submission has been accepted!

2020-02-28 Thread Meta via Digitalmars-d-announce
On Saturday, 29 February 2020 at 01:00:40 UTC, Andrei Alexandrescu wrote: Walter, Mike, and I are happy to announce that our paper submission "Origins of the D Programming Language" has been accepted at the HOPL IV (History of Programming Languages) conference.

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

2020-02-27 Thread Meta via Digitalmars-d-announce
On Thursday, 27 February 2020 at 18:07:19 UTC, Arine wrote: On Thursday, 27 February 2020 at 09:34:23 UTC, Walter Bright wrote: On 2/26/2020 7:41 AM, Arine wrote: Yah, what's unwanted about that? 1. unwanted extra string allocation 2. poor performance 3. doesn't work with printf 4. doesn't

Re: Blog post on calling C from Python via D

2020-02-26 Thread Meta via Digitalmars-d-announce
On Wednesday, 26 February 2020 at 17:11:18 UTC, bachmeier wrote: There needs to be a variant of "mansplaining" modified for Python users. Agreed, and there also needs to be a variant of prison, modified for people who post dumb comments on Hacker News.

Re: Release D 2.090.0

2020-01-08 Thread Meta via Digitalmars-d-announce
On Wednesday, 8 January 2020 at 21:58:29 UTC, H. S. Teoh wrote: On Wed, Jan 08, 2020 at 09:43:05PM +, Meta via Digitalmars-d-announce wrote: [...] Deprecated module std.experimental.all was removed All symbols contained in Phobos can now be used with import std Maybe I'm wrong

Re: Release D 2.090.0

2020-01-08 Thread Meta via Digitalmars-d-announce
On Tuesday, 7 January 2020 at 10:30:09 UTC, Martin Nowak wrote: Glad to announce D 2.090.0, ♥ to the 48 contributors. This release comes with the ability to convert lazy parameters to delegates, new intrinsics to force rounding to specific floating point precision, unittest builds that no

Re: `in` parameters optimization

2019-12-25 Thread Meta via Digitalmars-d-learn
On Wednesday, 25 December 2019 at 01:24:52 UTC, Adnan wrote: Does the compiler automatically pass values by reference if possible with `in` parameters in higher level of optimization flags? I would normally use `in ref` but sometimes it's not compatible with different types. No. "in" is

Re: Using map result type

2019-12-11 Thread Meta via Digitalmars-d-learn
On Wednesday, 11 December 2019 at 20:08:37 UTC, Meta wrote: import std.algorithm; import std.range; void mapAccepter(E)(InputRange!E r) { import std.array: array; import std.stdio: writeln; auto collected = r.array; writeln(collected); } void main() { int[] nums = [1, 2,

Re: Using map result type

2019-12-11 Thread Meta via Digitalmars-d-learn
On Sunday, 8 December 2019 at 01:10:21 UTC, AA wrote: I'd like to accept the return type of map. From some previous questions that I should accept a template? So for something like: ``` void mapAccepter(Range)(Range r) { import std.array : array; import std.stdio : writeln; auto

Re: Unexpectedly nice case of auto return type

2019-12-03 Thread Meta via Digitalmars-d-learn
On Tuesday, 3 December 2019 at 22:11:39 UTC, Meta wrote: On Tuesday, 3 December 2019 at 17:45:27 UTC, H. S. Teoh wrote: The thing is, `void` means "no return type" (or "no type" in some contexts), i.e., void == TBottom in that case. Not *quite* correct. void is not a bottom type; it's a unit

Re: Unexpectedly nice case of auto return type

2019-12-03 Thread Meta via Digitalmars-d-learn
On Tuesday, 3 December 2019 at 17:45:27 UTC, H. S. Teoh wrote: The thing is, `void` means "no return type" (or "no type" in some contexts), i.e., void == TBottom in that case. Not *quite* correct. void is not a bottom type; it's a unit type, meaning that it's a type with only 1 value (as is

Re: interfaces and contracts - new pattern

2019-12-03 Thread Meta via Digitalmars-d-announce
On Tuesday, 3 December 2019 at 17:10:04 UTC, Meta wrote: On Monday, 2 December 2019 at 20:30:49 UTC, Adam D. Ruppe wrote: In short use `in(false)` when you `override` a function to inherit the contract, unless you explicitly want to expand the input - which you shouldn't do when implementing

Re: interfaces and contracts - new pattern

2019-12-03 Thread Meta via Digitalmars-d-announce
On Monday, 2 December 2019 at 20:30:49 UTC, Adam D. Ruppe wrote: In short use `in(false)` when you `override` a function to inherit the contract, unless you explicitly want to expand the input - which you shouldn't do when implementing an interface! Wrote about it in more details here:

Re: Alternative to C++ macro in D

2019-11-03 Thread Meta via Digitalmars-d-learn
On Sunday, 3 November 2019 at 16:55:36 UTC, Vinod K Chandran wrote: Hi all, I can do this in C++. #include using namespace std ; #define end }; #define log(x) cout << x << endl #define wait std::cin.get() int main() { log("Trying to avoid the visual clutter aused by closing curly

Re: D code running on the Nintendo 3DS

2019-10-20 Thread Meta via Digitalmars-d-announce
On Sunday, 20 October 2019 at 06:06:48 UTC, TheGag96 wrote: Hi, all. I wanted to get into the world of 3DS homebrew, but I really didn't feel like coding in C or C++. So, through an effort of sheer will, I somehow got a hello world example written in D up and running, along with bindings for

Re: Átila's Vision of D's Future

2019-10-16 Thread Meta via Digitalmars-d-announce
On Wednesday, 16 October 2019 at 09:46:49 UTC, aliak wrote: It's better to link straight to an item on hackernews as links on the front page disappear very fast. https://news.ycombinator.com/item?id=21257943 Cheers, - Ali HN has this (IMO) ridiculous policy of going to great lengths to

Re: Blog Post: Beating std::visit Without Really Trying

2019-10-04 Thread Meta via Digitalmars-d-announce
On Saturday, 5 October 2019 at 02:59:58 UTC, Paul Backus wrote: I was curious how C++17's std::variant compared to the options we have in D, like Algebraic and SumType, so I did a simple comparison of the generated assembly for each of them. You can read about it at the link below. And as you

Re: SAOC Experience Report: Porting a fork-based GC

2019-07-22 Thread Meta via Digitalmars-d-announce
On Monday, 22 July 2019 at 14:03:15 UTC, Mike Parker wrote: Francesco Mecca ha written an experience report for the D Blog about his SAOC 2018 project, porting Leandro Lucarella's old GC from D1 to D2. The blog: https://dlang.org/blog/wp-admin/post.php?post=2148=edit Reddit: >

Re: UPB D Summer School

2019-07-17 Thread Meta via Digitalmars-d-announce
On Wednesday, 17 July 2019 at 13:56:38 UTC, RazvanN wrote: Hello, Edi and myself are glad to announce that the first edition of the D Summer School that we organized for the students at the University Politehnica of Bucharest has just ended. We had 8 practical sessions and a hackathon,

Re: Elegant way to test if members of array A are present in array B?

2019-06-12 Thread Meta via Digitalmars-d-learn
On Tuesday, 11 June 2019 at 17:12:17 UTC, Robert M. Münch wrote: Is there a simple and elegant way to do this? Or is just using a foreach(...) with canFind() the best way? There are two versions of find that can find a range within another:

Re: nogc v0.5.0 - DIP1008 works!

2019-05-24 Thread Meta via Digitalmars-d-announce
On Friday, 24 May 2019 at 16:51:11 UTC, ag0aep6g wrote: On 24.05.19 18:19, Atila Neves wrote: On Friday, 24 May 2019 at 13:30:05 UTC, ag0aep6g wrote: [...] My `puts`s might not do any harm, but they could just as well be buffer overflows. Could you please give an example of how @system

Re: Phobos is now compiled with -preview=dip1000

2019-05-17 Thread Meta via Digitalmars-d-announce
On Friday, 17 May 2019 at 21:57:51 UTC, Meta wrote: I see what you're getting at. The compiler sees a slice type (i.e., Data[]), knows that it's GC-backed and thus has infinite lifetime, and concludes "the data you're trying to put in the store has too long of a lifetime". Should be "too

Re: Phobos is now compiled with -preview=dip1000

2019-05-17 Thread Meta via Digitalmars-d-announce
On Friday, 17 May 2019 at 18:45:12 UTC, Jonathan M Davis wrote: On Friday, May 17, 2019 11:25:40 AM MDT Meta via Digitalmars-d-announce wrote: I don't want to *restrict* the lifetime of a heap allocation. I want the compiler to recognize that the lifetime of my original data is the same

Re: Phobos is now compiled with -preview=dip1000

2019-05-17 Thread Meta via Digitalmars-d-announce
On Friday, 17 May 2019 at 20:59:43 UTC, Mike Franklin wrote: On Friday, 17 May 2019 at 17:03:51 UTC, Meta wrote: If you look at `main` above, `rawData` has the same lifetime as the `dataRange` struct returned from `makeDataRange` and the queue returned from `copyToQueue`. True, there is some

Re: Phobos is now compiled with -preview=dip1000

2019-05-17 Thread Meta via Digitalmars-d-announce
On Friday, 17 May 2019 at 05:27:02 UTC, Walter Bright wrote: On 5/16/2019 9:50 PM, Meta wrote: Walter, can I get you to take a look at this post I made a few months ago, and the contained example? I feel that this is a case that *should* definitely work, but I'm not sure if it can *currently*

Re: Phobos is now compiled with -preview=dip1000

2019-05-17 Thread Meta via Digitalmars-d-announce
On Friday, 17 May 2019 at 17:05:21 UTC, ag0aep6g wrote: On 17.05.19 14:10, Meta wrote: Your explanation was fine, but I need a good solution, other than wrapping the array assignment in @trusted. I see. As far as I understand DIP 1000, it's not supposed to enable your use case without having

Re: Phobos is now compiled with -preview=dip1000

2019-05-17 Thread Meta via Digitalmars-d-announce
On Friday, 17 May 2019 at 05:32:42 UTC, Mike Franklin wrote: On Friday, 17 May 2019 at 05:22:30 UTC, Mike Franklin wrote: My assessment (which could be wrong): `scope` and `return` only apply to pointers and `ref`s. If you remove all `scope` and `return` attributes from the function `push`,

Re: Phobos is now compiled with -preview=dip1000

2019-05-17 Thread Meta via Digitalmars-d-announce
On Friday, 17 May 2019 at 05:22:31 UTC, ag0aep6g wrote: On 17.05.19 06:50, Meta wrote: Walter, can I get you to take a look at this post I made a few months ago, and the contained example? I feel that this is a case that *should* definitely work, but I'm not sure if it can *currently* work -

Re: Phobos is now compiled with -preview=dip1000

2019-05-16 Thread Meta via Digitalmars-d-announce
On Wednesday, 15 May 2019 at 08:32:09 UTC, Walter Bright wrote: On 5/15/2019 12:21 AM, Dukc wrote: Could be worth a try even without docs, but in the long run we definitely need some explaining. True, but I've tried fairly hard with the error messages. Please post your experiences with them.

Re: DMD metaprogramming enhancement

2019-04-27 Thread Meta via Digitalmars-d-announce
On Friday, 26 April 2019 at 06:34:26 UTC, Simen Kjærås wrote: BTW, at least two people have promised money outside BountySource to have 5710 fixed: https://forum.dlang.org/post/gjzrklkxfmgjjdfor...@forum.dlang.org -- Simen And my offer still stands. Suleyman, do you have an email address

Re: How to debug long-lived D program memory usage?

2019-04-17 Thread Meta via Digitalmars-d-learn
On Wednesday, 17 April 2019 at 22:37:38 UTC, Adam D. Ruppe wrote: On Wednesday, 17 April 2019 at 19:07:46 UTC, Jacob Carlborg wrote: Perhaps try some of these flags [1] and [2]. oooh, those are very interesting too. What I was kinda hoping is it would have stats for which file and line of

Re: Phobos now compiling with -dip1000

2019-03-23 Thread Meta via Digitalmars-d-announce
On Saturday, 23 March 2019 at 05:04:58 UTC, H. S. Teoh wrote: Also, does it only apply to @safe code, so that I have to start annotating stuff with @safe in order to benefit from it? T As per the DIP and from my experience, yes.

Re: Block statements and memory management

2019-03-16 Thread Meta via Digitalmars-d-learn
On Saturday, 16 March 2019 at 03:47:43 UTC, Murilo wrote: Does anyone know if when I create a variable inside a scope as in {int a = 10;} it disappears complete from the memory when the scope finishes? Or does it remain in some part of the memory? I am thinking of using scopes to make

Re: Containerize Your D Server Application

2019-03-15 Thread Meta via Digitalmars-d-announce
On Friday, 15 March 2019 at 04:43:21 UTC, Nick Sabalausky (Abscissa) wrote: On 3/14/19 8:38 AM, Mike Parker wrote: One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I ever do get around

Re: Containerize Your D Server Application

2019-03-14 Thread Meta via Digitalmars-d-announce
On Thursday, 14 March 2019 at 18:02:31 UTC, Arun Chandrasekaran wrote: On Thursday, 14 March 2019 at 12:38:30 UTC, Mike Parker wrote: One of the items on my list of "things I'd like to do if I only had the time" is to create a Mud server with D and deploy it with Docker. Just for kicks. If I

Re: Query for -dip1000

2019-02-11 Thread Meta via Digitalmars-d-learn
On Sunday, 10 February 2019 at 20:04:29 UTC, Per Nordlöw wrote: Is there a way to query if the -dip1000 flag has been passed to the compiler? I need it for enabling certain DIP-1000 escape analysis tests only when -dip1000 has been passed. For instance static assert(!__traits(compiles, {

Re: Implement Interface Using Super

2019-01-29 Thread Meta via Digitalmars-d-learn
On Wednesday, 30 January 2019 at 01:02:37 UTC, Jonathan M Davis wrote: Yeah. It would be like trying to do something like alias x = this.x; As it stands, I believe that super is always either used as a function call to the constructor or to mean the this pointer for the base class. I don't

Re: Implement Interface Using Super

2019-01-28 Thread Meta via Digitalmars-d-learn
On Monday, 28 January 2019 at 22:17:56 UTC, Steven Schveighoffer wrote: On 1/28/19 3:28 PM, Jonathan Levi wrote: On Sunday, 27 January 2019 at 09:31:46 UTC, bauss wrote: On Sunday, 27 January 2019 at 05:37:57 UTC, Jonathan Levi wrote: This works in LDC *but not* DMD? . . . Is this a bug in

Re: New Fundraiser: D Forums Server

2019-01-25 Thread Meta via Digitalmars-d-announce
On Friday, 25 January 2019 at 19:14:31 UTC, Mike Parker wrote: On Friday, 25 January 2019 at 19:11:59 UTC, Mike Parker wrote: Flipcause donors are not American. Did you have trouble? If so, you can go to the donation page and use the PayPal link. Sorry:

Re: D-lighted, I'm Sure

2019-01-21 Thread Meta via Digitalmars-d-announce
On Saturday, 19 January 2019 at 22:09:57 UTC, Ron Tarrant wrote: On Friday, 18 January 2019 at 19:55:34 UTC, Meta wrote: Great read Ron. Can I ask which town in Newfoundland it was where you stayed back in 1985? Sure. I was in St. Lawrence on the Burin Peninsula. Do you know it?

Re: D-lighted, I'm Sure

2019-01-18 Thread Meta via Digitalmars-d-announce
On Friday, 18 January 2019 at 16:42:15 UTC, Ron Tarrant wrote: Just to set the record straight, I only had access to that Coleco Adam for the few weeks I was in that Newfoundland outport. Within a year, I too had my very own C-64 plugged into a monster Zenith console job. Remember those? I

Re: Top Five World’s Most Underrated Programming Languages

2019-01-17 Thread Meta via Digitalmars-d-announce
On Friday, 18 January 2019 at 01:15:06 UTC, Bill Baxter wrote: Gotta laugh at Ruby being listed as "Underrated", though. --bb On Mon, Jan 14, 2019 at 12:25 PM Andrei Alexandrescu via Digitalmars-d-announce wrote: Of possible interest:

Re: B Revzin - if const expr isn't broken (was Re: My Meeting C++ Keynote video is now available)

2019-01-16 Thread Meta via Digitalmars-d-announce
On Thursday, 17 January 2019 at 01:59:29 UTC, Walter Bright wrote: Bartosz Milewski is a C++ programmer and a Haskell fan. He once gave a presentation at NWCPP where he wrote a few lines of Haskell code. Then, he showed the same code written using C++ template metaprogramming. The Haskell

Re: The New Fundraising Campaign

2019-01-04 Thread Meta via Digitalmars-d-announce
On Friday, 4 January 2019 at 16:21:16 UTC, Mike Parker wrote: On Friday, 4 January 2019 at 15:43:41 UTC, Meta wrote: Awesome; funding goal reached in a little less than 2 months. I didn't even get around to donating yet, so maybe I'll save it for the next one instead. On a related note, D

Re: The New Fundraising Campaign

2019-01-04 Thread Meta via Digitalmars-d-announce
On Friday, 4 January 2019 at 10:30:07 UTC, Martin Tschierschke wrote: On Saturday, 10 November 2018 at 16:09:12 UTC, Mike Parker wrote: [...] Please read the blog post for more details: https://dlang.org/blog/2018/11/10/the-new-fundraising-campaign/

Re: Blog post: What D got wrong

2018-12-11 Thread Meta via Digitalmars-d-announce
On Tuesday, 11 December 2018 at 20:44:28 UTC, Dukc wrote: On Tuesday, 11 December 2018 at 15:34:28 UTC, Simen Kjærås wrote: I believe a reasonable case can be made for .! for UFCS - it's currently invalid syntax and will not compile, and ! is the symbol we already associate with template

Re: Blog post: What D got wrong

2018-12-11 Thread Meta via Digitalmars-d-announce
On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote: A few things that have annoyed me about writing D lately: https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/ Template lambdas and better eponymous template syntax are the two big ones that I would really like.

Re: Copy Constructor DIP and implementation

2018-09-24 Thread Meta via Digitalmars-d-announce
On Sunday, 23 September 2018 at 01:08:50 UTC, Jonathan M Davis wrote: @implicit is just there because of the fear of breaking a theoretical piece of code that's going to be extremely rare if it exists at all and in most cases would continue to work just fine even if it did exist. - Jonathan

Re: Rather D1 then D2

2018-09-24 Thread Meta via Digitalmars-d
On Monday, 24 September 2018 at 09:19:34 UTC, Chris wrote: On Sunday, 23 September 2018 at 02:05:42 UTC, Jonathan M Davis wrote: With regards to D1 users who are unhappy with D2, I think that it makes some sense to point out that a subset of D2 can be used in a way that's a lot like D1,

Re: Copy Constructor DIP and implementation

2018-09-17 Thread Meta via Digitalmars-d-announce
On Tuesday, 11 September 2018 at 15:08:33 UTC, RazvanN wrote: Hello everyone, I have finished writing the last details of the copy constructor DIP[1] and also I have published the first implementation [2]. As I wrongfully made a PR for the DIP queue in the early stages of the development of

Re: John Regehr on "Use of Assertions"

2018-09-10 Thread Meta via Digitalmars-d
On Monday, 10 September 2018 at 20:25:21 UTC, Jonathan M Davis wrote: I propose: - 'assume': aborts on false condition in debug builds, not checked in release builds, used as optimizer hint; - 'insist': aborts on false condition in debug builds, aborts on false condition in release

  1   2   3   4   5   6   7   8   9   10   >