Re: how to make private class member private

2018-03-18 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 18 March 2018 at 18:45:23 UTC, Steven Schveighoffer wrote: If we could go back in time and talk with a young Walter about the consequences of choosing the scheme the way it is, maybe he might have made different choices, but at this point, it's hard to change it. I think this

Re: how to make private class member private

2018-03-18 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 18 March 2018 at 11:12:46 UTC, Alex wrote: ´´´ Are there any scenarios in which the person writing the class, would want to encapsulate their class, or some parts of it, from the rest of a module (while being forced to put the class in this module)? ´´´ The answer is no. As the

Re: how to make private class member private

2018-03-18 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 18 March 2018 at 10:14:30 UTC, Alain Soap wrote: BTW i think adding this can be useful. The FreePascal language has `strict private` for example. " Private - All fields and methods that are in a private block, can only be accessed in the module (i.e. unit) that contains the class

Re: OT: Behaviour of Experienced Programmers Towards Newcomers

2018-03-18 Thread psychoticRabbit via Digitalmars-d
On Sunday, 18 March 2018 at 06:28:11 UTC, Amorphorious wrote: And who the fuck are you? See, it's funny how you say I'm a noob with mental problems that says shit about people yet you are doing THE EXACT SAME THING! At the very least, you are no better than me, in fact worse, because you

Re: how to make private class member private

2018-03-18 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 18 March 2018 at 05:01:39 UTC, Amorphorious wrote: The fact is, the creator of the class is also the creator of the module.. and preventing him from having full access to the class is ignorant. He doesn't need to encapsulate himself. Encapsulation is ONLY meant to reduce

Re: how to make private class member private

2018-03-18 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 18 March 2018 at 05:01:39 UTC, Amorphorious wrote: Why do you insist that you know how everything works and you are the harbinger of truth. The fact is, you don't know squat about what you are talking about and you just want to conform D to your naive ignorant

Re: how to make private class member private

2018-03-17 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 17 March 2018 at 21:33:01 UTC, Adam D. Ruppe wrote: On Saturday, 17 March 2018 at 21:22:44 UTC, arturg wrote: maybe extend that to a list of types? this is basically what C++ friend does and D was trying to avoid the complexity of Really, the complexity of 'friend' comes from

Re: how to make private class member private

2018-03-17 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 17 March 2018 at 14:16:19 UTC, bauss wrote: I don't like the name @deny . how about: @reallyis private string firstName_; mmm..perhaps not... then how about... @strictly private string firstName_;

Re: how to make private class member private

2018-03-17 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 17 March 2018 at 09:18:13 UTC, Nick Treleaven wrote: It's a language design decision as to whether a particular feature is worth supporting. I would like this feature too though. I'm not sure how much compiler complexity would be added by having another visibility modifier. D

Re: OT: Behaviour of Experienced Programmers Towards Newcomers

2018-03-17 Thread psychoticRabbit via Digitalmars-d
On Saturday, 17 March 2018 at 07:16:22 UTC, Jonathan M Davis wrote: Unfortunately, we do periodically have folks act like that around here, but fortunately, for the most part, it's folks who don't stick around long, and our regular posters are generally well-behaved. - Jonathan M Davis

Re: OT: Behaviour of Experienced Programmers Towards Newcomers

2018-03-17 Thread psychoticRabbit via Digitalmars-d
On Saturday, 17 March 2018 at 07:01:53 UTC, rumbu wrote: 3 days ago: https://forum.dlang.org/post/ylngefsfuwqodaprw...@forum.dlang.org yeah...but that presumes Amorphorious is an 'expert programmer'. which is not the impression I got ;-)

Re: D beyond the specs

2018-03-16 Thread psychoticRabbit via Digitalmars-d
On Friday, 16 March 2018 at 11:44:59 UTC, Chris wrote: Hint: there's a Ph.D. in it ;) Hint: Do not write a Ph.D based on impressions ;-)

Re: Vision document for H1 2018

2018-03-16 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 16 March 2018 at 07:58:33 UTC, Dmitry Olshansky wrote: Playing captain the obvious but this is COPY not slice. Shh. Don't tell my customers that. D had slices since 2000s, pointing to any kind of memory. Mmm..D showing off.. as always ;-)

Re: Vision document for H1 2018

