Re: Replace core language HexStrings with library entity

2015-03-17 Thread Biotronic via Digitalmars-d
On Monday, 16 March 2015 at 12:53:24 UTC, Nick Treleaven wrote: 0b1010 binary literals (even though C++11 supports them) 0xABCD hex literals (but useful for porting C) And while we're at it, why not remove those pesky base-10 literals as well? Shouldn't be too hard to write dec!"123456" instead

T.zero and T.one for numeric types

2015-04-17 Thread Biotronic via Digitalmars-d
I've been writing a lot of generic code lately that has to deal with various kinds of numbers, and have near been driven nuts by the fact there is no uniform way to get a zero or one. Consider: void foo(T)(T a) {} foo!T(0); Does this work with all built-in numeric types? Yes. Does it w

Re: T.zero and T.one for numeric types

2015-04-17 Thread Biotronic via Digitalmars-d
On Friday, 17 April 2015 at 13:33:36 UTC, Adam D. Ruppe wrote: On Friday, 17 April 2015 at 13:27:19 UTC, Biotronic wrote: void foo(T)(T a) {} foo!T(0); Does foo(T(0)); work? It seems like it should void foo(T)(T a) {} import std.bigint; import std.complex; void main() { foo(BigI

Re: on the length of symbols

2015-05-11 Thread Biotronic via Digitalmars-d
https://imgflip.com/i/lcf39

Re: [your code here] HexViewer

2017-08-03 Thread Biotronic via Digitalmars-d
On Thursday, 3 August 2017 at 08:47:12 UTC, Martin Tschierschke wrote: Can you point me to the explanation of this: %(%02X %)%*s %s ? https://dlang.org/phobos/std_format.html Under "Example using array and nested array formatting:" writefln("My items are %(%s %).", [1,2,3]); So "%( %)" is

Re: newCTFE Status August 2017

2017-08-14 Thread Biotronic via Digitalmars-d
On Monday, 14 August 2017 at 11:25:14 UTC, Stefan Koch wrote: On Tuesday, 1 August 2017 at 21:27:32 UTC, Stefan Koch wrote: [ ... ] Guys, newCTFE is green on 64 and 32bit! I've finally fixed || and &&. For good! whoho ;) Release is coming closer! There are times I wish the D foru

Re: Stefan Koch: New CTFE fix

2017-08-16 Thread Biotronic via Digitalmars-d
On Tuesday, 15 August 2017 at 16:10:40 UTC, Johnson wrote: I'm sorry, but you are obviously someone in *need* to prove something. No need to respond, ever. You need to grow up. When Moritz commented on your use of 'do' as a function name, that may have been unnecessary for a discussion of you

Re: Interpolated strings

2017-08-24 Thread Biotronic via Digitalmars-d
On Thursday, 24 August 2017 at 11:07:16 UTC, Suliman wrote: All modern languages like Dart and C# have string interpolation. Sharp example: Console.WriteLine($"Hello {args[0]}!"); Who can summary is there any objective reasons why it's not realized in D? As Raymond Chen once said[1], becaus

Re: HTOD

2017-08-24 Thread Biotronic via Digitalmars-d
On Friday, 25 August 2017 at 00:43:56 UTC, Walter Bright wrote: On 8/24/2017 12:08 PM, Jacob Carlborg wrote: D can already link with C++, but not all features are supported. Like lambdas, for example, are not supported. I have no idea how that would even work. Since lambdas are nested functio

Re: Finding class template instantiations via runtime reflection (for openmethods)

2017-09-25 Thread Biotronic via Digitalmars-d
On Monday, 25 September 2017 at 13:45:05 UTC, Jean-Louis Leroy wrote: Thank you all for your input. I will file a bug report. Just reopen the old one: https://issues.dlang.org/show_bug.cgi?id=2484 -- Biotronic

Re: Multiline string literal improvements

2017-10-13 Thread Biotronic via Digitalmars-d
On Tuesday, 10 October 2017 at 22:16:00 UTC, sarn wrote: On Tuesday, 10 October 2017 at 21:38:41 UTC, captaindet wrote: string a = |q{ firstLine(); if (cond) { secondLine() }   }; you could write your own

Re: My two cents

2017-10-24 Thread Biotronic via Digitalmars-d
On Monday, 23 October 2017 at 12:48:33 UTC, Atila Neves wrote: On Monday, 23 October 2017 at 09:13:45 UTC, Satoshi wrote: writeln(`Foo is {foo} and bar is {bar}`); writeln("Foo is ", foo, "and bar is ", bar"); Two more characters. You have actually demonstrates exactly what I feel is the ma

Re: a linking error very hard to understand and solve...

2017-11-02 Thread Biotronic via Digitalmars-d
On Thursday, 2 November 2017 at 11:13:34 UTC, Jean-Yves Vion-Dury wrote: src\stores.d(178): Error: none of the overloads of 'spawnFiber' are callable using argument types (void delegate(LRMSFiber f), string, uint, string), candidates are: src\fiberManager.d(77): fiberManager.FiberManager

Re: Project Elvis

2017-11-06 Thread Biotronic via Digitalmars-d
On Monday, 6 November 2017 at 10:12:11 UTC, Jonathan M Davis wrote: x ? x : y and make it x ?: y It saves 2 characters plus the length of the variable name. That's it. I find I often use this in C# with a more complex expression on the left-hand side, like a function call. A quick search s

Re: DConf 2018 Logo

2017-11-17 Thread Biotronic via Digitalmars-d
On Wednesday, 15 November 2017 at 14:56:53 UTC, Andrei Alexandrescu wrote: Hello, for all of you with expertise in graphics, we'd be in your debt if you could create a logo for DConf 2018. Proposals would be appreciated! Thanks, Andrei Hastily scribbled on graph paper because I liked the id

Re: Introducing Nullable Reference Types in C#. Is there hope for D, too?

2017-11-20 Thread Biotronic via Digitalmars-d
On Monday, 20 November 2017 at 08:49:41 UTC, rumbu wrote: In fact, this is the introduction of a new operator "!", probably named "I know better" operator. It's called the "bang" operator, because of how things blow up when you're wrong.

Re: Adding Markdown to Ddoc

2017-12-12 Thread Biotronic via Digitalmars-d
On Tuesday, 12 December 2017 at 16:12:50 UTC, Adam D. Ruppe wrote: Ugh. Or why is _this_ italic? I know! /This should be italic./ _This should be underlined._ How anyone could manage to mess those up is way beyond me. Some digging indicates it's a decision based on the fact that both are use

Re: RFC: patch statement

2017-04-03 Thread Biotronic via Digitalmars-d
On Monday, 3 April 2017 at 11:16:57 UTC, Dejan Lekic wrote: I know people her do not like to see proposals that change (add stuff to) the language. However, I strongly feel that for the testing purposes D should provide means to patch any object (no matter whether it is final or not!). Therefor

Re: The cost of doing compile time introspection

2017-05-10 Thread Biotronic via Digitalmars-d
On Wednesday, 10 May 2017 at 11:45:05 UTC, Moritz Maxeiner wrote: [CTFE slow] First, as you may know, Stefan Koch is working on an improved CTFE engine that will hopefully make things a lot better. As for making the code faster right now, could this be done with mixin templates instead? Som

Re: Checked vs unchecked exceptions

2017-06-27 Thread Biotronic via Digitalmars-d
On Monday, 26 June 2017 at 19:31:53 UTC, Moritz Maxeiner wrote: the good *way* to achieve this result would be the following: - When visiting `startFoo`, the compiler automatically aggregates all different exceptions it may throw and stores the resulting set - If `startFoo` is going to be part

Re: Checked vs unchecked exceptions

2017-07-07 Thread Biotronic via Digitalmars-d
On Thursday, 6 July 2017 at 14:59:10 UTC, Crayo List wrote: On Wednesday, 5 July 2017 at 21:05:04 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 5 July 2017 at 15:48:33 UTC, Crayo List wrote: What happens to the 3000 direct and indirect calls to open() ? Notice how the 'interface' has not chang

Re: Interfaces, traits, concepts, and my idea for a DIP

2015-07-31 Thread Biotronic via Digitalmars-d
On Thursday, 30 July 2015 at 10:40:59 UTC, Atila Neves wrote: There's still the problem of having two names for each constraint: checkInputRange and isInputRange. But... we could also establish the convention of checkXXX and use string mixins to turn this: @satifies!(isInputRange, MyRange) i

Re: extern(C++, ns)

2016-01-12 Thread Biotronic via Digitalmars-d
On Tuesday, 12 January 2016 at 04:29:00 UTC, Manu wrote: Can you see the pointless-ness of this feature and the effort being asked? It is against my interest to spend time (that I don't have) to make this feature work, when I am 100% convinced it is a massive anti-feature and I just want to see

Re: Documentation unittests are seriously awesome

2016-09-26 Thread Biotronic via Digitalmars-d
On Monday, 26 September 2016 at 09:35:32 UTC, Anonymouse wrote: On Friday, 23 September 2016 at 20:42:26 UTC, Nick Sabalausky wrote: Just had to say it. Been using it a lot this week. Referring to this stuff: /// Does foo stuff void foo() {} /// unittest { //