What is pure used for?

2021-11-24 Thread sclytrack via Digitalmars-d-learn
My understanding is that pure is used for compiler optimization in loops and expressions. It leaves out multiple calls if it figures out it is not needed. Is pure used for anything else? int * pureFunction() 1) the pointer needs to be the same. 2) the value that the pointer points to needs

Reference Counted Class

2021-07-14 Thread sclytrack via Digitalmars-d-learn
Would reference counted classes by default be too much of a change? Is it a bad idea? Currently there a changes in the language where you can avoid the reference count, right? Combination both the rc and the stop-the-world gc, for the cycles.

Re: dip1000 rule 5

2018-11-27 Thread sclytrack via Digitalmars-d-learn
On Monday, 26 November 2018 at 09:10:23 UTC, sclytrack wrote: On Sunday, 25 November 2018 at 19:22:36 UTC, sclytrack wrote: There are 4 rules listed. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md What is rule 5? int* global_ptr; void abc() { scope int* a; int* b;

Re: dip1000 rule 5

2018-11-26 Thread sclytrack via Digitalmars-d-learn
On Sunday, 25 November 2018 at 19:22:36 UTC, sclytrack wrote: There are 4 rules listed. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md What is rule 5? int* global_ptr; void abc() { scope int* a; int* b; scope int* c = a; // Error, rule 5 scope int* d = b;

Re: dip1000 rule 5

2018-11-25 Thread sclytrack via Digitalmars-d-learn
On Sunday, 25 November 2018 at 19:49:03 UTC, Stanislav Blinov wrote: On Sunday, 25 November 2018 at 19:22:36 UTC, sclytrack wrote: There are 4 rules listed. ... What is rule 5? ... Wouldn't you call it D3 because of the name mangling of DIP1000 once activated by default? That "rule 5" looks

dip1000 rule 5

2018-11-25 Thread sclytrack via Digitalmars-d-learn
There are 4 rules listed. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md What is rule 5? int* global_ptr; void abc() { scope int* a; int* b; scope int* c = a; // Error, rule 5 scope int* d = b; // Ok int* i = a;// Ok, scope is inferred

Re: Copy Constructor DIP

2018-07-15 Thread sclytrack via Digitalmars-d
On Friday, 13 July 2018 at 11:02:57 UTC, RazvanN wrote: [...] Indeed, but this was the source of the problem also, because you could modify immutable fields that way. [...] Affirmative. The DIP needs to specify how assignment is handled if no opAssign is present but a copy ctor is

multiqualifier

2018-06-16 Thread sclytrack via Digitalmars-d-learn
I'm going to post this in learn in order not to disturb "the guys". Multiqualifiers --- Warning: Stop reading if you don't have time. Tail-const rant in disguise. (1) Going from immutable to mutable, one layer deep. --- In the D programming

Re: Implementing tail-const in D

2018-03-10 Thread sclytrack via Digitalmars-d
On Monday, 29 January 2018 at 13:07:05 UTC, Simen Kjærås wrote: On Thursday, 25 January 2018 at 21:33:10 UTC, Simen Kjærås wrote: On Thursday, 25 January 2018 at 19:54:55 UTC, H. S. Teoh wrote: In fact, if the standard implementation of opHeadMutable is basically the same across all types (or

Re: An idea for commercial support for D

2018-01-30 Thread sclytrack via Digitalmars-d
On Monday, 12 January 2015 at 06:30:20 UTC, Zach the Mystic wrote: Convenience, to me, is one-click downloading from the home page, one click installation, and full IDE support akin to what Apple, Microsoft and any other behemoth has done for their language. The language has nothing to do with

Re: DIP1000: Scoped Pointers (Discussion)

2016-08-11 Thread sclytrack via Digitalmars-d
On Thursday, 11 August 2016 at 21:28:57 UTC, sclytrack wrote: On Wednesday, 10 August 2016 at 20:36:38 UTC, Dicebot wrote: [...] There is confusion between what lifetime and visibility in the DIP. (Well, I am confused) [...] What are those puppy dogs doing there? I don't have a

Re: DIP1000: Scoped Pointers (Discussion)

2016-08-11 Thread sclytrack via Digitalmars-d
On Wednesday, 10 August 2016 at 20:36:38 UTC, Dicebot wrote: http://forum.dlang.org/post/pqsiqmkxenrwxoruz...@forum.dlang.org The first DIP has just landed into the new queue. It is a proposal from language authors and thus it bypasses usual nitpicking process and proceeds straight to

Re: Head Const

2016-02-17 Thread sclytrack via Digitalmars-d
On Wednesday, 17 February 2016 at 12:46:08 UTC, Jonathan M Davis wrote: but violate the type system by casting away const and mutating, not realizing that unlike C++, it's undefined behavior in D. Regardless of whether Walter's (and thus D's) stance on const is the right one, it clearly

Re: [dlang.org] Let's talk about the logo

2016-01-22 Thread sclytrack via Digitalmars-d
On Friday, 22 January 2016 at 20:28:57 UTC, anonymous wrote: On 22.01.2016 20:53, ronaldmc wrote: I don't want to start a war, but this isn't community? I mean aren't we trying to make things better, because the way you said it seems like a dictatorship. It's dictatorship insofar as Walter

Re: Website contains a virus?

2016-01-21 Thread sclytrack via Digitalmars-d
On Thursday, 21 January 2016 at 18:46:15 UTC, Dominikus Dittes Scherkl wrote: Hi. I'm using Norton Security from Symantec, and it claims that the current compiler dmd-2.069.2.exe is infected with the "Trojan.Gen.2". Not a particularly harmful virus, but nevertheless I hope that's not true or

Re: Safe reference counting cannot be implemented as a library

2015-12-05 Thread sclytrack via Digitalmars-d
On Monday, 2 November 2015 at 09:56:14 UTC, Ola Fosheim Grøstad wrote: On Sunday, 1 November 2015 at 22:04:51 UTC, deadalnix wrote: On Sunday, 1 November 2015 at 20:55:00 UTC, Martin Nowak wrote: On 11/01/2015 09:51 PM, Martin Nowak wrote:

Re: Safe reference counting cannot be implemented as a library

2015-10-31 Thread sclytrack via Digitalmars-d
On Thursday, 29 October 2015 at 20:31:49 UTC, Zach the Mystic wrote: On Tuesday, 27 October 2015 at 18:10:18 UTC, deadalnix wrote: I've made the claim that we should implement reference counting as a library many time, so I think I should explicit my position. Indeed, RC require some level a

Re: Object.factory() and exe file size bloat

2015-08-21 Thread sclytrack via Digitalmars-d
On Friday, 21 August 2015 at 05:24:52 UTC, BBasile wrote: On Friday, 21 August 2015 at 05:06:47 UTC, Walter Bright wrote: This function: http://dlang.org/phobos/object.html#.Object.factory enables a program to instantiate any class defined in the program. To make it work, though, every

Re: Why aren't you using D at work?

2015-07-16 Thread sclytrack via Digitalmars-d
On Thursday, 16 July 2015 at 12:04:11 UTC, Sönke Ludwig wrote: Am 15.07.2015 um 18:06 schrieb Poyeyo: On Thursday, 28 May 2015 at 14:38:51 UTC, Manu wrote: I've been using D in all my personal projects for years now, but I lament coding C at work every day, and I pine for salvation. I seem to

Re: What wrong?

2015-05-14 Thread sclytrack via Digitalmars-d-learn
On Tuesday, 5 May 2015 at 07:41:04 UTC, sclytrack wrote: On Monday, 4 May 2015 at 01:03:43 UTC, Fyodor Ustinov wrote: On Saturday, 2 May 2015 at 20:46:32 UTC, Dennis Ritchie wrote: On Saturday, 2 May 2015 at 19:38:01 UTC, Fyodor Ustinov wrote: I see it by the lack of 42. :) But why is this

Re: What wrong?

2015-05-05 Thread sclytrack via Digitalmars-d-learn
On Monday, 4 May 2015 at 01:03:43 UTC, Fyodor Ustinov wrote: On Saturday, 2 May 2015 at 20:46:32 UTC, Dennis Ritchie wrote: On Saturday, 2 May 2015 at 19:38:01 UTC, Fyodor Ustinov wrote: I see it by the lack of 42. :) But why is this receive breaks down? import std.stdio; import

Re: error with std.range.put - readN

2015-05-04 Thread sclytrack via Digitalmars-d
On Monday, 4 May 2015 at 14:33:23 UTC, Baz wrote: the following program fails because of the `put` function : --- import std.stdio; import std.range; size_t readN(T, Range)(ref Range src, ref Range dst, size_t n) if (isInputRange!Range isOutputRange!(Range, T)) { size_t result;

Re: Interrogative: What's a good blog title?

2015-04-28 Thread sclytrack via Digitalmars-d
On Tuesday, 28 April 2015 at 15:33:52 UTC, ixid wrote: Please let me know of any thoughts you might have! Thanks, Andrei Andrei to the Drescu D to the rescue The road to programming heaven. W A with a backpack, some desert landscape.

o!(const(T)) parameter.

2015-04-25 Thread sclytrack via Digitalmars-d-learn
I want a function with parameter o!(const(Form)) to accept both o!(Form) and o!(immutable(Form)) Is there a way to do it? import std.stdio; import std.traits; class Form { int number = 10; } struct o(T) { T data; this(T data) { this.data =

Re: o!(const(T)) parameter.

2015-04-25 Thread sclytrack via Digitalmars-d-learn
It works when you exclude the recursive alias this: static if(!is(T == const)) alias constify this; Your original program crashes the compiler, which is always a bug. I filed an issue: https://issues.dlang.org/show_bug.cgi?id=14499 Thank you, very much.

Re: using exceptions in @nogc

2015-03-31 Thread sclytrack via Digitalmars-d-learn
On Tuesday, 31 March 2015 at 01:40:54 UTC, weaselcat wrote: was this ever solved? I did some research and saw static immutable ones suggested a few times, but they can't be chained AFAIK. Reference counted exceptions. Not solved.

Re: DTanks Alpha

2015-03-21 Thread sclytrack via Digitalmars-d-announce
On Saturday, 21 March 2015 at 02:39:23 UTC, Rikki Cattermole wrote: On 21/03/2015 10:55 a.m., Kingsley wrote: In preparation for the London D meetup I have got the DTanks robot battle framework into the first alpha release state - good enough to use at the meetup anyway.

Re: is eC alot like D?

2015-03-11 Thread sclytrack via Digitalmars-d-learn
On Wednesday, 11 March 2015 at 04:10:51 UTC, Taylor Hillegeist wrote: On Wednesday, 11 March 2015 at 03:55:21 UTC, Rikki Cattermole wrote: On 11/03/2015 4:16 p.m., Taylor Hillegeist wrote: So I found http://ec-lang.org/ it seems alot like D, But it has a company backing it. It just seems

Re: RCArray is unsafe

2015-03-05 Thread sclytrack via Digitalmars-d
On Wednesday, 4 March 2015 at 08:56:20 UTC, Ivan Timokhin wrote: Excuse me if I miss something obvious, but: void main() { auto arr = RCArray!int([0]); foo(arr, arr[0]); } void foo(ref RCArray!int arr, ref int val) { { auto copy = arr;

Re: DList.Range magically becomes empty.

2015-02-25 Thread sclytrack via Digitalmars-d-learn
On Wednesday, 25 February 2015 at 09:07:17 UTC, Tobias Pankrath wrote: import std.container; import std.stdio; void main() { DList!int list; Array!(DList!int.Range) stack; foreach(i; 0 .. 4) { list.stableInsertBack(i); stack.insertBack(list[]); } writefln(list:

Re: tail const ?

2014-10-30 Thread sclytrack via Digitalmars-d
On Thursday, 30 October 2014 at 10:28:42 UTC, Simon A wrote: I don't know about syntax, but D sure needs first-class support of tail immutability. struct A { }

Re: tail const ?

2014-10-30 Thread sclytrack via Digitalmars-d
On Thursday, 30 October 2014 at 10:28:42 UTC, Simon A wrote: I don't know about syntax, but D sure needs first-class support of tail immutability. struct A { float * a; void foo() tailconst { writeln(typeof(a).stringof); //outputs const(float) * } } class B { float * a;

tail const ?

2014-10-29 Thread sclytrack via Digitalmars-d
As Stewart Gordon mentioned before (2012) What about adding tailConst to the D programming language? tailConst MyStruct a; All fields of the MyStruct would be tailConst and ... tailConst MyClass b; would make the the pointer mutable but all the fields of b const. ...tailImmutable, ...

monodevelop mono-d versions

2014-08-01 Thread sclytrack via Digitalmars-d-learn
I can't seem to install mono-d. It always seems to want a newer version of MonoDevelop. I'm on Ubuntu 14.04 LTS and it has version 4.0.12 of MonoDevelop. Has anybody else got this to work with this version? I have this file called MonoDevelop.D-1.9.6.mpack Tools-Add In Manager-Install

Re: If you had money to place for a bounty, what would you choose?

2014-06-10 Thread sclytrack via Digitalmars-d
On Thursday, 5 December 2013 at 05:09:03 UTC, Marco Leise wrote: Am Sun, 01 Dec 2013 09:09:32 +0100 schrieb sclytrack sclytr...@fake.com: Re: If you had money to place for a bounty, what would you choose? Official debian packages for gdc, derelict, gtkd, vibed. What compiler and D

Re: Real time captioning of D presentations

2014-06-02 Thread sclytrack via Digitalmars-d-announce
On Sunday, 1 June 2014 at 20:52:16 UTC, bearophile wrote: Walter Bright: what do you guys think? The caption I'd like to see is the name of the speaker during the live transmissions. Bye, bearophile Steno? You can type in realtime? Then why the hell did I spend time learning to type

Re: Per popular demand, here are Adam D Ruppe's presentation slides

2014-05-24 Thread sclytrack via Digitalmars-d-announce
On Saturday, 24 May 2014 at 20:53:18 UTC, Adam D. Ruppe wrote: On Saturday, 24 May 2014 at 20:46:30 UTC, sclytrack wrote: Were there actual slides? Nope, I never actually got around to creating any. Okay, busy guy. I just had an outline on my desktop of stuff I was thinking about

Re: Livestreaming DConf?

2014-05-22 Thread sclytrack via Digitalmars-d-announce
On Wednesday, 21 May 2014 at 03:03:11 UTC, Manu via Digitalmars-d-announce wrote: My timezone will keep me awake from 2am - 9am to watch the live streams... which I probably will do ;) Yeah, you were there. Don't do this a second night. On 21 May 2014 07:01, Nick via

Re: More radical ideas about gc and reference counting

2014-05-11 Thread sclytrack via Digitalmars-d
On Sunday, 11 May 2014 at 11:42:37 UTC, ponce wrote: On Sunday, 11 May 2014 at 08:59:42 UTC, Walter Bright wrote: D also cannot be performance competitive with C++ if pervasive ARC is used and memory safety is retained. Rust is attempting to solve this problem by using 'borrowed' pointers,

Re: From slices to perfect imitators: opByValue

2014-05-10 Thread sclytrack via Digitalmars-d
void main() { DemoStruct m; test(m); acceptor(immutable) i; I mean: acceptor(immutable) DemoStruct i test(i); }

Re: From slices to perfect imitators: opByValue

2014-05-09 Thread sclytrack via Digitalmars-d
On Thursday, 8 May 2014 at 11:05:20 UTC, monarch_dodra wrote: On Thursday, 8 May 2014 at 07:09:24 UTC, Sönke Ludwig wrote: Just a general note: This is not only interesting for range/slice types, but for any user defined reference type (e.g. RefCounted!T or Isolated!T). Not necessarily: As

Re: More radical ideas about gc and reference counting

2014-04-30 Thread sclytrack via Digitalmars-d
On Wednesday, 30 April 2014 at 21:17:23 UTC, H. S. Teoh via Digitalmars-d wrote: On Wed, Apr 30, 2014 at 02:13:32PM -0700, Andrei Alexandrescu via Digitalmars-d wrote: On 4/30/14, 2:09 PM, Timon Gehr wrote: On 04/30/2014 10:58 PM, Andrei Alexandrescu wrote: On 4/30/14, 1:56 PM, Timon Gehr

Re: std.file.read returns void[] why?

2014-04-17 Thread sclytrack via Digitalmars-d-learn
On Thursday, 17 April 2014 at 14:05:50 UTC, Regan Heath wrote: On Thu, 17 Apr 2014 13:59:20 +0100, Steven Schveighoffer schvei...@yahoo.com wrote: It was never possible. You must explicitly cast to void[]. to - from? void[] makes actually little sense as the result of whole-file read that

Re: std.file.read returns void[] why?

2014-04-17 Thread sclytrack via Digitalmars-d-learn
Are you saying void[] *is* currently marked NOSCAN? import std.stdio; import core.memory; writeln(int* [], GC.query(cast(void *) arr2).attr);

Re: DIP60: @nogc attribute

2014-04-16 Thread sclytrack via Digitalmars-d
On Wednesday, 16 April 2014 at 10:13:06 UTC, bearophile wrote: JN: I doubt @nogc will change anything, people will just start complaining about limitations of @nogc Having a way to say this piece of program doesn't cause heap activity is quite useful for certain piece of code. It makes a

Re: std.stream replacement

2014-04-16 Thread sclytrack via Digitalmars-d
On Saturday, 14 December 2013 at 15:16:50 UTC, Jacob Carlborg wrote: On 2013-12-14 15:53, Steven Schveighoffer wrote: I realize this is really old, and I sort of dropped off the D cliff because all of a sudden I had 0 extra time. But I am going to get back into working on this (if it's still