2018-03-15 Thread psychoticRabbit via Digitalmars-d-announce
On Thursday, 15 March 2018 at 18:39:08 UTC, rumbu wrote: My quote is out of context. Somebody asked surprised why C# developers are interested in D. For me (mainly a C# developer), this is the main reason: native compilation (and this includes memory management). I highlighted the fact that

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 21:38:59 UTC, Amorphorious wrote: You are a moron...etc..etc..etc..etc. See. This is what happens when you have access to a keyboard while high on ice.

Re: D course material

2018-03-13 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky wrote: Hi, folks! I’m testing waters for a D course at one University for first time it’ll be an optional thing. It’s still discussed but may very well become a reality. Before you ask - no, I’m not lecturing and in fact, I didn’t

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 08:44:48 UTC, Mike Parker wrote: Making modules the lowest level of encapsulation does that without the need for an extra keyword for friends while still maintaining a strict border between external and internal APIs. Moreover, it restricts friends to the same

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 12:10:07 UTC, rikki cattermole wrote: On 14/03/2018 1:02 AM, psychoticRabbit wrote: On Tuesday, 13 March 2018 at 11:31:12 UTC, rikki cattermole wrote: Ah yes. You're completely correct if you subscribe to Adam's and ketmar's file sizes expectation. A D module

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 11:31:12 UTC, rikki cattermole wrote: Ah yes. You're completely correct if you subscribe to Adam's and ketmar's file sizes expectation. A D module and package is one level of abstraction. If that level of abstraction starts to fill up and gets large, you split

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 08:44:48 UTC, Mike Parker wrote: Moreover, it restricts friends to the same module, easing the maintenance burden and decreasing the chance of error. It was a great decision. But, a module can contain so many 'friends'. Q. How many 'friends' does it take, before

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 08:29:42 UTC, Alex wrote: package myPackage; public class Main { public static void main(String[] args) { System.out.println("Hello World!"); myClass c = new myClass(); c.myPrivateClassMember= "wtf";

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 09:52:06 UTC, Mike Parker wrote: On Tuesday, 13 March 2018 at 09:14:26 UTC, psychoticRabbit wrote: That's make a little uncomfortable, given how long and complex modules can easily become(and aleady are) Is there a practical difference between a) a module that

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 08:44:48 UTC, Mike Parker wrote: Any new keywords, or reuse of existing keywords, does make the language more complex. Everything that is added must have a reason. Private is module level because friend is so common in C++, i.e. people find it useful and it would

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 08:05:43 UTC, psychoticRabbit wrote: On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote: I think it's a great feature and I use it frequently. It's allows more flexibility in class design. Without it, we'd need another protection attribute to enable the

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote: I think it's a great feature and I use it frequently. It's allows more flexibility in class design. Without it, we'd need another protection attribute to enable the concept of "private to the module". what about a new access

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 07:05:48 UTC, rikki cattermole wrote: Your thought model is much younger than modules. Modules have existed since the mid 70's. They work, other designs over the years have proven to have faults and problems. D's design is evolved from already existing ideas to

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:43:55 UTC, ketmar wrote: that is, we should stick to defective design only 'cause there is no "other D" that made it right? ;-) also, your question is not valid. you were told several times that you're evaluating the whole thing wrong, but you're insisting

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote: The same applies here. Encapsulation simply isn't broken by this feature. What you're saying, is in D, class encapsulation is really 'module' encapsulation. I get it. Fine. It's an intersting design decision. But, in doing

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:26:13 UTC, Radu wrote: On Tuesday, 13 March 2018 at 06:14:49 UTC, psychoticRabbit wrote: On Tuesday, 13 March 2018 at 06:01:43 UTC, ketmar wrote: ah, yes, sorry: i completely forgot that C++ was invented after c# and java. mea maxima culpa! My point was,

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:25:39 UTC, ketmar wrote: psychoticRabbit wrote: So the 3 most used languages got it wrong?? yes. do you know any other language, where a private class memeber, is not private to the class? (btw. that's a question, not a statement).

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote: I think it's a great feature and I use it frequently. It's allows more flexibility in class design. Without it, we'd need another protection attribute to enable the concept of "private to the module". That's kind of my point.

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 05:35:30 UTC, Amorphorious wrote: There is another problem: 3rd: You are a brainwashed monkey who can't think for himself. Gee..takes some real brains to come up with that one. See, You learned a little about C++/C#/Java and think the world must conform to

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 06:01:43 UTC, ketmar wrote: ah, yes, sorry: i completely forgot that C++ was invented after c# and java. mea maxima culpa! My point was, that the 2 most widely used and popular languages on the plant, C# and Java, decided NOT to make private, something mean

Re: how to make private class member private

2018-03-13 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 05:52:55 UTC, ketmar wrote: psychoticRabbit wrote: There are two problems I see: 1) it is not how C++ done it. 2) it is not how C++ done it. and you're completely right: it is not how C++ done it. umm...didn't you forget something: 1) it is not how C# done it.

