Re: Difference between chunks(stdin, 1) and stdin.rawRead?

2024-03-28 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Mar 28, 2024 at 10:10:43PM +, jms via Digitalmars-d-learn wrote: > On Thursday, 28 March 2024 at 02:30:11 UTC, jms wrote: [...] > I think I figured it out and the difference is probably in the mode. > This documentation >

Re: Difference between chunks(stdin, 1) and stdin.rawRead?

2024-03-28 Thread jms via Digitalmars-d-learn
On Thursday, 28 March 2024 at 02:30:11 UTC, jms wrote: Why in the below silly program am I reading both the \r and \n characters when using rawRead in block a, but when looping by 1 byte chunks in block b only appear to be reading the \n characters? I'm on Windows 11 using DMD64 D Compiler

Re: Difference between using `import` with/without the colon

2023-03-19 Thread Jeremy via Digitalmars-d-learn
On Sunday, 19 March 2023 at 08:47:32 UTC, Basile B. wrote: On Sunday, 19 March 2023 at 07:20:17 UTC, Jeremy wrote: [...] The colon-form, aka "selective import" has for effect 1. to create a local alias so this can indeed speedup symbol lookups in the sense that search will succeed before

Re: Difference between using `import` with/without the colon

2023-03-19 Thread Basile B. via Digitalmars-d-learn
On Sunday, 19 March 2023 at 07:20:17 UTC, Jeremy wrote: Hello, is there any difference at all between the following lines, as an example: ```d import std.regex; import std.regex : matchFirst; ``` What technical differences does it make (except for having the identifier available), using the

Re: difference between x.atomicOp!"+="(1) and atomicFetchAdd(x, 1)?

2022-11-10 Thread mw via Digitalmars-d-learn
On Thursday, 10 November 2022 at 18:30:16 UTC, Paul Backus wrote: On Thursday, 10 November 2022 at 17:04:31 UTC, mw wrote: Hi, Anyone can help explain what is the difference between x.atomicOp!"+="(1) and atomicFetchAdd(x, 1)? Looking at the source in druntime, `atomicOp!"+="` forwards to

Re: difference between x.atomicOp!"+="(1) and atomicFetchAdd(x, 1)?

2022-11-10 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 10 November 2022 at 17:04:31 UTC, mw wrote: Hi, Anyone can help explain what is the difference between x.atomicOp!"+="(1) and atomicFetchAdd(x, 1)? Looking at the source in druntime, `atomicOp!"+="` forwards to `atomicFetchAdd` internally, so they should have the same

Re: Difference between range `save` and copy constructor

2020-02-17 Thread uranuz via Digitalmars-d-learn
> Either way, generic code should never be using a range after > it's been copied, and copying is a key part of how > idiomatic, range-based code works in D. OK. Thanks for instructions. I shall give it a try.

Re: Difference between range `save` and copy constructor

2020-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 16, 2020 12:22:01 PM MST Paul Backus via Digitalmars-d- learn wrote: > On Sunday, 16 February 2020 at 18:11:11 UTC, Jonathan M Davis > > wrote: > > Either way, generic code should never be using a range after > > it's been copied, and copying is a key part of how idiomatic, > >

Re: Difference between range `save` and copy constructor

2020-02-16 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 16 February 2020 at 18:11:11 UTC, Jonathan M Davis wrote: Either way, generic code should never be using a range after it's been copied, and copying is a key part of how idiomatic, range-based code works in D. "Copy and then never use the original again" is conceptually the same

Re: Difference between range `save` and copy constructor

2020-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 16, 2020 10:53:36 AM MST Paul Backus via Digitalmars-d- learn wrote: > On Sunday, 16 February 2020 at 17:10:24 UTC, Jonathan M Davis > > wrote: > > On Sunday, February 16, 2020 7:29:11 AM MST uranuz via > > > >> This is working fine with disabled postblit... > >> import std; >

Re: Difference between range `save` and copy constructor

