Binary search

2015-12-14 Thread tsbockman via Digitalmars-d-learn
Is there no way to do a simple binary search of a sorted array using Phobos? I found `SortedRange.contains`, but that just returns true/false. I want the index of the element, or the element itself. I also found `SortedRange.equalRange`, but that sounds like it has an unreasonable amount of

Re: Binary search

2015-12-14 Thread Jakob Ovrum via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 00:22:37 UTC, tsbockman wrote: I also found `SortedRange.equalRange`, but that sounds like it has an unreasonable amount of (admittedly O(1)) overhead for the (extremely common) case in which I am looking for only a single element, not a range. If your array

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Chris Wright via Digitalmars-d
On Mon, 14 Dec 2015 18:45:28 -0500, Steven Schveighoffer wrote: > On 12/14/15 2:04 PM, bachmeier wrote: >> It's unanimous, at least among the three of us posting in this Reddit >> thread: >> >> https://www.reddit.com/r/programming/comments/3wqt3p/

Re: Balanced match with std.regex

2015-12-14 Thread Chris Wright via Digitalmars-d-learn
On Tue, 15 Dec 2015 00:16:41 +, Jakob Ovrum wrote: > Is there a way to do balanced match with std.regex? > > Example (from [1]): > > test -> funcPow((3),2) * (9+1) > > I want to match the funcPow((3),2) bit, regardless of the depth of the > expression in funcPow(*). > >

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread carljv via Digitalmars-d
On Tuesday, 15 December 2015 at 02:34:01 UTC, Steven Schveighoffer wrote: Find will handle just about any call you can think of. How can the docs just say this concisely? -Steve I think it's an interesting question to what extent template constraints are actually suitable at all as human

Re: Error: undefined identifier 'selector'

2015-12-14 Thread Meta via Digitalmars-d-learn
On Monday, 14 December 2015 at 23:34:28 UTC, tcak wrote: On Monday, 14 December 2015 at 20:46:41 UTC, Mike McKee wrote: When I run this piece of code: // FROM: https://dlang.org/spec/objc_interface.html module main; [...] UDA s cannot be used for functions/methods AFAIK. It doesn't give

Re: splitter overload with terminator predicate requires forward range