Re: how to make private class member private

2018-03-12 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 02:24:38 UTC, Mike Parker wrote: On Tuesday, 13 March 2018 at 02:06:57 UTC, psychoticRabbit wrote: Mmm.. I don't think I like it. I feel you should be able to make a member of a class, private, regardless of where the class is located. This seems to break the

Re: how to make private class member private

2018-03-12 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 01:39:13 UTC, Jonathan M Davis wrote: private is private to the module, not the class. There is no way in D to restrict the rest of the module from accessing the members of a class. This simplification makes it so that stuff like C++'s friend are unnecessary. If

Re: Vision document for H1 2018

2018-03-12 Thread psychoticRabbit via Digitalmars-d-announce
On Monday, 12 March 2018 at 19:09:42 UTC, Dennis wrote: On Monday, 12 March 2018 at 16:07:40 UTC, SealabJaster wrote: This post may not be all that helpful, but I feel the need to voice the frustrations with my experience. Sorry for the pointless/off-topic rant. Thank you for this post, I

how to make private class member private

2018-03-12 Thread psychoticRabbit via Digitalmars-d-learn
I cannot get my head around, why private is not private, in D. How do I make a private member, private? - module test; import std.stdio; void main() { myClass c = new myClass(); c.myPrivateClassMember= "wtf"; writeln(c.myPrivateClassMember); } class myClass { private

Re: Vision document for H1 2018

2018-03-12 Thread psychoticRabbit via Digitalmars-d-announce
On Monday, 12 March 2018 at 06:13:35 UTC, rumbu wrote: I'm comparing two open source projects, both hosted on github. Both available in the same supermarket. It seems that one of them is easy to reach to, the other one is on the top shelf and you need a forklift to reach it. And when you

Re: Vision document for H1 2018

2018-03-11 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 16:15:22 UTC, rumbu wrote: On Sunday, 11 March 2018 at 14:37:28 UTC, bachmeier wrote: And this clarifies the source of your confusion. The D programming language is an open source project, not a for-profit company. D is not the language you're looking for. There

Re: Vision document for H1 2018

2018-03-11 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 13:36:27 UTC, R wrote: I am sure that lots of D members will be quick to point out, that C# is run by a commercial company and D has only open source contributors. Now why did you not contribute! /sarcasm I'd like to point out, that C# is run by a commercial

Re: Vision document for H1 2018

2018-03-11 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 07:59:53 UTC, rumbu wrote: My opinion is that the day when C# will compile to native (on any platform), the C# developer interest in D will drop instantly. OT: Interestingly, my uni is still stuck in the OOP paradigm, and is now teaching intro to OOP using .NET

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 05:41:02 UTC, Dylan Graham wrote: I regret some of things I said. I'm sorry for any offence caused, specifically towards members of the DLF. I don't think you need to regret saying anything. You've demonstrated a willingness to engage in a conversation that we

Re: List installed modules

2018-03-10 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 11 March 2018 at 03:52:19 UTC, psychoticRabbit wrote: Whether dub does that currently I do not know, as i don't use dub, or any additional packages outside of phobos. oh > dub list ;-)

Re: List installed modules

2018-03-10 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 11 March 2018 at 01:04:27 UTC, Roberto wrote: How do I list installed modules? or.. https://dlang.org/phobos/index.html

Re: List installed modules

2018-03-10 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 11 March 2018 at 01:04:27 UTC, Roberto wrote: How do I list installed modules? dmd --list-modules datefmt dateparser std.algorithm std.array std.conv std.datetime std.digest std.exception std.file std.format std.getopt std.json std.math ... Presumably, you mean packages installed

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 01:58:50 UTC, psychoticRabbit wrote: i.e. How can the D Foundation encourage new additional resoures to focus on things that also matter to the community. and btw. the mention about strengthing the use of DIPS, does just that. there are many improvement to

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 01:53:30 UTC, Dylan Graham wrote: That sentence was to counter psychoticRabbit. I didn't mean it literally. If you've read my earlier posts, it's not BetterC I have an issue with, it's the allocation of time. Well that should have been the basis of your

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 01:46:09 UTC, Dylan Graham wrote: Rust was more popular and who could use that? Rust is popular because of its ideas, not because it pandered. I don't see "programmer" portability as being pandering. It common sense. Rust is good, in that it seeks to do

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 01:36:51 UTC, Dylan Graham wrote: The D Language Foundation, being the leading body of D, should hold some responsibility to the interests of the majority. And also the minority. A lesson that humanity has to learn over and over again.

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 01:25:07 UTC, Dylan Graham wrote: I'm not sure what you mean at that last sentence. I mean, cause D is so compatible with C/C++/Java/C# - that you can easily switch between them. Whereas as Go and Rust have their own thing going, making those languages really

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 01:06:08 UTC, R wrote: And "scripting" language like PHP, that everybody criticizes just keeps growing and gained 11% market share in the last 7 years ( at now 83% ). Where as D its gain has been minimalist thanks to people leaving almost as fast as it gain.

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 01:06:08 UTC, R wrote: Point to the wall on the left side. That is what your talking to. D its focus on C++ as a bad plan has been made pushed by many people ( lots who left ). Its like asking Go for Generics. And its very nice to see the "71% in the poll do not

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Sunday, 11 March 2018 at 00:36:19 UTC, Dylan Graham wrote: Every day D becomes more like C++ 2.0, why can't it just be D? Oddly enough, I think this is D's strength. Golang tried to draw the line, and look where that got it. Now it's a limited language for a specific domain (at least

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Saturday, 10 March 2018 at 11:45:25 UTC, rumbu wrote: I'm talking about the D Foundation priority list, not about the open source community surrounding it. I have nothing against betterC, the community is free to work on it, but I don't understand why it's a *priority* for the D foundation.

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Saturday, 10 March 2018 at 11:45:25 UTC, rumbu wrote: I'm talking about the D Foundation priority list, not about the open source community surrounding it. I have nothing against betterC, the community is free to work on it, but I don't understand why it's a *priority* for the D

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Saturday, 10 March 2018 at 10:05:49 UTC, rumbu wrote: According to the State of D Survey, 71% of the respondents don't care about betterC. Why is betterC on the priority list? who cares what 'the majority' want... I mean really. stuff em! (ohh... that was in jest.. don't take that

Re: Vision document for H1 2018

2018-03-10 Thread psychoticRabbit via Digitalmars-d-announce
On Saturday, 10 March 2018 at 10:47:09 UTC, Dylan Graham wrote: Yeah. Why should D worry about tying itself into C when it can't even interface with itself through DLLs? A reasonable point. But.. in any case.. people work on what they are motivated to work on. That's really all there is

Re: Vision document for H1 2018

2018-03-09 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 9 March 2018 at 21:43:53 UTC, Andrei Alexandrescu wrote: Hello, the vision document of the Founation for the first six months of 2018 is here: nice. andd that 'langauge specification' is really important too.. or people will drift towards languages that 'are' properly specified.

Re: Release D 2.079.0

2018-03-06 Thread psychoticRabbit via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 20:50:37 UTC, Jack Stouffer wrote: Also, if you'll allow me to have crazy ideas for a moment, one wonders why we shouldn't just release Phobos itself through dub? Rust makes people use their build tool, why not us? That's the day I stop using D. I do not, and

Re: Release D 2.079.0

2018-03-06 Thread psychoticRabbit via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 07:11:24 UTC, Jonathan M Davis wrote: That example actually should be perfectly @safe, because the array is null, and it's using writeln. Dereferencing null is @safe, because it segfaults and thus can't corrupt memory or access invalid memory. You obviously don't

Re: Release D 2.079.0

2018-03-05 Thread psychoticRabbit via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 05:22:58 UTC, Void-995 wrote: Can somebody explain how [0] is more safe than array.ptr? Just want to understand why second statement isn't allowed in safe anymore. int[] a; writeln([0]); // good - runtime produces a core.exception.RangeError //writeln(arr.ptr);

Re: Speed of math function atan: comparison D and C++

2018-03-05 Thread psychoticRabbit via Digitalmars-d-learn
On Monday, 5 March 2018 at 06:01:27 UTC, J-S Caux wrote: So the codes are trivial, simply some check of raw speed: double x = 0.0; for (int a = 0; a < 10; ++a) x += atan(1.0/(1.0 + sqrt(1.0 + a))); for C++ and double x = 0.0; for (int a = 0; a < 1_000_000_000; ++a) x +=

Re: string object won't compile

2018-03-05 Thread psychoticRabbit via Digitalmars-d-learn
On Monday, 5 March 2018 at 23:34:50 UTC, askjfbd wrote: Someone please tell me how, for I am a newbie and don't know any solutions even to this very simple problem. As I learned dlang using the Dlang tour page, I stuck at the alias & Strings page. I have tried to compile the following simple

Re: Release D 2.079.0

2018-03-05 Thread psychoticRabbit via Digitalmars-d-announce
On Monday, 5 March 2018 at 23:40:35 UTC, Atila Neves wrote: I'd have a snowball's chance in hell convincing anyone at a "regular" company of adopting D if anyone there even imagined any of the above could happen. We have to do better than this. Atila Fair enough. Doing better is always a

Re: Release D 2.079.0

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Saturday, 3 March 2018 at 01:50:25 UTC, Martin Nowak wrote: Glad to announce D 2.079.0. This release comes with experimental `@nogc` exception throwing (-dip1008), a lazily initialized GC, better support for minimal runtimes, and an experimental Windows toolchain based on the lld linker

Re: State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 12:20:31 UTC, Paulo Pinto wrote: And if you like C so much, what are you doing in a safe systems programming language forum? How safe is D.. i mean really ;-) and why do people ask me that question.. I don't get it. I program (or try to) in as many languages as