2020-02-16 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 16 February 2020 at 17:10:24 UTC, Jonathan M Davis wrote: On Sunday, February 16, 2020 7:29:11 AM MST uranuz via This is working fine with disabled postblit... import std; struct SS { @disable this(this); // Disabled copy bool _empty = false; bool empty() @property

Re: Difference between range `save` and copy constructor

2020-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 16, 2020 6:52:17 AM MST uranuz via Digitalmars-d-learn wrote: > It's very bad. Because there seem that when I use range based > algorithm I need to take two things into account. The first is > how algrorithm is implemented. If it creates copies of range > inside or pass it by

Re: Difference between range `save` and copy constructor

2020-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 16, 2020 7:29:11 AM MST uranuz via Digitalmars-d-learn wrote: > On Sunday, 16 February 2020 at 12:38:51 UTC, Jonathan M Davis > > wrote: > > On Sunday, February 16, 2020 3:41:31 AM MST uranuz via > > > > Digitalmars-d-learn wrote: > >> I have reread presentation: > >>

Re: Difference between range `save` and copy constructor

2020-02-16 Thread uranuz via Digitalmars-d-learn
On Sunday, 16 February 2020 at 12:38:51 UTC, Jonathan M Davis wrote: On Sunday, February 16, 2020 3:41:31 AM MST uranuz via Digitalmars-d-learn wrote: I have reread presentation: http://dconf.org/2015/talks/davis.pdf We declare that `pure` input range cannot be `unpoped` and we can't return to

Re: Difference between range `save` and copy constructor

2020-02-16 Thread uranuz via Digitalmars-d-learn
In general for value-semantics and ref-semantics the different code is actually needed. But generic algorithm try to pretend that the logic is the same. But it's not true. But in wide subset of trivial algorithm it's true. So it's incorrectly interpolated that it's true for every case. The

Re: Difference between range `save` and copy constructor

2020-02-16 Thread uranuz via Digitalmars-d-learn
It's very bad. Because there seem that when I use range based algorithm I need to take two things into account. The first is how algrorithm is implemented. If it creates copies of range inside or pass it by reference. And the second is how the range is implemented if it has value or reference

Re: Difference between range `save` and copy constructor

2020-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 16, 2020 3:41:31 AM MST uranuz via Digitalmars-d-learn wrote: > I have reread presentation: > http://dconf.org/2015/talks/davis.pdf > We declare that `pure` input range cannot be `unpoped` and we > can't return to the previous position of it later at the time. So > logically

Re: Difference between range `save` and copy constructor

2020-02-16 Thread uranuz via Digitalmars-d-learn
I have reread presentation: http://dconf.org/2015/talks/davis.pdf We declare that `pure` input range cannot be `unpoped` and we can't return to the previous position of it later at the time. So logically there is no sence of copying input range at all. So every Phobos algorithm that declares

Re: Difference between range `save` and copy constructor

2020-02-16 Thread uranuz via Digitalmars-d-learn
Also I see the problemme that someone can think that it creates an input range, because he doesn't provide `save` method, but actually it creates forward range unexpectedly, because it is copyable. And it makes what is actually happening in code more difficult. Some algrorithm can take ranges

Re: Difference between range `save` and copy constructor

2020-02-16 Thread uranuz via Digitalmars-d-learn
Actually, as I understand it, the main reason that save was introduced was so that classes could be forward ranges I have use of ranges as a classes in my code that rely on classes and polymorthism, but it's usually an InputRange that implements Phobos interface:

Re: Difference between range `save` and copy constructor

2020-02-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/15/20 9:45 AM, Jonathan M Davis wrote: On Saturday, February 15, 2020 7:34:42 AM MST Steven Schveighoffer via Digitalmars-d-learn wrote: On 2/15/20 5:53 AM, uranuz wrote: I am interested in current circumstances when we have new copy constructor feature what is the purpose of having range

Re: Difference between range `save` and copy constructor

2020-02-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, February 15, 2020 7:34:42 AM MST Steven Schveighoffer via Digitalmars-d-learn wrote: > On 2/15/20 5:53 AM, uranuz wrote: > > I am interested in current circumstances when we have new copy > > constructor feature what is the purpose of having range `save` > > primitive? For me they

Re: Difference between range `save` and copy constructor

2020-02-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/15/20 5:53 AM, uranuz wrote: I am interested in current circumstances when we have new copy constructor feature what is the purpose of having range `save` primitive? For me they look like doing basicaly the same thing. And when looking in some source code of `range` module the most common

Re: Difference between template and mixin template

2019-10-10 Thread Just Dave via Digitalmars-d-learn
On Thursday, 10 October 2019 at 15:56:36 UTC, Just Dave wrote: I'm trying to get my head around mixing templates. I'm using it as kind of a replacement for class inheritance as it seems to fit better composition over inheritance. So I do something like: mixin template NumberTemplate()

Re: Difference between slice[] and slice

2019-09-25 Thread ag0aep6g via Digitalmars-d-learn
On 25.09.19 22:36, WhatMeWorry wrote: On Wednesday, 25 September 2019 at 19:25:06 UTC, Ali Çehreli wrote: On 09/25/2019 12:06 PM, WhatMeWorry wrote: [...] > In short, is there anytime that one would want to use "slice[] = > something" syntax?I That changes element values. Ok.  But which

Re: Difference between slice[] and slice

2019-09-25 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 25 September 2019 at 20:36:47 UTC, WhatMeWorry wrote: Ok. But which element(s)? In my specific case, I was using []. Is waste[] = waste[0..$-1]; even semantically meaningful? Because the LDC compiler had no problem compiling it. `waste[]` is just shorthand for

Re: Difference between slice[] and slice

2019-09-25 Thread WhatMeWorry via Digitalmars-d-learn
On Wednesday, 25 September 2019 at 19:25:06 UTC, Ali Çehreli wrote: On 09/25/2019 12:06 PM, WhatMeWorry wrote: > I was > assuming that [] meant "the entirety" of the array. Assuming we're talking about D slices, Yes. (It could be a user-defined type with surprisingly different semantics.) >

Re: Difference between slice[] and slice

2019-09-25 Thread Ali Çehreli via Digitalmars-d-learn
On 09/25/2019 12:06 PM, WhatMeWorry wrote: > I was > assuming that [] meant "the entirety" of the array. Assuming we're talking about D slices, Yes. (It could be a user-defined type with surprisingly different semantics.) > In short, is there anytime that one would want to use "slice[] = >

Re: difference between x = Nullable.init and x.nullify

2017-06-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 05, 2017 10:46:39 Kagamin via Digitalmars-d-learn wrote: > On Sunday, 4 June 2017 at 08:51:44 UTC, Jonathan M Davis wrote: > >> On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis > >> > >> wrote: > >> > Assigning Nullable!Test.init is equivalent to setting the > >> >

Re: difference between x = Nullable.init and x.nullify

2017-06-05 Thread Kagamin via Digitalmars-d-learn
On Sunday, 4 June 2017 at 08:51:44 UTC, Jonathan M Davis wrote: On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis wrote: > Assigning Nullable!Test.init is equivalent to setting the > internal value to Test.init and setting _isNull to false. T _value; bool _isNull = true; So it was

Re: difference between x = Nullable.init and x.nullify

2017-06-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, June 04, 2017 09:31:24 vit via Digitalmars-d-learn wrote: > On Sunday, 4 June 2017 at 09:04:14 UTC, Jonathan M Davis wrote: > > [...] > > Why Nullable!T call destroy for reference types? It calls destroy for everything. Why it does that instead of simply assigning T.init and setting

Re: difference between x = Nullable.init and x.nullify

2017-06-04 Thread vit via Digitalmars-d-learn
On Sunday, 4 June 2017 at 09:04:14 UTC, Jonathan M Davis wrote: [...] Why Nullable!T call destroy for reference types?

Re: difference between x = Nullable.init and x.nullify

2017-06-04 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 4 June 2017 at 09:04:14 UTC, Jonathan M Davis wrote: if throwing in a destructor is considered a runtime error, perhaps another valid enhancement would be to statically disallow throwing Exceptions in destructors, i.e. *require* them be nothrow?.. My initial reaction would be

Re: difference between x = Nullable.init and x.nullify

2017-06-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 03, 2017 08:17:18 Stanislav Blinov via Digitalmars-d-learn wrote: > On Saturday, 3 June 2017 at 08:01:14 UTC, Jonathan M Davis wrote: > > On Saturday, June 03, 2017 06:41:44 Stanislav Blinov via > > > > Digitalmars-d-learn wrote: > >> On Saturday, 3 June 2017 at 06:19:29 UTC,

Re: difference between x = Nullable.init and x.nullify

2017-06-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 03, 2017 14:30:05 Kagamin via Digitalmars-d-learn wrote: > On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis wrote: > > Assigning Nullable!Test.init is equivalent to setting the > > internal value to Test.init and setting _isNull to false. > > Eh? Does it mean Nullable

Re: difference between x = Nullable.init and x.nullify

2017-06-03 Thread Kagamin via Digitalmars-d-learn
On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis wrote: Assigning Nullable!Test.init is equivalent to setting the internal value to Test.init and setting _isNull to false. Eh? Does it mean Nullable is default initialized to some non-null default value?

Re: difference between x = Nullable.init and x.nullify

2017-06-03 Thread vit via Digitalmars-d-learn
On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis wrote: [...] thanks

Re: difference between x = Nullable.init and x.nullify

2017-06-03 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 3 June 2017 at 08:01:14 UTC, Jonathan M Davis wrote: On Saturday, June 03, 2017 06:41:44 Stanislav Blinov via Digitalmars-d-learn wrote: On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis wrote: > looking at what rt_finalize does, I don't see why it > couldn't be nothrow.

Re: difference between x = Nullable.init and x.nullify

2017-06-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 03, 2017 06:41:44 Stanislav Blinov via Digitalmars-d-learn wrote: > On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis wrote: > > looking at what rt_finalize does, I don't see why it couldn't > > be nothrow. So, unless I'm missing something, it seems like > > that would

Re: difference between x = Nullable.init and x.nullify

2017-06-03 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 3 June 2017 at 06:19:29 UTC, Jonathan M Davis wrote: looking at what rt_finalize does, I don't see why it couldn't be nothrow. So, unless I'm missing something, it seems like that would be a good enhancement. - Jonathan M Davis Presently, rt_finalize cannot be made nothrow, or

Re: difference between x = Nullable.init and x.nullify

2017-06-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 03, 2017 05:52:55 vit via Digitalmars-d-learn wrote: > Hello, > What's the difference between x = Nullable!Test.init and > x.nullify? > > > class Test{} > > void test()pure nothrow{ > Nullable!Test x; > > x = Nullable!Test.init; //OK > x.nullify;

Re: Difference between dstring and string format specifiers support. Bug?

2016-11-09 Thread Ali Çehreli via Digitalmars-d-learn
On 11/09/2016 01:20 AM, Ali Çehreli wrote: > arrayPtrDiff() is at the bottom of the same file but works correctly > only for char strings: > > https://github.com/dlang/phobos/blob/master/std/format.d#L6573 What I meant is, using arrayPtrDiff() is correct only for char strings. Otherwise,

Re: Difference between dstring and string format specifiers support. Bug?

2016-11-09 Thread Ali Çehreli via Digitalmars-d-learn
On 11/09/2016 12:21 AM, Vadim Lopatin wrote: Looks like bug. dchar[] and wchar[] format strings support less specifiers than char[] import std.format; string test1 = "%02d".format(1); // works assert(test1 == "01"); dstring test2 = "%d"d.format(1); // works

Re: Difference between dstring and string format specifiers support. Bug?

2016-11-09 Thread Vadim Lopatin via Digitalmars-d-learn
On Wednesday, 9 November 2016 at 08:21:53 UTC, Vadim Lopatin wrote: Looks like bug. dchar[] and wchar[] format strings support less specifiers than char[] import std.format; string test1 = "%02d".format(1); // works assert(test1 == "01"); dstring test2 =

Re: Difference between toLower() and asLowerCase() for strings?

2016-01-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 24 January 2016 at 20:56:20 UTC, Jon D wrote: I'm trying to identify the preferred ways to lower case a string. In std.uni there are two functions that return the lower case form of a string: toLower() and asLowerCase(). There is also toLowerInPlace(). toLower will allocate a new

Re: Difference between toLower() and asLowerCase() for strings?

2016-01-24 Thread Jon D via Digitalmars-d-learn
On Sunday, 24 January 2016 at 21:04:46 UTC, Adam D. Ruppe wrote: On Sunday, 24 January 2016 at 20:56:20 UTC, Jon D wrote: I'm trying to identify the preferred ways to lower case a string. In std.uni there are two functions that return the lower case form of a string: toLower() and

Re: Difference between back (`) and double (") quoted strings

2015-09-18 Thread BBasile via Digitalmars-d-learn
On Saturday, 12 September 2015 at 08:13:33 UTC, Bahman Movaqar wrote: Is there any or they are just simply syntactically equivalent? Are there any official docs on this? it's like a raw string (prefixed with a r) so there is escaped char: r"\": correct token for a string, terminal " is not

Re: Difference between back (`) and double (") quoted strings

2015-09-18 Thread BBasile via Digitalmars-d-learn
On Friday, 18 September 2015 at 09:34:38 UTC, BBasile wrote: On Saturday, 12 September 2015 at 08:13:33 UTC, Bahman Movaqar wrote: Is there any or they are just simply syntactically equivalent? Are there any official docs on this? it's like a raw string (prefixed with a r) so there is escaped

Re: Difference between back (`) and double (") quoted strings

2015-09-18 Thread BBasile via Digitalmars-d-learn
On Friday, 18 September 2015 at 09:35:53 UTC, BBasile wrote: On Friday, 18 September 2015 at 09:34:38 UTC, BBasile wrote: On Saturday, 12 September 2015 at 08:13:33 UTC, Bahman Movaqar wrote: Is there any or they are just simply syntactically equivalent? Are there any official docs on this?

Re: Difference between back (`) and double (") quoted strings

2015-09-18 Thread Ali Çehreli via Digitalmars-d-learn
On 09/12/2015 01:13 AM, Bahman Movaqar wrote: Is there any or they are just simply syntactically equivalent? Are there any official docs on this? I realized that there was no index entry for back tick in my book. I've just added that and provided an Index section for the web version of the

Re: Difference between back (`) and double (") quoted strings

2015-09-12 Thread NX via Digitalmars-d-learn
On Saturday, 12 September 2015 at 08:13:33 UTC, Bahman Movaqar wrote: Is there any or they are just simply syntactically equivalent? Are there any official docs on this? What if I told you, you should search the official reference before asking such things in the forum?

Re: Difference between back (`) and double (") quoted strings

2015-09-12 Thread Bahman Movaqar via Digitalmars-d-learn
On 09/12/2015 12:52 PM, NX wrote: > What if I told you, you should search the official reference before > asking such things in the forum? I did search the net for terms such as "d lang back quoted string" or "d lang multi line string" or "d lang string interpolation" before asking here. However

Re: Difference between back (`) and double (") quoted strings

2015-09-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 12 September 2015 at 08:22:03 UTC, NX wrote: What if I told you, you should search the official reference before asking such things in the forum? Searching is kinda hard, so I encourage people to ask if something doesn't come up quickly. And then we need to be sure to always

Re: Difference between concatenation and appendation

2015-01-25 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 26 January 2015 at 01:57:04 UTC, bearophile wrote: Laeeth Isharc: I think concatenation and append are used as synonyms (the same meaning is meant). a~=b or a=a~b a=a~b always allocates a new array, while a~=b sometimes re-allocates in place. Bye, bearophile Perfect! Thank

Re: Difference between concatenation and appendation

2015-01-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, January 26, 2015 01:17:15 WhatMeWorry via Digitalmars-d-learn wrote: Ok, I just made up that word. But what is the difference between appending and concatenating? Page 100 of TPDL says The result of the concatenation is a new array... and the section on appending talks about

Re: Difference between concatenation and appendation

2015-01-25 Thread Laeeth Isharc via Digitalmars-d-learn
On Monday, 26 January 2015 at 01:17:17 UTC, WhatMeWorry wrote: Ok, I just made up that word. But what is the difference between appending and concatenating? Page 100 of TPDL says The result of the concatenation is a new array... and the section on appending talks about possibly needing

Re: Difference between concatenation and appendation

2015-01-25 Thread Laeeth Isharc via Digitalmars-d-learn
On Monday, 26 January 2015 at 01:57:04 UTC, bearophile wrote: Laeeth Isharc: I think concatenation and append are used as synonyms (the same meaning is meant). a~=b or a=a~b a=a~b always allocates a new array, while a~=b sometimes re-allocates in place. Bye, bearophile Thanks. That

Re: Difference between concatenation and appendation

2015-01-25 Thread 岩倉 澪
On Monday, 26 January 2015 at 01:17:17 UTC, WhatMeWorry wrote: Ok, I just made up that word. But what is the difference between appending and concatenating? Page 100 of TPDL says The result of the concatenation is a new array... and the section on appending talks about possibly needing

Re: Difference between concatenation and appendation

2015-01-25 Thread bearophile via Digitalmars-d-learn
Laeeth Isharc: I think concatenation and append are used as synonyms (the same meaning is meant). a~=b or a=a~b a=a~b always allocates a new array, while a~=b sometimes re-allocates in place. Bye, bearophile

Re: Difference between is and ==

2014-02-04 Thread Martijn Pot
On Tuesday, 4 February 2014 at 08:08:30 UTC, Suliman wrote: What difference between if ((x = stdin.readln().chomp) is q) and if ((x = stdin.readln().chomp) == q) ? My interpretation of tdpl p57: 'is' compares for alias equality for arrays and classes. Otherwise they are the same.

Re: Difference between is and ==

2014-02-04 Thread Suliman
My interpretation of tdpl p57: 'is' compares for alias equality for arrays and classes. Otherwise they are the same. So should next code have same behavior if I will use is instead of == import std.stdio; import std.string; void main() { getchar(); } void getchar() {

Re: Difference between is and ==

2014-02-04 Thread Martijn Pot
On Tuesday, 4 February 2014 at 08:25:18 UTC, Suliman wrote: My interpretation of tdpl p57: 'is' compares for alias equality for arrays and classes. Otherwise they are the same. So should next code have same behavior if I will use is instead of == import std.stdio; import std.string; void

Re: Difference between is and ==

2014-02-04 Thread bearophile
Suliman: What difference between if ((x = stdin.readln().chomp) is q) and if ((x = stdin.readln().chomp) == q) ? is performs a raw comparison of just the values, and the value of a string is its ptr and length field. While == compares their contents. So you want to use == here because you

Re: Difference between is and ==

2014-02-04 Thread Steven Schveighoffer
On Tue, 04 Feb 2014 03:08:28 -0500, Suliman everm...@live.ru wrote: What difference between if ((x = stdin.readln().chomp) is q) and if ((x = stdin.readln().chomp) == q) ? The first compares the pointer of the arrays. The second compares the contents of the array. Both check length as well

Re: Difference between DList and SList from garbage collector point of view

2013-02-25 Thread Alexandr Druzhinin
25.02.2013 3:59, monarch_dodra пишет: I don't see any any calls to remove, so I'm not sure what the algorithm is. Wouldn't patch just grow and grow and grow? Regardless, the design of DList is currently flawed (but a pull is open to fix it), in the sense that a DList is just a handle on a

Re: Difference between DList and SList from garbage collector point of view

2013-02-24 Thread monarch_dodra
On Sunday, 24 February 2013 at 20:16:26 UTC, Alexandr Druzhinin wrote: I used in my application DList (code is large and I couldn't reduce it) and the application allocates memory always. I can not realize why and don't know it now. But when I replaced DList by SList (and even dynamic array)

Re: Difference between stack-allocated class and struct

2011-05-03 Thread Sean Cavanaugh
Here is my prototype COM compile-time reflection based wrapper mixin (which I have abandoned in favor of alias this since it covers 95% of my use cases even though it isn't perfectly safe). I am new at D so you have been warned, though this part of the language seems pretty straightforward

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Jonathan M Davis
What are the differences between class instantiated by scope and struct itself? Two, that comes to my mind are: - vtable existance (yep, struct with inheritation - that's what i like) - lol, i just forgot while writing this e-mail First off, I would point out that scoped classes are going

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Mariusz Gliwiński
Firstly, thanks for comprehensive answer and I'd like to excuse for my stupid mistakes, which are caused by learning a lot and not actually programming. On date 2011-05-02 23:03, Jonathan M Davis wrote: Classes are reference types and are meant to be on the heap. Yeah, value vs reference

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Jonathan M Davis
Firstly, thanks for comprehensive answer and I'd like to excuse for my stupid mistakes, which are caused by learning a lot and not actually programming. On date 2011-05-02 23:03, Jonathan M Davis wrote: Classes are reference types and are meant to be on the heap. Yeah, value vs

Re: Difference between stack-allocated class and struct

2011-05-02 Thread Piotr Szturmaj
Mariusz Gliwiński wrote: I'll clarify myself: All i would need is extending - without polymorphism. Containment, can be solution for fields which doesn't annoys so much (although image in auto-generated documentation, just like it's with subclassing, would be nice). Unfortunately, the worse case