Must ranges have value semantics?

2015-12-15 Thread Chris Wright via Digitalmars-d-learn
I noticed that some methods in Phobos will have very different behavior with forward ranges that have reference semantics and those that have value semantics. Example: auto range = getSomeRange(); auto count = range.walkLength; foreach (element; range) { writeln(element); } If getSomeRange

Re: Must ranges have value semantics?

2015-12-15 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Dec 15, 2015 at 05:36:52PM +, Chris Wright via Digitalmars-d-learn wrote: > I noticed that some methods in Phobos will have very different > behavior with forward ranges that have reference semantics and those > that have value semantics. > > Example: > > auto range =

Re: Must ranges have value semantics?

2015-12-15 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 17:36:52 UTC, Chris Wright wrote: I noticed that some methods in Phobos will have very different behavior with forward ranges that have reference semantics and those that have value semantics. Example: auto range = getSomeRange(); auto count =

Re: Balanced match with std.regex

2015-12-15 Thread wobbles via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 02:35:34 UTC, Xinok wrote: On Tuesday, 15 December 2015 at 01:29:39 UTC, Jakob Ovrum wrote: Thanks, that makes sense. String manipulation in D without regex is pretty nice anyway, so it's not a big loss. There is a library named Pegged which can match against

Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-15 Thread Mike McKee via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 07:52:50 UTC, Jacob Carlborg wrote: Could you please add "-v" do the command line when compiling. Mine was completely different: $ dmd -v test.d binarydmd version v2.069 config/usr/local/bin/dmd.conf parse test importall main importobject

Re: Error: undefined identifier 'selector'

2015-12-15 Thread Mike McKee via Digitalmars-d-learn
I found the fix: $ sudo brew update $ sudo brew uninstall --force dmd $ sudo su $ cd /Library $ rm -rfd D $ exit $ sudo brew install dmd This not only takes one from an older dmd to a more current version (in my case, from 2.068 to 2.069), but it also fixes a bug where /Library/D doesn't get

Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-15 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-12-14 20:13, bachmeier wrote: Is it okay if I copy your post to the wiki at this link? http://wiki.dlang.org/Cookbook Please don't. There's a lot of errors and weird things in the post. It doesn't really do what the title says. At least it's not interesting at all since it uses the

Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-15 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-12-15 09:08, Mike McKee wrote: On Tuesday, 15 December 2015 at 07:52:50 UTC, Jacob Carlborg wrote: Could you please add "-v" do the command line when compiling. Mine was completely different: $ dmd -v test.d binarydmd version v2.069 config/usr/local/bin/dmd.conf parse

Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-15 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 07:57:56 UTC, Jacob Carlborg wrote: On 2015-12-14 20:13, bachmeier wrote: Is it okay if I copy your post to the wiki at this link? http://wiki.dlang.org/Cookbook Please don't. There's a lot of errors and weird things in the post. It doesn't really do what the