Re: [OFF TOPIC] State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 13:05:58 UTC, Russel Winder wrote: Science, in and of itself, cannot be dodgy. science must involve humans, and humans are often dodgy. Yes there are debates to be had, cf. Popper, Kuhn, etc. but the foundation of science is hypotheses, experimentation, and

Re: State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 12:02:43 UTC, Russel Winder wrote: On Fri, 2018-03-02 at 11:52 +, Russel Winder wrote: […] report science, does make science dodgy. But that stray off topic for […] s/does/does not/ Obviously. :-) mmm...freudian slip?? I study science...and what's being

Re: State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 11:00:09 UTC, Jonathan M Davis wrote: In any case, I expect that anyone who wants D3 is going to have a very hard time convincing Walter and Andrei that such large breaking changes would be worth it at this point. - Jonathan M Davis I agree. I don't think there is

Re: State of D 2018 Survey

2018-03-02 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 10:21:05 UTC, Russel Winder wrote: ...continue with C in the face of overwhelming evidence it is the wrong thing to do. yeah, the health fanatics who promote their crap to goverments and insurance agencies, use very similar arguments about sugar, salt, alchohol,

Re: single loop copy in D

2018-03-02 Thread psychoticRabbit via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:08:57 UTC, Simen Kjærås wrote: This is of course only partly true. while ((*dst++ = *src++) != 0) {} works just great, and also better shows what's actually being tested for in the loop. -- Simen That's what I was after. Thanks!

