Re: Property-based testing

2017-01-16 Thread Mark via Digitalmars-d
On Monday, 16 January 2017 at 14:15:16 UTC, Russel Winder wrote: Is anyone out there doing a property-based testing framework for D? There have been several attempts to implement such a framework, e.g. [1]. If you run a search for "quickcheck" in the forums, you'll probably find them all.

Re: Default implementation of opEquals

2016-10-07 Thread Mark via Digitalmars-d
On Friday, 7 October 2016 at 12:34:34 UTC, Adam D. Ruppe wrote: On Friday, 7 October 2016 at 12:04:09 UTC, Mark wrote: "If opEquals is not specified, the compiler provides a default version that does member-wise comparison" That's referring to structs. For classes, it gives an identity

Re: Default implementation of opEquals

2016-10-07 Thread Mark via Digitalmars-d
On Friday, 7 October 2016 at 14:04:10 UTC, Jonathan M Davis wrote: On Friday, October 07, 2016 13:41:00 Mark via Digitalmars-d wrote: [...] It's the plan anyway. It fundamentally doesn't work to have them on Object and be flexible with attributes, so it was decided a while ago

Default implementation of opEquals

2016-10-07 Thread Mark via Digitalmars-d
I'm going over the Object class methods and I have a few concerns about the opEquals method. First, what should be the default implementation of opEquals? The specification (see https://dlang.org/spec/operatoroverloading.html#eqcmp) reads: "If opEquals is not specified, the compiler

Re: [OT] Brokerage for the D Language Foundation

2016-09-18 Thread Mark via Digitalmars-d
On Saturday, 17 September 2016 at 14:22:03 UTC, Andrei Alexandrescu wrote: The Foundation's cash os currently sitting in a checking account at Bank of America. I've googled for things like "brokerage accounts for non-profit" and figured that most or all deep discount brokers (Fidelity,

Re: [OT] Brokerage for the D Language Foundation

2016-09-18 Thread Mark via Digitalmars-d
I think it would be best to speak to people from other non-profit organizations (preferably ones that are very similar, at least in spirit, to the D Language Foundation) about their experience with such matters. Even if the Foundation currently has no more cash than a typical (or not so

Re: [OT] Brokerage for the D Language Foundation

2016-09-25 Thread Mark via Digitalmars-d
On Wednesday, 21 September 2016 at 13:47:38 UTC, Andrea Fontana wrote: On Sunday, 18 September 2016 at 11:16:47 UTC, Mark wrote: [...] I think you can make 1-2% a year without taking a lot of risk, e.g. by investing in investment-grade corporate bonds with short maturity. [...] Or buying

Re: Linus' idea of "good taste" code

2016-10-26 Thread Mark via Digitalmars-d
On Tuesday, 25 October 2016 at 22:53:54 UTC, Walter Bright wrote: It's a small bit, but the idea here is to eliminate if conditionals where possible: https://medium.com/@bartobri/applying-the-linus-tarvolds-good-taste-coding-requirement-99749f37684a#.nhth1eo4e What would you say is the best

Re: Pattern matching in D?

2016-10-21 Thread Mark via Digitalmars-d
On Friday, 21 October 2016 at 06:50:26 UTC, Dennis Ritchie wrote: Previously, there were ideas on the implementation of macros in D, but now they are no longer relevant: http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf AST macros are permanently off the table?

Re: Why are homepage examples too complicated?

2016-10-21 Thread Mark via Digitalmars-d
On Friday, 21 October 2016 at 10:24:40 UTC, Chris wrote: On Thursday, 20 October 2016 at 21:52:09 UTC, Andrei Alexandrescu wrote: On 10/20/2016 04:16 PM, Karabuta wrote: We can't assume all beginners come from imperative languages. D beginners may come from languages where the idiomatic

Re: Linus' idea of "good taste" code

2016-10-26 Thread Mark via Digitalmars-d
On Tuesday, 25 October 2016 at 22:53:54 UTC, Walter Bright wrote: It's a small bit, but the idea here is to eliminate if conditionals where possible: https://medium.com/@bartobri/applying-the-linus-tarvolds-good-taste-coding-requirement-99749f37684a#.nhth1eo4e This is something we could all

Re: Any relation?

2016-10-13 Thread Mark via Digitalmars-d
On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei Alas, it seems that they're using Swift. :(

Re: Databases and the D Standard Library

2017-01-01 Thread Mark via Digitalmars-d
On Sunday, 1 January 2017 at 03:24:31 UTC, Adam Wilson wrote: 2. There are so many different types of data storage systems, how do you design a system generic enough for all of them? My answer: You don't. Nobody else has bothered trying, and I believe that our worry over that question is a

Re: D future ...

2016-12-21 Thread Mark via Digitalmars-d
On Tuesday, 20 December 2016 at 16:22:43 UTC, Walter Bright wrote: D is quite a bit less formal, but still, if you want action consider that you aren't going to get it with any organization unless you're willing to: 1. pay others to do it 2. convince others that your important issues are

Re: ycombinator"In my Christmas wishlist is a language ..."

2016-12-19 Thread Mark via Digitalmars-d
On Monday, 19 December 2016 at 18:38:32 UTC, Ilya Yaroshenko wrote: Mir can be translated as "Peace". Cooperation with other languages through betterC API is more productive than universality/feature wars :-) And here I thought it was named after the space station. =)

