Re: Where do I learn to use GtkD

2018-10-31 Thread helxi via Digitalmars-d-learn
On Tuesday, 30 October 2018 at 14:38:53 UTC, Michelle Long wrote: On Sunday, 13 March 2016 at 19:28:57 UTC, karabuta wrote: Gtk3 from python3 has got I nice book with examples that are not so advanced but enough to get you doing real work(from a beginner point of view). GtkD seem to have

Re: CT BitArray

2018-10-31 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 31 October 2018 at 23:14:08 UTC, Bastiaan Veelo wrote: Currently, BitArray is not usable at compile time, so you cannot do ``` enum e = BitArray([1, 1, 1, 0]); ``` This gives /dlang/dmd/linux/bin64/../../src/phobos/std/bitmanip.d(1190): Error: `bts` cannot be interpreted at

CT BitArray

2018-10-31 Thread Bastiaan Veelo via Digitalmars-d-learn
Currently, BitArray is not usable at compile time, so you cannot do ``` enum e = BitArray([1, 1, 1, 0]); ``` This gives /dlang/dmd/linux/bin64/../../src/phobos/std/bitmanip.d(1190): Error: `bts` cannot be interpreted at compile time, because it has no available source code IIUC, that is

Re: std.math log and family

2018-10-31 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Oct 31, 2018 at 11:29:17AM +, kinke via Digitalmars-d-learn wrote: > On Wednesday, 31 October 2018 at 01:26:19 UTC, H. S. Teoh wrote: > > Is it true that on modern hardware computing with `real` reverts to > > slow x87 emulation in the CPU instead of using SSE/MMX/whatever > > native

Re: How in the name of D do you deal with more than one optional template parameter?

2018-10-31 Thread aliak via Digitalmars-d-learn
On Tuesday, 30 October 2018 at 21:19:13 UTC, H. S. Teoh wrote: On Tue, Oct 30, 2018 at 08:46:31PM +, aliak via Digitalmars-d-learn wrote: [...] struct C(Args...) if ((rest.length == 2 && is(Args[0] == B!C, C) && is(Args[1] == string)) || (rest.length == 1 && (is(Args[0] ==

Re: expanding variadic into format

2018-10-31 Thread Codifies via Digitalmars-d-learn
On Wednesday, 31 October 2018 at 12:54:52 UTC, Stanislav Blinov wrote: On Wednesday, 31 October 2018 at 12:13:57 UTC, Codifies wrote: [...] [...] As rikki already explained, std.format is a variadic template, which gets expanded into argument list at compile time. That's why it can't be

Re: expanding variadic into format

2018-10-31 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 31 October 2018 at 12:13:57 UTC, Codifies wrote: On Wednesday, 31 October 2018 at 12:09:04 UTC, Stanislav Blinov wrote: ``` void printValue(Args...)(Font fnt, float x, float y, string frmt, auto ref Args args) { // ... import std.functional : forward; string

Re: expanding variadic into format

2018-10-31 Thread rikki cattermole via Digitalmars-d-learn
On 01/11/2018 1:08 AM, Codifies wrote: On Wednesday, 31 October 2018 at 11:56:31 UTC, rikki cattermole wrote: On 01/11/2018 12:53 AM, Codifies wrote: [...] Just to confirm, format there is std.format:format right? Because that isn't using C variadics, its using template variadics. thought

Re: expanding variadic into format

2018-10-31 Thread Codifies via Digitalmars-d-learn
On Wednesday, 31 October 2018 at 12:09:04 UTC, Stanislav Blinov wrote: On Wednesday, 31 October 2018 at 11:53:52 UTC, Codifies wrote: void printValue(Font fnt,float x, float y, string frmt, ...) { /* matrix math and other stuff removed for readability */ string message = format(frmt,

Re: expanding variadic into format

2018-10-31 Thread Codifies via Digitalmars-d-learn
On Wednesday, 31 October 2018 at 11:56:31 UTC, rikki cattermole wrote: On 01/11/2018 12:53 AM, Codifies wrote: [...] Just to confirm, format there is std.format:format right? Because that isn't using C variadics, its using template variadics. thought I was using core.vararg and std.format

Re: expanding variadic into format

2018-10-31 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 31 October 2018 at 11:53:52 UTC, Codifies wrote: void printValue(Font fnt,float x, float y, string frmt, ...) { /* matrix math and other stuff removed for readability */ string message = format(frmt, _arguments); is there some way to somehow transfer my input variadic

Re: expanding variadic into format

2018-10-31 Thread rikki cattermole via Digitalmars-d-learn
On 01/11/2018 12:53 AM, Codifies wrote: I have a routine that was happily printing ASCII strings and values using opengl, however I want to improve it so it can be used in the same manner as some other languages printf function... void printValue(Font fnt,float x, float y, string frmt, ...) {

expanding variadic into format

2018-10-31 Thread Codifies via Digitalmars-d-learn
I have a routine that was happily printing ASCII strings and values using opengl, however I want to improve it so it can be used in the same manner as some other languages printf function... void printValue(Font fnt,float x, float y, string frmt, ...) { /* matrix math and other stuff

Re: std.math log and family

2018-10-31 Thread kinke via Digitalmars-d-learn
On Wednesday, 31 October 2018 at 01:26:19 UTC, H. S. Teoh wrote: Is it true that on modern hardware computing with `real` reverts to slow x87 emulation in the CPU instead of using SSE/MMX/whatever native math functions? You should have read recent DMD & LDC release notes. ;)