single loop copy in D

2018-03-02 Thread psychoticRabbit via Digitalmars-d-learn
trying to do this C code, in D, but getting error: "Error: assignment cannot be used as a condition, perhaps `==` was meant?" any help much appreciated: -- while ((*dst++ = *src++)) {} --

Re: State of D 2018 Survey

2018-03-01 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 03:57:25 UTC, barry.harris wrote: Sorry little rabbit, your are misguided in this belief. Back in day we all used C and this is the reason most "safer" languages exist today. You can write pretty safe code in C these days, without too much trouble. We have the

Re: State of D 2018 Survey

2018-03-01 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 02:35:46 UTC, Meta wrote: D1 -> D2 nearly killed D (can't remember which, but it was either Walter or Andrei that have said this on multiple occasions). A D2 -> D3 transition might generate a lot of publicity if done very carefully, but more than likely it would

Re: State of D 2018 Survey

2018-03-01 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 02:02:42 UTC, psychoticRabbit wrote: btw. I never said 'stop changing', I said "I wish programming languages would just stop changing so often." I'd also argue, that languages that are relatively stable, are far 'safer' than languages that constantly change.

Re: State of D 2018 Survey

2018-03-01 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 01:19:53 UTC, H. S. Teoh wrote: Because it has not stopped changing. To wit: K C (1978) C89 / C90 / ANSI C (1989-1990) The 1995 amendment to ANSI C (1995) C99 (1999) (Embedded C (2008)) C11 (2011) T btw. I never

Re: State of D 2018 Survey

2018-03-01 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 2 March 2018 at 00:53:02 UTC, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 12:39:08AM +, psychoticRabbit via Digitalmars-d-announce wrote: [...] On the otherhand, I wish programming languages would just stop changing so often. [...] Change is inevitable, except from a vending

Re: State of D 2018 Survey

2018-03-01 Thread psychoticRabbit via Digitalmars-d-announce
On Thursday, 1 March 2018 at 21:49:31 UTC, Jonathan M Davis wrote: That being said, I think that it's a given that we need to make breaking changes at least occasionally. The question is more how big they can be and how we go about it. Some changes would clearly be far too large to be worth

Re: forcing tabs in regex

2018-02-27 Thread psychoticRabbit via Digitalmars-d-learn
On Wednesday, 28 February 2018 at 01:06:30 UTC, dark777 wrote: Regex validates years bisexto and not bisextos in format: const std::regex

Re: C++ launched its community survey, too

2018-02-27 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 27 February 2018 at 15:52:15 UTC, Andrei Alexandrescu wrote: https://isocpp.org/blog/2018/02/new-cpp-foundation-developer-survey-lite-2018-02 Andrei really, online surveys are dodgy at best. btw. Bjarne Stroustrup recently received the 2018 Charles Stark Draper Prize for

Re: Documentation for any* dub package, any version

2018-02-26 Thread psychoticRabbit via Digitalmars-d-announce
On Tuesday, 27 February 2018 at 02:57:08 UTC, Adam D. Ruppe wrote: Saturday morning, a user complained that several leading dub packages had poor documentation, if they could find it at all. That's changing, right now. Before long, packages without docs are going to suffer. This will put

Re: iota to array

2018-02-26 Thread psychoticRabbit via Digitalmars-d-learn
On Tuesday, 27 February 2018 at 00:04:59 UTC, H. S. Teoh wrote: A 64-bit double can only hold about 14-15 decimal digits of precision. Anything past that, and there's a chance your "different" numbers are represented by exactly the same bits and the computer can't tell the difference. T

Re: iota to array

2018-02-26 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 25 February 2018 at 14:52:19 UTC, Steven Schveighoffer wrote: 1 == 1.0, no? no. at least, not when a language forces you to think in terms of types. 1 is an int. 1.0 is a floating point. I admit, I've never printed output without using format specifiers, but still, if I say

Re: iota to array

2018-02-25 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 25 February 2018 at 12:13:31 UTC, Andrea Fontana wrote: On Sunday, 25 February 2018 at 09:30:12 UTC, psychoticRabbit wrote: I would have preffered it defaulted java style ;-) System.out.println(1.0); // i.e. it prints 'what I told it to print'. System.out.println(1.0); // print