Re: Is there a cleaner way of doing this?

2017-08-12 Thread Mark via Digitalmars-d
On Monday, 7 August 2017 at 08:01:26 UTC, Shachar Shemesh wrote: The problem is what happens when the param is optional. The common way to do this is to set T to void. This results in the following code: struct S(T) { enum HasParam = !is(T == void); static if( HasParam ) {

Re: Is there a cleaner way of doing this?

2017-08-12 Thread Mark via Digitalmars-d
On Saturday, 12 August 2017 at 15:02:34 UTC, Mark wrote: I was going to suggest using Algebraic/Variant, as in: void initialize(Algebraic!(int,void)) { This should read: void initialize(Algebraic!(int,void) param) {

Re: Types: The Next Generation (Was: Why is phobos so wack?)

2017-07-15 Thread Mark via Digitalmars-d
On Sunday, 9 July 2017 at 20:22:16 UTC, Nick Sabalausky (Abscissa) wrote: So, why not encapsulate much of that stuff we merely *describe* in signatures for generic functions into genuine honest-to-goodness types? There would be user-defined symbols, such as "InputRange" or "SomeString", or

Re: D easily overlooked?

2017-07-15 Thread Mark via Digitalmars-d
On Friday, 14 July 2017 at 08:57:17 UTC, Wulfklaue wrote: https://blog.sourced.tech/post/language_migrations/ A recent article where github programming languages popularity and migration got analysed was very interesting but it showed one noticeable thing: A total lack of D even

Re: D easily overlooked?

2017-07-15 Thread Mark via Digitalmars-d
On Saturday, 15 July 2017 at 17:10:56 UTC, Joakim wrote: To answer Mark's original question, the corporates get interested when there are competitors eating their lunch with new tech. They don't actively scout out all the new tech, they're far too lazy for that. But when Sociomantic or Weka

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-28 Thread Mark via Digitalmars-d
On Tuesday, 27 June 2017 at 23:17:15 UTC, Moritz Maxeiner wrote: Considering that code is read a lot more than written those two are *critically* important. What more do you expect? It could eventually be optimized to inject the in contract check at the caller's side (before entering the

Re: [WIP] A Big O notation and algebra for D

2017-06-30 Thread Mark via Digitalmars-d
On Sunday, 18 December 2016 at 18:26:27 UTC, Andrei Alexandrescu wrote: Article: http://erdani.com/d/bigo.html (do not publish; should do it with Mike) Code (preliminary): https://github.com/dlang/phobos/pull/4965 Andrei Was this project abandoned? It's no longer in std/experimental.

Re: [WIP] A Big O notation and algebra for D

2017-06-30 Thread Mark via Digitalmars-d
On Friday, 30 June 2017 at 16:28:18 UTC, Andrei Alexandrescu wrote: On 06/30/2017 12:01 PM, Mark wrote: On Sunday, 18 December 2016 at 18:26:27 UTC, Andrei Alexandrescu wrote: Article: http://erdani.com/d/bigo.html (do not publish; should do it with Mike) Code (preliminary):

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-30 Thread Mark via Digitalmars-d
On Thursday, 29 June 2017 at 01:37:17 UTC, H. S. Teoh wrote: (1) DbC contracts pertain to *runtime* argument values, so while checking for simple cases at compile-time is nice, it isn't really in the charter of (D's implementation of) DbC. T That's a good point. I guess UDAs combined with

Re: Graph rendering on dlang.org

2017-07-02 Thread Mark via Digitalmars-d
On Saturday, 1 July 2017 at 20:53:07 UTC, Cym13 wrote: On Saturday, 1 July 2017 at 19:19:09 UTC, Jonathan Marler wrote: On Friday, 30 June 2017 at 21:40:05 UTC, Andrei Alexandrescu wrote: [...] There's also mermaid. They have a live editor here: https://knsv.github.io/mermaid/live_editor/

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-27 Thread Mark via Digitalmars-d
On Tuesday, 20 June 2017 at 11:57:55 UTC, Mike Parker wrote: DIP 1009 is titled "Improve Contract Usability". [...] Veering a bit off topic,the compiler doesn't treat contracts any different from other code, does it? For instance, consider: int foo() out(result; result>0) { // whatever }

Re: [OT] Generative C++

2017-08-06 Thread Mark via Digitalmars-d
On Friday, 28 July 2017 at 07:49:02 UTC, Yuxuan Shui wrote: Someone made an interesting proposal to C++: https://herbsutter.files.wordpress.com/2017/07/p0707r1.pdf Thoughts? Won't this abstraction compete directly with concepts (lite) and even with templates? Metaclasses appear to be at

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-24 Thread Mark via Digitalmars-d
On Saturday, 24 June 2017 at 02:31:09 UTC, Solomon E wrote: I think my proposal to add another use of semicolon in parentheses, like `foreach` or `for` but not the same as either, was needlessly complicated. in (a) out (result) (a) as syntax sugar where each (a) lowers to {assert(a);} and in

Re: D Language Front-End Proposed For GCC 8, 800k Lines of Code

2017-06-17 Thread Mark via Digitalmars-d
On Sunday, 28 May 2017 at 19:23:04 UTC, Nordlöw wrote: Does this, perchance, deserve a post in "Announce"? :) http://www.phoronix.com/scan.php?page=news_item=D-Frontend-For-GCC 800k lines of code! Wow. Is this also how big the DMD frontend is?

Re: Ali's slides from his C++Now talk

2017-06-17 Thread Mark via Digitalmars-d
On Tuesday, 23 May 2017 at 23:31:48 UTC, Joakim wrote: Enjoying going through these: http://ddili.org/AliCehreli_CppNow_2017_Competitive_Advantage_with_D.no_pause.pdf Ali really has a gift for explaining stuff, we're lucky to have him. Yes, the slides are great. And I think "compilable

Re: D needs to get its shit together!

2017-06-17 Thread Mark via Digitalmars-d
On Friday, 16 June 2017 at 13:14:46 UTC, Moritz Maxeiner wrote: If you are interested in donations, there is such infrastructure, it's called the D Foundation. I imagine that it's not possible to make donations to the foundation that are restricted for the use of advancing a specific aspect

Re: D needs to get its shit together!

2017-06-17 Thread Mark via Digitalmars-d
On Saturday, 17 June 2017 at 23:14:24 UTC, Moritz Maxeiner wrote: IANAL, but if you tie a monetary exchange to a specific service, it's not a donation, but payment for services (to be) rendered. Good point. People who work on/with something in their free time for their own purposes are

Re: There really needs to be some moderation

2017-06-18 Thread Mark via Digitalmars-d
On Sunday, 18 June 2017 at 20:04:48 UTC, Joakim wrote: Also, a lot of this polish is missing because D is an OSS project that doesn't have corporate involvement driving it. No pure OSS project without heavy corporate involvement has ever gotten everywhere, you will find corporate hands all

Re: What is the Philosophy of D?

2017-10-16 Thread Mark via Digitalmars-d
On Monday, 16 October 2017 at 00:25:32 UTC, codephantom wrote: D's overview page says "It doesn't come with an overriding philosophy." Is philosophy not important? I'd like to argue, that the problem of focusing on getting the job done quickly and reliably, does *not* leave behind

Re: DIP 1009--Improve Contract Usability--Formal Review

2017-08-30 Thread Mark via Digitalmars-d
On Wednesday, 30 August 2017 at 14:57:38 UTC, Moritz Maxeiner wrote: On Wednesday, 30 August 2017 at 14:05:40 UTC, Mark wrote: [...] int abs(int x) out(_ >= 0) { return x>0 ? x : -x; } The ambiguity issue of having two results in one scope [1] applies. [1]

Re: C++ / Why Iterators Got It All Wrong

2017-09-05 Thread Mark via Digitalmars-d
On Saturday, 2 September 2017 at 20:22:44 UTC, Robert M. Münch wrote: Iterators are not the silver bullet. But IIRC you can specify if you want to iterate over a graph BF or DF. If you just need to "iterate" over the elements things work pretty good IMO. If you want to select a sub-set and

Re: Should we add `a * b` for vectors?

2017-09-24 Thread Mark via Digitalmars-d
On Friday, 22 September 2017 at 17:11:56 UTC, Ilya Yaroshenko wrote: Should we add `a * b` to ndslice for 1d vectors? Discussion at https://github.com/libmir/mir-algorithm/issues/91 Generally I expect that a binary operation denoted by + or * would produce an element from the original domain,

Re: Community Rant

2017-08-24 Thread Mark via Digitalmars-d
On Wednesday, 23 August 2017 at 23:27:22 UTC, Brad Roberts wrote: On 8/23/2017 3:58 PM, Mark via Digitalmars-d wrote: This kind of criticism comes up fairly often in the forums, maybe once every few weeks. I can link to the recent threads on the matter, but I'm sure you can make

Re: Community Rant

2017-08-23 Thread Mark via Digitalmars-d
On Tuesday, 22 August 2017 at 15:14:33 UTC, Jonathan Shamir wrote: [...] But lets be honest. If I was just interested to learn about this "modern system programming language" that is C++ done right, I would dismiss D very quickly. We need to get together as a community and rethink your

Re: C++ / Why Iterators Got It All Wrong

2017-09-04 Thread Mark via Digitalmars-d
On Sunday, 3 September 2017 at 12:46:05 UTC, Moritz Maxeiner wrote: I agree, though I was talking about what the abstract data type of a "series" is, i.e. what operations is exposes. From my observation: A D input range exposes via empty/front/popFront. A classic iterator exposes via

Re: C++ / Why Iterators Got It All Wrong

2017-09-01 Thread Mark via Digitalmars-d
On Tuesday, 29 August 2017 at 12:50:08 UTC, Robert M. Münch wrote: Maybe of interest: https://www.think-cell.com/en/career/talks/iterators/#1 I haven't read everything, so not sure if it worth to take a look. Iterators have many problems. Andrei's talk some years ago, titled "Iterators

Re: DIP 1009--Improve Contract Usability--Formal Review

2017-08-30 Thread Mark via Digitalmars-d
On Wednesday, 30 August 2017 at 12:26:43 UTC, Mike Parker wrote: The first stage of the formal review for DIP 1009 [1], "Improve Contract Syntax", is now underway. From now until 11:59 PM ET on September 13 (3:59 AM GMT on September 14), the community has the opportunity to provide last-minute

Re: My first experience as a D Newbie

2017-10-20 Thread Mark via Digitalmars-d
On Thursday, 19 October 2017 at 21:18:43 UTC, Rion wrote: D has a bad track record with implementations of proposals, even when the actual code has been written. There has always been a standard: Walter writes it, its going to get accepted with a high ratio in one form or another. Somebody who

Re: My two cents

2017-10-21 Thread Mark via Digitalmars-d
On Wednesday, 18 October 2017 at 08:56:21 UTC, Satoshi wrote: Hi, I had been using D for almost 6 years and I want to share my opinion with you. I don't want to blame anyone but I'll focus more on bad things and possible improvements. And this is just how I see D from my perspective. (Sorry

Re: My first experience as a D Newbie

2017-10-21 Thread Mark via Digitalmars-d
On Saturday, 21 October 2017 at 01:45:40 UTC, codephantom wrote: The real challenge (and ultimate goal) for any open-source project (especially a volunteer based one), is finding equilibria. Honestly, I do not believe that an open-source project, beyond a certain scale, can sustain itself

Re: Project Elvis

2017-10-31 Thread Mark via Digitalmars-d
On Saturday, 28 October 2017 at 11:38:52 UTC, Andrei Alexandrescu wrote: Walter and I decided to kick-off project Elvis for adding the homonym operator to D. [...] Thanks, Andrei The Elvis operator's purpose is to make working with null easier, but isn't null "The Billion Dollar Mistake"?

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-03 Thread Mark via Digitalmars-d
On Friday, 3 November 2017 at 02:32:41 UTC, Jonathan M Davis wrote: Pretty much the only case where out contracts work well is when you have a very specific, testable condition that all results must have and which does not depend on the input, and most functions simply don't work that way. -

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Mark via Digitalmars-d
On Saturday, 4 November 2017 at 06:08:22 UTC, Jonathan M Davis wrote: And even if you did have access to the input, some functions consume their input without any way to save it (e.g. an input range that isn't a forward range) [...] - Jonathan M Davis True. I had (strongly) pure functions

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Mark via Digitalmars-d
On Saturday, 4 November 2017 at 15:38:42 UTC, Jonathan M Davis wrote: On Saturday, November 04, 2017 15:27:39 Ola Fosheim Grøstad via Digitalmars- d wrote: On Saturday, 4 November 2017 at 14:12:08 UTC, Adam D. Ruppe wrote: > On Saturday, 4 November 2017 at 13:59:39 UTC, Jonathan M > Davis > >

Re: Project Elvis

2017-11-01 Thread Mark via Digitalmars-d
On Tuesday, 31 October 2017 at 19:39:17 UTC, bauss wrote: On Tuesday, 31 October 2017 at 08:15:24 UTC, Mark wrote: On Saturday, 28 October 2017 at 11:38:52 UTC, Andrei Alexandrescu wrote: Walter and I decided to kick-off project Elvis for adding the homonym operator to D. [...] Thanks,

Re: On "A New Collections Framework for the Standard Library"

2017-11-13 Thread Mark via Digitalmars-d
On Thursday, 18 May 2017 at 18:27:22 UTC, Andrei Alexandrescu wrote: On 05/18/2017 11:18 AM, Jack Stouffer wrote: I just got around to watching Eduard Staniloiu's talk at DConf [1] about the collections library he was working on. One thing seemed odd, in that Eduard seems to be saying that the

Re: Zig mentions D in justifying its existence

2017-11-14 Thread Mark via Digitalmars-d
On Tuesday, 14 November 2017 at 01:01:16 UTC, codephantom wrote: On Monday, 13 November 2017 at 16:12:42 UTC, Joakim wrote: Probably a good sign that they mention D with C++ and Rust and have looked at D features: An interesting project. Some good points made too. As someone new to D, I

Re: Introducing Nullable Reference Types in C#. Is there hope for D, too?

2017-11-20 Thread Mark via Digitalmars-d
On Monday, 20 November 2017 at 22:56:44 UTC, Walter Bright wrote: On 11/20/2017 3:27 AM, Timon Gehr wrote: On 20.11.2017 11:07, Atila Neves wrote: The problem with null as seen in C++/Java/D is that it's a magical value that different types may have. It breaks the type system. In Java,

Can anybody install DDT on Eclipse Neon or Mars?

2016-06-18 Thread Mark via Digitalmars-d-learn
I've spent may hours trying to do this in OSX. Everything goes fine from the marketplace window...until I restart Eclipse and find no files have been added? Any words of consolation or advice will be greatly appreciated. Desperately, Mark

Re: Testing in the D Standard Library

2017-01-22 Thread Mark via Digitalmars-d-announce
On Friday, 20 January 2017 at 13:35:40 UTC, Mike Parker wrote: Jack Stouffer details how unit testing, code review, and code coverage are handled in the development and maintenance of Phobos. Thanks, Jack! Blog: https://dlang.org/blog/2017/01/20/testing-in-the-d-standard-library/ Reddit:

Re: Getters/setters generator

2017-01-19 Thread Mark via Digitalmars-d-announce
On Wednesday, 18 January 2017 at 21:57:42 UTC, Andrei Alexandrescu wrote: On 1/18/17 5:29 PM, Mark wrote: I see. Is there a way to call invariant() of a class/struct directly? That would obviate the need for a particular predicate (copy the class state, run the setter, check if invariants are

Re: Getters/setters generator

2017-01-17 Thread Mark via Digitalmars-d-announce
On Tuesday, 17 January 2017 at 09:17:56 UTC, Andrei Alexandrescu wrote: On 1/17/17 9:32 AM, Eugene Wissner wrote: Ah, well thanks. I don't think it makes much sense since it would be easier to write a complete setter if the user needs extra checks. Accessors are there only for the generation

Re: Getters/setters generator

2017-01-18 Thread Mark via Digitalmars-d-announce
On Tuesday, 17 January 2017 at 15:59:26 UTC, Andrei Alexandrescu wrote: On 1/17/17 12:08 PM, Mark wrote: On Tuesday, 17 January 2017 at 09:17:56 UTC, Andrei Alexandrescu wrote: On 1/17/17 9:32 AM, Eugene Wissner wrote: Ah, well thanks. I don't think it makes much sense since it would be

Re: Is TDPL an accurate description of the D language today?

2016-09-28 Thread Mark via Digitalmars-d-learn
OK. Thanks, Steve.

Is TDPL an accurate description of the D language today?

2016-09-27 Thread Mark via Digitalmars-d-learn
I've been going through Andrei's excellent book and I noticed that the latest printing is from 2010. Since D is still a very young language I can imagine it changing quite a bit within six years. So I wonder if there are any major inconsistincies between the current state of the language and

New to D

2016-10-21 Thread Mark via Digitalmars-d-learn
Hello, Im a 3rd year Comp Sci student in Edmonton Alberta, Canada. Ive learned how to use C, and dabbled in C++ in school. Im also in a Oop course using Java. I picked up the book The D Programming Language by Alexrei Alexandrescu a few years ago. Lately Im really wanting to get into D, as

Re: New to D

2016-10-21 Thread Mark via Digitalmars-d-learn
Thanks for the fast reply. That did work. But now the error is on the line: dictionary[word] = newId; I changed the value to 10, still errors. ?? everything else is as before. thanks.

Re: Please say hello to our third team member: Razvan Nitu

2016-10-20 Thread Mark via Digitalmars-d-announce
Welcome, Razvan! On Tuesday, 18 October 2016 at 18:21:31 UTC, Andrei Alexandrescu wrote: Hi everyone, Please join me in welcoming Razvan Nitu to our fledgling team of Romanian graduate students. Razvan has already some solid industrial experience and has a broad area of interests such as

Re: Is TDPL an accurate description of the D language today?

2016-10-28 Thread Mark via Digitalmars-d-learn
On Tuesday, 27 September 2016 at 17:53:39 UTC, Steven Schveighoffer wrote: On 9/27/16 1:38 PM, Mark wrote: I've been going through Andrei's excellent book and I noticed that the latest printing is from 2010. Since D is still a very young language I can imagine it changing quite a bit within

Re: Mir Blog: Writing efficient numerical code in D

2016-12-13 Thread Mark via Digitalmars-d-announce
On Monday, 12 December 2016 at 21:58:23 UTC, Relja Ljubobratovic wrote: [1] http://blog.mir.dlang.io/ndslice/algorithm/optimization/2016/12/12/writing-efficient-numerical-code.html [2] https://github.com/libmir/dcv [3] https://github.com/libmir/dcv/pull/58 Very impressive work.

Re: DIP 1003: remove `body` as a keyword

2016-12-13 Thread Mark via Digitalmars-d-announce
On Thursday, 24 November 2016 at 14:06:40 UTC, Jonathan M Davis wrote: Personally, I don't care much about having body as a usable symbol. It occasionally would be useful, but I can live without it. However, I _do_ find it very annoying that it's required for the function body when you have

Re: Vision document for H1 2017

2017-01-12 Thread Mark via Digitalmars-d-announce
On Sunday, 8 January 2017 at 00:15:23 UTC, Seb wrote: On Saturday, 7 January 2017 at 23:33:45 UTC, Benjiro wrote: Maybe something to add ( for new users ) is something similar to: http://rustbyexample.com/ Easy to use, lots of information, simple tasks that involve interaction for the user,

Re: Many documentation examples can now be run online

2016-12-23 Thread Mark via Digitalmars-d-announce
On Monday, 19 December 2016 at 17:50:17 UTC, Seb wrote: On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu wrote: Take a look e.g. at https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them

Re: Silicon Valley D Meetup - December 22, 2016 - "The Curse of Knowledge: Et tu, D?" by Adam Wilson

2016-12-24 Thread Mark via Digitalmars-d-announce
On Saturday, 24 December 2016 at 07:30:56 UTC, Ali Çehreli wrote: On 12/15/2016 12:20 AM, Ali Çehreli wrote: https://www.meetup.com/D-Lang-Silicon-Valley/events/236253882/ The slides: http://files.meetup.com/18234529/The%20Curse%20of%20Knowledge.pptx The video:

Re: Project Highlight: Funkwerk

2017-07-30 Thread Mark via Digitalmars-d-announce
On Friday, 28 July 2017 at 13:37:31 UTC, Mike Parker wrote: Funkwerk has been using D for nearly a decade to rewrite and maintain their passenger information system. Based on input from Mario Kröplin, I've just published the first of four posts about their project and their experience with D.

Re: D books - 3 eBooks, videos, and courses for $25 right now

2017-08-06 Thread Mark via Digitalmars-d-announce
On Thursday, 3 August 2017 at 15:49:06 UTC, Martin Tschierschke wrote: On Thursday, 27 July 2017 at 08:29:14 UTC, Martin Tschierschke wrote: On Friday, 16 December 2016 at 05:43:02 UTC, Kai Nacke wrote: Hi all, Packt Publishing offers eBooks for $5 for a limited time. If your collection of D

Re: "Programming in D" is up-to-date

2017-05-13 Thread Mark via Digitalmars-d-announce
On Sunday, 14 May 2017 at 04:44:26 UTC, bluecat wrote: On Saturday, 13 May 2017 at 23:22:41 UTC, Ali Çehreli wrote: I've updated the book to 2.074.0. I've updated all paper and electronic versions at all publishers. However, I recommend that you wait a week or so before ordering (e.g. from

Need way to compare classes, and primitive types in bst Template

2017-06-08 Thread Mark via Digitalmars-d-learn
Ok. So I have a BST template, and it passes my tests. However, if you look at how I insert the data into the BST, you'll quickly notice the problem I have. https://dpaste.dzfl.pl/ff58876ce213 Keep in mind I just pasted that stack in there because I use it in my last unittest at the bottom.

Re: Eric Niebler talks about C++ Ranges at Microsoft Campus Wed evening

2017-05-18 Thread Mark via Digitalmars-d-announce
On Tuesday, 16 May 2017 at 17:44:28 UTC, Walter Bright wrote: http://nwcpp.org May 17th, 2017 at 7:00 PM Steptoe Room, Cafeteria 40, Microsoft Campus, 156th Ave NE, Redmond, WA 98052. Eric's talks are generally not to be missed. We often go out for beer afterwards :-) I remember this talk

Re: Trouble with SList for generic Stack class

2017-06-02 Thread Mark via Digitalmars-d-learn
Awesome. That worked. On Friday, 2 June 2017 at 22:30:28 UTC, Stefan Koch wrote: On Friday, 2 June 2017 at 22:21:07 UTC, Mark wrote: Hello, I am trying to make a class that can accept any type as an argument. [...] the stack class needs to be a template as well. This is not java ;)

Trouble with SList for generic Stack class

2017-06-02 Thread Mark via Digitalmars-d-learn
Hello, I am trying to make a class that can accept any type as an argument. Here is the class: import std.container: SList; class Stack { private SList!T list; private int _size; this(T)() { list = SList!T; _size = 0; } public void push(T)(T item) {

Re: How to Compare 2 objects of the same class

2017-06-03 Thread Mark via Digitalmars-d-learn
On Saturday, 3 June 2017 at 22:53:51 UTC, Stanislav Blinov wrote: On Saturday, 3 June 2017 at 22:38:31 UTC, Mark wrote: In the future I'll include a compilable example. I was having problems with a class I made which is about 45 lines, that might be a lot of code for a post. You can use

Re: How to Compare 2 objects of the same class

2017-06-03 Thread Mark via Digitalmars-d-learn
On Saturday, 3 June 2017 at 19:57:47 UTC, Mark wrote: Hello again. I'm designing a template version of a BST. Because of this, I want to be able to compare if two objects of the same class type are references to the same anonymous class on the heap somewhere. Example: Not sure what

Re: How to Compare 2 objects of the same class

2017-06-03 Thread Mark via Digitalmars-d-learn
On Saturday, 3 June 2017 at 22:52:42 UTC, Mark wrote: Thanks again. Nevermind, I got it.

Re: How to Compare 2 objects of the same class

2017-06-03 Thread Mark via Digitalmars-d-learn
On Saturday, 3 June 2017 at 23:32:44 UTC, Ali Çehreli wrote: ... Ali Awesome, that might be handy in the near future. Thanks.

How to Compare 2 objects of the same class

2017-06-03 Thread Mark via Digitalmars-d-learn
Hello again. I'm designing a template version of a BST. Because of this, I want to be able to compare if two objects of the same class type are references to the same anonymous class on the heap somewhere. Example:

Re: How to Compare 2 objects of the same class

2017-06-03 Thread Mark via Digitalmars-d-learn
On Saturday, 3 June 2017 at 22:38:31 UTC, Mark wrote: ... Thanks. Actually, I got another question, how Can I obtain the actual memory address of a class? I'll still need to solve the problem of taking ints/floats/reals etc., as well as structs and classes and sending them right/left in

Re: How to Compare 2 objects of the same class

2017-06-03 Thread Mark via Digitalmars-d-learn
On Saturday, 3 June 2017 at 20:24:44 UTC, ag0aep6g wrote: By default, they act the same. But you can change how `==` behaves by overriding `opEquals`. You cannot override `is`. Ok. So by using '==' it should compare the addresses of the objects? I think I didn't include the other file as

Re: Trouble with SList for generic Stack class

2017-06-02 Thread Mark via Digitalmars-d-learn
On Friday, 2 June 2017 at 23:34:14 UTC, Ali Çehreli wrote: You've probably seen H. S. Teoh's answer but still... :) ... Ali Awesome, thanks everyone!

Re: Need way to compare classes, and primitive types in bst Template

2017-06-09 Thread Mark via Digitalmars-d-learn
On Friday, 9 June 2017 at 05:53:11 UTC, ag0aep6g wrote: ... Get rid of `real val;` and just compare `payload`s. For classes, you can detect them with `static if (is(T == class))` or some such, and cast to void* when comparing. But when you cast to void*, you're ignoring an opEquals or opCmp

Re: Need way to compare classes, and primitive types in bst Template

2017-06-10 Thread Mark via Digitalmars-d-learn
On Saturday, 10 June 2017 at 14:35:48 UTC, ag0aep6g wrote: ... Just that you shouldn't take my version of addNode and rely on it without double checking that it's correct. Ah, Okay. I rechecked that everything is working. The size is correct, and the membership is correct for every

Re: Need way to compare classes, and primitive types in bst Template

2017-06-09 Thread Mark via Digitalmars-d-learn
Ok. WOW! I was way off. I adapted your code to my BST and it works perfectly. Thanks! I didn't know what static if was. I should experiment with it. For the code that I mentioned, I'd have to retype it. I wrote, tried and deleted those pieces of code several days ago because it really

Re: [OT] Converting booleans to numbers

2017-09-21 Thread Mark via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 19:25:58 UTC, Timon Gehr wrote: Actually, it is useful enough to have a Wikipedia page: https://en.wikipedia.org/wiki/Iverson_bracket Example of a good use: void floodFill(dchar[][] data,dchar c,int i,int j) { void dfs(int a, int b) { if (a<0 ||

Re: "Range invalidation" ?

2017-08-31 Thread Mark via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 15:06:12 UTC, Jonathan M Davis wrote: [...] Thank you for the detailed response.

Re: D on Tiobe Index

2017-09-01 Thread Mark via Digitalmars-d-announce
On Thursday, 31 August 2017 at 17:40:16 UTC, bitwise wrote: On Thursday, 31 August 2017 at 16:37:35 UTC, SrMordred wrote: On Thursday, 31 August 2017 at 14:57:28 UTC, bitwise wrote: https://www.tiobe.com/tiobe-index/d/ What happened in 2009? My first thought was that it was related to the

"Range invalidation" ?

2017-08-30 Thread Mark via Digitalmars-d-learn
C++ has the issue of iterator invalidation, where certain operations on a container while iterating on it may invalidate the iterator, in which case it is no longer safe to use the iterator. D has ranges, but presumably the same issue can arise in D. For instance, if I have a ForwardRange

Re: Open Methods: From C++ to D

2017-08-29 Thread Mark via Digitalmars-d-announce
On Monday, 28 August 2017 at 12:19:26 UTC, Mike Parker wrote: Jean-Louis Leroy posted about his open methods library here in the forums some time ago. Now, he's written a blog post that explains what open methods are, and describes the D implementation and how it compares to his C++ library.

Re: Silicon Valley D Meetup - October 26, 2017 - "D Fibers" by Ali Çehreli

2017-10-23 Thread Mark via Digitalmars-d-announce
On Saturday, 21 October 2017 at 18:20:13 UTC, Ali Çehreli wrote: D Fibers Ali will present a shorter version of his DConf 2016 talk: http://dconf.org/2016/talks/cehreli.html D's fibers (coroutines in other languages) are not a part of the language but a feature implemented by the D