2015-12-14 Thread Ali Çehreli via Digitalmars-d
On 12/14/2015 05:06 AM, Luís Marques wrote: The documentation for one of the overloads of std.algorithm.splitter claims to require an input range in the Parameters section, and a forward range in the function signature (template constraint) section: auto splitter(alias isTerminator,

Balanced match with std.regex

2015-12-14 Thread Jakob Ovrum via Digitalmars-d-learn
Is there a way to do balanced match with std.regex? Example (from [1]): test -> funcPow((3),2) * (9+1) I want to match the funcPow((3),2) bit, regardless of the depth of the expression in funcPow(*). https://stackoverflow.com/questions/7898310/using-regex-to-balance-match-parenthesis [1]

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread cym13 via Digitalmars-d
On Tuesday, 15 December 2015 at 01:50:07 UTC, tcak wrote: On Tuesday, 15 December 2015 at 01:10:01 UTC, Chris Wright wrote: [...] Hiding conditionals does not seem like to be solution. Here is my idea: Show the function: bool isSameLength(Range1, Range2)(Range1 r1, Range2 r2) Then show

Re: Balanced match with std.regex

2015-12-14 Thread Xinok via Digitalmars-d-learn
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 balanced parens:

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Steven Schveighoffer via Digitalmars-d
On 12/14/15 9:34 PM, Steven Schveighoffer wrote: InputRange find(alias pred = "a == b", InputRange, Element)(InputRange haystack, Element needle) if (isInputRange!InputRange && is(typeof(binaryFun!pred(haystack.front, needle)) : bool)); InputRange find(alias pred, InputRange)(InputRange

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Steven Schveighoffer via Digitalmars-d
On 12/14/15 2:04 PM, bachmeier wrote: It's unanimous, at least among the three of us posting in this Reddit thread: https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/cxyqxuz Something has to be done with the documentation for Phobos

Re: Binary search

2015-12-14 Thread tsbockman via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 00:31:45 UTC, Jakob Ovrum wrote: On Tuesday, 15 December 2015 at 00:22:37 UTC, tsbockman wrote: I also found `SortedRange.equalRange`, but that sounds like it has an unreasonable amount of (admittedly O(1)) overhead for the (extremely common) case in which I am

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Steven Schveighoffer via Digitalmars-d
On 12/14/15 8:50 PM, tcak wrote: Hiding conditionals does not seem like to be solution. Here is my idea: Show the function: bool isSameLength(Range1, Range2)(Range1 r1, Range2 r2) Then show the conditions separately: if( isInputRange!Range1 && isInputRange!Range2 && !isInfinite!Range1

Re: Error: undefined identifier 'selector'

2015-12-14 Thread tcak via Digitalmars-d-learn
On Monday, 14 December 2015 at 20:46:41 UTC, Mike McKee wrote: When I run this piece of code: // FROM: https://dlang.org/spec/objc_interface.html module main; [...] UDA s cannot be used for functions/methods AFAIK.

Re: Binary search

2015-12-14 Thread Jakob Ovrum via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 00:31:45 UTC, Jakob Ovrum wrote: For sorted arrays you won't find any other standard facility for doing binary search, but the containers RedBlackTree and BinaryHeap provide something related. You could also get the upper bound (SortedRange.upperBound) and

Re: Balanced match with std.regex

2015-12-14 Thread Jakob Ovrum via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 01:07:32 UTC, Chris Wright wrote: I don't think so. std.regex looks like it implements only a deterministic finite automaton, whereas what you are looking for requires a push-down automaton. It just so happens that a few popular regex libraries implement PDAs

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread tcak via Digitalmars-d
On Tuesday, 15 December 2015 at 01:10:01 UTC, Chris Wright wrote: On Mon, 14 Dec 2015 18:45:28 -0500, Steven Schveighoffer wrote: On 12/14/15 2:04 PM, bachmeier wrote: It's unanimous, at least among the three of us posting in this Reddit thread:

[Issue 15399] unaligned pointers are not @safe

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15399 yebblies changed: What|Removed |Added CC||yebbl...@gmail.com ---

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

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
I finally managed to get it working, using some help from this forum and stackoverflow.com, and a little bit of random luck with tests. // test.d extern (C++) immutable(char)* dfunc(const char *s) { import std.string; return toStringz(fromStringz(s) ~ "-response"); } I

[Issue 15437] documentation for typeof(someTemplate) == void

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #1 from Sobirari Muhomori --- IIRC, typeof(fun) gives the function's return type. --

Re: isExpressions -> isValuesSeq

2015-12-14 Thread Shriramana Sharma via Digitalmars-d
Mike Parker wrote: > Consider what would happen if they did not evaluate expressions: I never said they should not evaluate expressions. Expressions are always evaluated in any context in D, but they are immediately converted to values (so long as they are evaluable). But for this very reason,

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

2015-12-14 Thread Ali Çehreli via Digitalmars-d-learn
On 12/14/2015 02:09 AM, Mike McKee wrote: I finally managed to get it working Congratulations! But this is not the right medium for this blog post. ;) Please polish and publish it somewhere before someone puts it on Reddit now. :) Ali

Re: functional way doing array stuff/ lambda functions

2015-12-14 Thread Namal via Digitalmars-d-learn
On Sunday, 13 December 2015 at 01:01:07 UTC, cym13 wrote: That's because you want to modify it in product passing it by ref. Hmm, that seems different to c++. On Sunday, 13 December 2015 at 11:37:50 UTC, cym13 wrote: As cryptic as it is this means that the range you passed to reduce is

[Issue 15437] documentation for typeof(someTemplate) == void

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #2 from Luís Marques --- But if it is a function *template* then the type will be void. That's what could be better documented, IMHO. --

[Issue 15445] New: Make DMD's command-line options more compatible with other popular C/C++ compilers

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15445 Issue ID: 15445 Summary: Make DMD's command-line options more compatible with other popular C/C++ compilers Product: D Version: D2 Hardware: x86_64 OS: Linux

[OT] tablet programming

2015-12-14 Thread Joakim via Digitalmars-d-announce
On Monday, 14 December 2015 at 15:01:36 UTC, Nick Sabalausky wrote: On 12/12/2015 01:13 AM, Joakim wrote: Desktop Android's certainly not there yet for everybody, but it is for my admittedly low demands, and soon will be for everybody, as google has said they're working on built-in

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Joakim via Digitalmars-d
On Monday, 14 December 2015 at 20:25:17 UTC, bachmeier wrote: On Monday, 14 December 2015 at 19:38:26 UTC, Jack Stouffer wrote: If you're trying to use Phobos without knowing what template constraints and ranges are, you're going to have a bad time. D is doomed if new users have to

[Issue 15446] New: Update DMD's man page

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15446 Issue ID: 15446 Summary: Update DMD's man page Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Andrei Alexandrescu via Digitalmars-d
On 12/14/15 9:34 PM, Steven Schveighoffer wrote: On 12/14/15 8:50 PM, tcak wrote: Hiding conditionals does not seem like to be solution. Here is my idea: Show the function: bool isSameLength(Range1, Range2)(Range1 r1, Range2 r2) Then show the conditions separately: if( isInputRange!Range1

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Jakob Ovrum via Digitalmars-d
On Tuesday, 15 December 2015 at 03:47:30 UTC, Andrei Alexandrescu wrote: We use this pattern in only a couple of places in Phobos, but I think we should generally improve the language to use less, not more, of it. BTW I think all overloads of a given function should be under the same DDOC

Re: Why should file names intended for executables be valid identifiers?

2015-12-14 Thread Jon D via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 03:31:18 UTC, Shriramana Sharma wrote: For instance, hyphens are often used as part of executable names on Linux, but if I do this: $ dmd usage-printer.d I get the following error: usage-printer.d: Error: module usage-printer has non-identifier characters

[Issue 14442] Wrong this.outer reference in nested classes

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14442 --- Comment #4 from Kenji Hara --- This would be a root of issue 15422. Will be fixed by: https://github.com/D-Programming-Language/dmd/pull/5308 --

[Issue 15441] dmd segfaults using std.experimental.ndslice

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15441 John Colvin changed: What|Removed |Added CC|

Re: Voting For std.experimental.ndslice

2015-12-14 Thread Laeeth Isharc via Digitalmars-d
Yes

D Structs(Enums) to Typescript Interfaces(Enums)

2015-12-14 Thread Robert burner Schadek via Digitalmars-d-announce
dstructtotypescript is a program that created typescript interfaces/enums out of D structs/enums. https://github.com/burner/dstructtotypescript The web framework vibe.d was very good at serializing data into json. Typescript allows the user to have a typed version of javascript. Which means

Re: Nullable condition operator

2015-12-14 Thread rumbu via Digitalmars-d
On Monday, 14 December 2015 at 13:19:13 UTC, Martin6265 wrote: I dont said C# is better, just missing some preferred stuffs from other languages. `.?` from C# is same thing as message passing in ObjC. (You can send message to invalid object without accessing null pointer). And I miss that

Re: functional way doing array stuff/ lambda functions

2015-12-14 Thread visitor via Digitalmars-d-learn
On Monday, 14 December 2015 at 11:45:50 UTC, Namal wrote: foreach(k;1..11){ auto t = prim_factors(k,P); v~= [k,product(t)]; } it crashes because your first t in the loop is an empty array because 1 is not a prime ( in "prim_sieve" :

[Issue 15378] dlang.org does not completely work with https:

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15378 --- Comment #5 from Sobirari Muhomori --- When using the search box Firefox gives a warning that request will be sent over unencrypted channel. --

Re: DConf 2016 news: 20% sold out, book signing

2015-12-14 Thread Nick Sabalausky via Digitalmars-d-announce
On 12/12/2015 01:13 AM, Joakim wrote: Desktop Android's certainly not there yet for everybody, but it is for my admittedly low demands, and soon will be for everybody, as google has said they're working on built-in multi-window for the next version of Android. Personally, I would need far

[Issue 15422] [REG2.066] associative array of nested struct - crash on usage

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15422 --- Comment #4 from Kenji Hara --- New PR: https://github.com/D-Programming-Language/dmd/pull/5308 --

[Issue 15442] New: Eponymous template restrictions should be documented

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15442 Issue ID: 15442 Summary: Eponymous template restrictions should be documented Product: D Version: D2 Hardware: All URL: https://dlang.org/spec/template.html OS: All

Re: Use https: for wikipedia links

2015-12-14 Thread wobbles via Digitalmars-d
On Monday, 14 December 2015 at 14:53:20 UTC, Kagamin wrote: On the other hand there's a move to make encrypted protocol the default and leave unencrypted as legacy, so maybe WEB macro should be silently upgraded to https? Full links look better and more intuitive IMO. I think this would be

Re: Use https: for wikipedia links

2015-12-14 Thread Vladimir Panteleev via Digitalmars-d
On Monday, 14 December 2015 at 13:47:12 UTC, Andrei Alexandrescu wrote: One reason for adding WEB is that the ":" confuses ddoc when "http:" is the first word on a line. Can we fix Ddoc to require a space/newline after the : to consider the preceding text a section heading? Also, typing it

[Issue 15447] New: DMD should clean up intermediate .o files it creates

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15447 Issue ID: 15447 Summary: DMD should clean up intermediate .o files it creates Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity:

[Issue 6907] ice(interpret.d) delete expressions crash interpreter

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6907 Kenji Hara changed: What|Removed |Added Keywords||pull --- Comment #2 from

Some feedback on the website.

2015-12-14 Thread deadalnix via Digitalmars-d
Navigation: The navigation can get very confusing. The forum and the site look the same, but the logo in the top right bring back to the site index/forum index . That is not what is expected. If it looks the same, it should probably be doing the same. Especially since the forum index is in

Re: Use https: for wikipedia links

2015-12-14 Thread Kagamin via Digitalmars-d
On Monday, 14 December 2015 at 20:42:54 UTC, Chris Wright wrote: Do you want to mandate that any link from Phobos documentation be to a site that supports SSL? LINK2 supports full URLs with arbitrary schemes.

[Issue 15441] dmd segfaults using std.experimental.ndslice

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15441 Kenji Hara changed: What|Removed |Added Keywords||ice, pull

[Issue 13676] [ddoc] DDoc should wrap each part of function declaration in dedicated macro to allow more readable formatting

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13676 Andrei Alexandrescu changed: What|Removed |Added CC||and...@erdani.com

Re: Why should file names intended for executables be valid identifiers?

2015-12-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 03:31:18 UTC, Shriramana Sharma wrote: I understand that module names need to be valid identifiers in that other modules would need to import them. But when a file is intended to be just an executable, why is it mandatory to give it a module declaration with a

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Andrei Alexandrescu via Digitalmars-d
On 12/14/15 8:10 PM, Chris Wright wrote: version(TangoDoc) { /** Documentation comment. */ bool isSameLangth(Range1, Range2)(Range1 r1, Range2 r2) { return true; } } else { bool isSameLength(Range1, Range2)(Range1 r1, Range2 r2) if ( isInputRange!Range1 &&

Re: Balanced match with std.regex

2015-12-14 Thread crimaniak via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 00:16:41 UTC, Jakob Ovrum wrote: Is there a way to do balanced match with std.regex? It's only possible with (?R) implemented: http://php.net/manual/en/regexp.reference.recursive.php But there is no (?R) in D regex implementation.

Why should file names intended for executables be valid identifiers?

2015-12-14 Thread Shriramana Sharma via Digitalmars-d-learn
I understand that module names need to be valid identifiers in that other modules would need to import them. But when a file is intended to be just an executable, why is it mandatory to give it a module declaration with a valid identifier? For instance, hyphens are often used as part of

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Andrei Alexandrescu via Digitalmars-d
On 12/14/15 4:11 PM, H. S. Teoh via Digitalmars-d wrote: On Mon, Dec 14, 2015 at 08:53:53PM +, Andrei Alexandrescu via Digitalmars-d wrote: One thing we definitely need to do is make the template constraints rendered better in documentation, and also allow user content in them. We've

Re: http://wiki.dlang.org/Starting_as_a_Contributor reorganization

2015-12-14 Thread Andrei Alexandrescu via Digitalmars-d
On 12/14/15 4:14 PM, Vladimir Panteleev wrote: On Monday, 14 December 2015 at 20:47:27 UTC, Andrei Alexandrescu wrote: I see Vladimir and Jack did these changes. Could you please restructure the document into three - one for each of the OSs we support? As long as the text itself is not

[Issue 15446] Update DMD's man page

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15446 --- Comment #1 from Shriramana Sharma --- One important point in updating: Currently the documentation for -o- says that it suppresses output of object files, but this is misleading, since it actually suppresses all binary output

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

2015-12-14 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-12-14 20:20, Mike McKee wrote: Oh, I found I could do: $ sudo brew update $ sudo brew upgrade dmd Alternatively you can install DMD using DVM [1]. Now it generates this error: $ dmd -m64 -L-framework -LFoundation test.d test.d(6): Error: undefined identifier 'selector' test.d(12):

Re: Nullable condition operator

2015-12-14 Thread Martin6265 via Digitalmars-d
I dont said C# is better, just missing some preferred stuffs from other languages. `.?` from C# is same thing as message passing in ObjC. (You can send message to invalid object without accessing null pointer). And I miss that stuff in D. Maybe will create a new instance of T if T is null,

[Issue 15437] documentation for typeof(someTemplate) == void

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #3 from Sobirari Muhomori --- Maybe it's not an intended behavior and type of template should be `template`? --

[Issue 15437] documentation for typeof(someTemplate) == void

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15437 --- Comment #5 from ZombineDev --- Though this would add overlap to the functionality already provided by http://dlang.org/spec/traits.html#isTemplate. Also related: https://github.com/D-Programming-Language/dmd/pull/5201

Re: Nullable condition operator

2015-12-14 Thread ZombineDev via Digitalmars-d
On Monday, 14 December 2015 at 13:19:13 UTC, Martin6265 wrote: Maybe will create a new instance of T if T is null, right? If you look at the code, you will see that it would not.

Inferring an integer literal as ubyte

2015-12-14 Thread Shriramana Sharma via Digitalmars-d-learn
Hello. I was trying to do something like this: ubyte code = to!ubyte(spec, 6) + 16; and got an error saying: cannot implicitly convert expression (cast(int)to(spec, 6) + 16) of type int to ubyte Looking at http://dlang.org/spec/lex.html#IntegerLiteral, sure enough 16 is specified to be

Re: Use https: for wikipedia links

2015-12-14 Thread Andrei Alexandrescu via Digitalmars-d
On 12/13/2015 09:49 PM, Vladimir Panteleev wrote: On Monday, 14 December 2015 at 01:57:49 UTC, Walter Bright wrote: To fix it, I suggest a new macro be created, WEBS, that does https:// and then all the wikipedia links be replaced with WEBS links. I think we should aim to get rid of the WEB

Re: Inferring an integer literal as ubyte

2015-12-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 14 December 2015 at 13:33:41 UTC, Shriramana Sharma wrote: ubyte code = to!ubyte(spec, 6) + 16; That's not an integer literal... that's a runtime value of ubyte plus an integer literal. Since the ubyte is the result of a runtime function, the compiler doesn't know what it will

splitter overload with terminator predicate requires forward range

2015-12-14 Thread Luís Marques via Digitalmars-d
The documentation for one of the overloads of std.algorithm.splitter claims to require an input range in the Parameters section, and a forward range in the function signature (template constraint) section: auto splitter(alias isTerminator, Range)(Range input) if (isForwardRange!Range &&

Re: Inferring an integer literal as ubyte

2015-12-14 Thread Kagamin via Digitalmars-d-learn
They are promoted to int in arithmetic operations unless compiler can prove the value doesn't exceed its range.

[Issue 15437] documentation for typeof(someTemplate) == void

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15437 ZombineDev changed: What|Removed |Added CC|

Re: Use https: for wikipedia links

2015-12-14 Thread Kagamin via Digitalmars-d
On the other hand there's a move to make encrypted protocol the default and leave unencrypted as legacy, so maybe WEB macro should be silently upgraded to https? Full links look better and more intuitive IMO.

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

2015-12-14 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-12-14 11:09, Mike McKee wrote: As for D calling the Apple Foundation Classes, they are, evidently, available to C++, so perhaps they can be loaded in D. They're not available in C++. They're available in Objective-C++, which is a different language. Yes, they can be accessed from D

[Issue 15441] dmd segfaults using std.experimental.ndslice

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15441 Jack Stouffer changed: What|Removed |Added CC||j...@jackstouffer.com

Re: Inferring an integer literal as ubyte

2015-12-14 Thread Shriramana Sharma via Digitalmars-d-learn
Adam D. Ruppe wrote: > but yours won't because to!ubyte(spec, 6) might just be > 240. Thanks for that explanation. That's clear now. -- Shriramana Sharma, Penguin #395953

Re: "Programming in D" ebook is at major retailers

2015-12-14 Thread Ali Çehreli via Digitalmars-d-announce
On 12/13/2015 10:00 PM, Ali Çehreli wrote: https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/ Can somebody answer the question about D that starts with "What about available well maintained libraries for different tasks?" Ali

Re: Use https: for wikipedia links

2015-12-14 Thread Andrei Alexandrescu via Digitalmars-d
On 12/14/2015 10:31 AM, Vladimir Panteleev wrote: On Monday, 14 December 2015 at 13:47:12 UTC, Andrei Alexandrescu wrote: One reason for adding WEB is that the ":" confuses ddoc when "http:" is the first word on a line. Can we fix Ddoc to require a space/newline after the : to consider the

[Issue 15441] dmd segfaults using std.experimental.ndslice

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15441 --- Comment #2 from Jack Stouffer --- Same issue on OS X, so changing this to all OS's. --

Re: Wishlist for D

2015-12-14 Thread tsbockman via Digitalmars-d
On Sunday, 13 December 2015 at 11:25:37 UTC, Ola Fosheim Grøstad wrote: On Sunday, 13 December 2015 at 11:18:31 UTC, Robert burner Schadek wrote: On Saturday, 12 December 2015 at 22:57:55 UTC, Ola Fosheim Grøstad wrote: 2. Debug-mode testing of integer overflow.

Re: Use https: for wikipedia links

2015-12-14 Thread Walter Bright via Digitalmars-d
On 12/14/2015 12:40 PM, Andrei Alexandrescu wrote: As an aside: Wikipedia (and other sites) automatically redirect to https. What advantages do we have by using https directly? I'm sure there's some, but my web-fu could use some guidance. Thanks! I see it does the redirect, and wonder as well

Re: Use https: for wikipedia links

2015-12-14 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 14 December 2015 at 21:35:43 UTC, Walter Bright wrote: I see it does the redirect, and wonder as well if there's an advantage to calling https directly. The end user saves a small amount of time by skipping the redirect. If it is trivial, I'd do it for the snappier load, but I

Re: Wishlist for D

2015-12-14 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 14 December 2015 at 21:27:25 UTC, tsbockman wrote: Doing it right would also be a fundamental breaking change, though, It would require a change away from modular arithmetics as the default, true.

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread dnewbie via Digitalmars-d
On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote: It's unanimous, at least among the three of us posting in this Reddit thread: ... Take for example C# Docs: https://msdn.microsoft.com/en-us/library/system.collections.arraylist.addrange.aspx Syntax C#: public virtual void

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Jack Stouffer via Digitalmars-d
On Monday, 14 December 2015 at 19:56:29 UTC, dnewbie wrote: On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote: It's unanimous, at least among the three of us posting in this Reddit thread: ... Take for example C# Docs:

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread H. S. Teoh via Digitalmars-d
On Mon, Dec 14, 2015 at 08:08:20PM +, Jack Stouffer via Digitalmars-d wrote: > On Monday, 14 December 2015 at 19:56:29 UTC, dnewbie wrote: [...] > >On the otherhand, imagine a newbie looking: > > > >bool isSameLength(Range1, Range2)(Range1 r1, Range2 r2) if > >(isInputRange!Range1 &&

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Basile B. via Digitalmars-d
On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote: It's unanimous, at least among the three of us posting in this Reddit thread: https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/cxyqxuz Something has to be done with the

Re: "Programming in D" ebook is at major retailers

2015-12-14 Thread Ali Çehreli via Digitalmars-d-announce
On 12/14/2015 11:40 AM, Adam D. Ruppe wrote: On Monday, 14 December 2015 at 16:32:57 UTC, Ali Çehreli wrote: Can somebody answer the question about D that starts with "What about available well maintained libraries for different tasks?" I almost did, especially since I personally wrote more

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread H. S. Teoh via Digitalmars-d
On Mon, Dec 14, 2015 at 07:04:46PM +, bachmeier via Digitalmars-d wrote: > It's unanimous, at least among the three of us posting in this Reddit > thread: > > https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/cxyqxuz > > Something has to be

[Issue 15444] New: [Interfacing to Objective-C]

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15444 Issue ID: 15444 Summary: [Interfacing to Objective-C] Product: D Version: D2 Hardware: x86_64 URL: http://dlang.org/ OS: Mac OS X Status: NEW

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread bachmeier via Digitalmars-d
On Monday, 14 December 2015 at 19:50:47 UTC, H. S. Teoh wrote: There is nothing I can do about this. Who makes these decisions? Can we change it to something useful? What would constitute "useful" to you? Removing what is there and leaving it blank would be better. At least new D

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread bachmeier via Digitalmars-d
On Monday, 14 December 2015 at 19:38:26 UTC, Jack Stouffer wrote: If you're trying to use Phobos without knowing what template constraints and ranges are, you're going to have a bad time. D is doomed if new users have to understand template constraints and ranges to use the standard library.

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

2015-12-14 Thread John Colvin via Digitalmars-d-learn
On Monday, 14 December 2015 at 11:12:03 UTC, Ali Çehreli wrote: On 12/14/2015 02:09 AM, Mike McKee wrote: I finally managed to get it working Congratulations! But this is not the right medium for this blog post. ;) Please polish and publish it somewhere before someone puts it on Reddit now.

We need better documentation for functions with ranges and templates

2015-12-14 Thread bachmeier via Digitalmars-d
It's unanimous, at least among the three of us posting in this Reddit thread: https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/cxyqxuz Something has to be done with the documentation for Phobos functions that involve ranges and templates.

Re: Runtime.unloadLibrary terminates application on Windows

2015-12-14 Thread Andre via Digitalmars-d-learn
On Monday, 14 December 2015 at 17:50:26 UTC, Andre wrote: Hi, there is an issue with the example from http://wiki.dlang.org/Win32_DLLs_in_D While executing the DYNAMIC_LOAD version, the application will exit on statement: if (!Runtime.unloadLibrary(h)) Neither "error freeing mydll.dll" nor

Re: Runtime.unloadLibrary terminates application on Windows

2015-12-14 Thread Andre via Digitalmars-d-learn
On Monday, 14 December 2015 at 19:17:00 UTC, Andre wrote: It seems to be a regression https://issues.dlang.org/show_bug.cgi?id=1550 I will open a ticket for this issue https://issues.dlang.org/show_bug.cgi?id=15443

Re: We need better documentation for functions with ranges and templates

2015-12-14 Thread Jack Stouffer via Digitalmars-d
On Monday, 14 December 2015 at 19:04:46 UTC, bachmeier wrote: It's unanimous, at least among the three of us posting in this Reddit thread: https://www.reddit.com/r/programming/comments/3wqt3p/programming_in_d_ebook_is_at_major_retailers_and/cxyqxuz Something has to be done with the

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

2015-12-14 Thread bachmeier via Digitalmars-d-learn
Is it okay if I copy your post to the wiki at this link? http://wiki.dlang.org/Cookbook

[Issue 15443] New: Runtime.unloadLibrary closes input/output stream

2015-12-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15443 Issue ID: 15443 Summary: Runtime.unloadLibrary closes input/output stream Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: regression

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

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
On Monday, 14 December 2015 at 19:13:20 UTC, bachmeier wrote: Is it okay if I copy your post to the wiki at this link? http://wiki.dlang.org/Cookbook Sure! :) Feel free to fix grammar or anything out of sorts (or could be better said), if you want. My goal is to enable more people to be

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

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
On Monday, 14 December 2015 at 18:13:02 UTC, Mike McKee wrote: I think I installed dmd through homebrew. I don't know how to update it -- I'm still green when it comes to homebrew and only know apt-get from Ubuntu Linux. Oh, I found I could do: $ sudo brew update $ sudo brew upgrade dmd Now

Re: "Programming in D" ebook is at major retailers

2015-12-14 Thread Adam D. Ruppe via Digitalmars-d-announce
On Monday, 14 December 2015 at 16:32:57 UTC, Ali Çehreli wrote: Can somebody answer the question about D that starts with "What about available well maintained libraries for different tasks?" I almost did, especially since I personally wrote more than half what he or she is looking for

Re: Use https: for wikipedia links

2015-12-14 Thread Vladimir Panteleev via Digitalmars-d
On Monday, 14 December 2015 at 17:08:46 UTC, Andrei Alexandrescu wrote: At this point, we're heading into "we're wasting time on this" territory and proceed straight to the well known pattern when every little argument is fought for and against like someone's life depended on it. Can we not do

Runtime.unloadLibrary terminates application on Windows

2015-12-14 Thread Andre via Digitalmars-d-learn
Hi, there is an issue with the example from http://wiki.dlang.org/Win32_DLLs_in_D While executing the DYNAMIC_LOAD version, the application will exit on statement: if (!Runtime.unloadLibrary(h)) Neither "error freeing mydll.dll" nor "End..." is written to the console. The application just

  1   2   >