Re: How do you get comfortable with Dlang.org's Forum?

2018-02-25 Thread psychoticRabbit via Digitalmars-d
On Sunday, 25 February 2018 at 01:49:05 UTC, rikki cattermole wrote: On 25/02/2018 2:31 PM, psychoticRabbit wrote: NNTP is not the future..it's the past. Good news, mailing lists will exist long after we're all dead and gone. We don't actually die, cause every atom in our body is billions

Re: iota to array

2018-02-25 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 25 February 2018 at 08:46:19 UTC, rumbu wrote: On Sunday, 25 February 2018 at 08:08:30 UTC, psychoticRabbit wrote: But umm what happended to the principle of least astonishment? writeln(1.1); (prints 1.1) whereas.. writeln(1.0); (prints 1) I don't get it. Cause it's

Re: iota to array

2018-02-25 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 25 February 2018 at 06:35:07 UTC, Jonathan M Davis wrote: It's not printing ints. It's printing doubles. It's just that all of the doubles have nothing to the right of the decimal point, so they don't get printed with a decimal point. If you did something like start with 1.1, then

Re: iota to array

2018-02-24 Thread psychoticRabbit via Digitalmars-d-learn
On Sunday, 25 February 2018 at 05:40:19 UTC, Jonathan M Davis wrote: int[] intArr = iota(1, 11).array(); - Jonathan M Davis thanks! oh man. It's so easy to do stuff in D ;-) But this leads me to a new problem now. When I run my code below, I get ints printed instead of doubles??

iota to array

2018-02-24 Thread psychoticRabbit via Digitalmars-d-learn
Hi. Anyone know whether something like this is possible? I've tried various conversions/casts, but no luck yet. Essentially, I want to cast the result set of the iota to an array, during initialisation of the variable. no, I don't want to use 'auto'. I want an array object ;-)

Re: How do you get comfortable with Dlang.org's Forum?

2018-02-24 Thread psychoticRabbit via Digitalmars-d
On Saturday, 24 February 2018 at 20:29:34 UTC, Walter Bright wrote: Yeah, the immutability of NNTP posts is a feature, not a bug. but aren't git changes essentially immutable too? as long is there is a history of the changes, there is no problem with changes. I'm really only interested in

Re: Beta 2.079.0

2018-02-23 Thread psychoticRabbit via Digitalmars-d-announce
On Saturday, 24 February 2018 at 07:09:05 UTC, zabruk70 wrote: i don't understand whole theread. why all import must be written on one line? curent syntax very handy and readable. you must have understood the thread, cause you summarised it pretty well ;-)

Re: Template Constraints

2018-02-23 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 24 February 2018 at 04:22:12 UTC, Jonathan M Davis wrote: Why is there anything dodgy going on and why would you need contracts? Contracts actually tend to go very badly with generic code, because whatever they assert has to be generic, and while that works sometimes, more often

Re: How do you get comfortable with Dlang.org's Forum?

2018-02-23 Thread psychoticRabbit via Digitalmars-d
On Saturday, 24 February 2018 at 04:13:15 UTC, Johannes Loher wrote: There are Browser extensions gor this (e.g. https://chrome.google.com/webstore/detail/stylish-custom-themes-for/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en) Hey. thanks for the tip. though..I just refuse to use chrome ;-) (in

Re: Template Constraints

2018-02-23 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 24 February 2018 at 03:58:48 UTC, Jonathan M Davis wrote: Whether an implicit cast or an explicit cast makes more sense depends entirely on what the code is doing, but either way, the conversion needs to be forced inside the function, or you end up with bugs. Far too often, when

Re: Template Constraints

2018-02-23 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 24 February 2018 at 03:43:25 UTC, Jonathan M Davis wrote: That does not do what the OP requested at all. That tests whether T is one of byte, ubyte, short, ushort, int, uint, long, and ulong, whereas what the OP wants is to test whether T can be cast to int. - Jonathan M Davis

Re: Template Constraints

2018-02-23 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 24 February 2018 at 03:30:45 UTC, psychoticRabbit wrote: On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote: I am having trouble finding many useful explanations of using template constraints beyond basic usage. I would like to have a template constrant to enforce that

Re: Template Constraints

2018-02-23 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote: I am having trouble finding many useful explanations of using template constraints beyond basic usage. I would like to have a template constrant to enforce that a type can be explicitly cast to another type: void (T)(T t)

Re: Template Constraints

2018-02-23 Thread psychoticRabbit via Digitalmars-d-learn
On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote: I am having trouble finding many useful explanations of using template constraints beyond basic usage. I would like to have a template constrant to enforce that a type can be explicitly cast to another type: void (T)(T t)

Re: Beta 2.079.0

2018-02-23 Thread psychoticRabbit via Digitalmars-d-announce
On Friday, 23 February 2018 at 16:03:56 UTC, Aurélien Plazzotta wrote: Perhaps, we could use Backus-Naur notation, as it is already widely known into formal documents all over the globe, like the following: import std.stdio, std.whatever{this, that}, std.somethingelse, std.grr{wtf}; That

  1   2   3   >