As a newbie in D (and making a lots of mistakes), I've found
myself relying heavily in the use of a rudimentary type inspector
to visualize my templated code instantiations.
It's simple and incomplete as hell but good enough to see what
happens under the hood quickly.
QUESTION: Is there a func
On Wednesday, April 04, 2018 04:54:50 Ali via Digitalmars-d-learn wrote:
> I am going through the Learning D book by Michael Parker
> So every now and then I will make post about the book
> either critics of the book, book content or questions
>
>
> First critic
> chapter 2 - the special package mo
On Wednesday, 4 April 2018 at 04:54:50 UTC, Ali wrote:
at first i though package.d is special name, as in i must call
the file package.d or this trick or idiom to work
the trick was to have one module that public import all the
modules you import as group in other modules
so instead of impor
I am going through the Learning D book by Michael Parker
So every now and then I will make post about the book
either critics of the book, book content or questions
First critic
chapter 2 - the special package module
this small section, suggest an idiom to create a package which
can have any n
On Tuesday, 3 April 2018 at 18:49:00 UTC, Carlos Navarro wrote:
QUESTION:
Obviously I'm no geting mixins/templates nor traits and I'm
failing miserably to find/identify the right examples or
documentation to help me tackle this thing. What is wrong in
this code? is this pattern sintactically
On Tuesday, 3 April 2018 at 20:02:46 UTC, Vladimirs Nordholm
wrote:
On Tuesday, 3 April 2018 at 19:53:11 UTC, Meta wrote:
On Tuesday, 3 April 2018 at 19:02:25 UTC, Vladimirs Nordholm
wrote:
[...]
In this specific case, since you know the length of `Args`,
you can pre-allocate an array of tha
On Tuesday, 3 April 2018 at 20:02:46 UTC, Vladimirs Nordholm
wrote:
On Tuesday, 3 April 2018 at 19:53:11 UTC, Meta wrote:
On Tuesday, 3 April 2018 at 19:02:25 UTC, Vladimirs Nordholm
wrote:
[...]
In this specific case, since you know the length of `Args`,
you can pre-allocate an array of tha
On Tuesday, 3 April 2018 at 19:53:11 UTC, Meta wrote:
On Tuesday, 3 April 2018 at 19:02:25 UTC, Vladimirs Nordholm
wrote:
[...]
In this specific case, since you know the length of `Args`, you
can pre-allocate an array of that size and loop through it
doing your initialization.
However, if
On Tuesday, 3 April 2018 at 19:41:54 UTC, Alex wrote:
On Tuesday, 3 April 2018 at 19:31:50 UTC, Vladimirs Nordholm
wrote:
[...]
Would labelling help?
https://run.dlang.io/is/vE1KyD
Ah! Okay, now I see.
Thanks Alex and Adam!
On Tuesday, 3 April 2018 at 19:02:25 UTC, Vladimirs Nordholm
wrote:
Hello people.
I currently have a function which multiple times per second
takes in arguments, and appends the argument as my special
type. The following code should explain what I do more properly:
struct MySpecialType {
On Tuesday, 3 April 2018 at 19:31:50 UTC, Vladimirs Nordholm
wrote:
switch(foo)
Put the label on the switch
whatever: switch(foo)
mixin(format("
case Foo.%s:bar = Bar.%s;break;
", f, f));
then use the label here
break whatever;
On Tuesday, 3 April 2018 at 19:31:50 UTC, Vladimirs Nordholm
wrote:
My base problem is that I want to mixin `break` into a switch
statement, but the mixin is within a static foreach. Take a
look at the following code:
switch(foo)
{
static foreach(f; EnumMembers!Foo)
{
My base problem is that I want to mixin `break` into a switch
statement, but the mixin is within a static foreach. Take a look
at the following code:
switch(foo)
{
static foreach(f; EnumMembers!Foo)
{
mixin(format("
case Foo.%s:bar = Bar.%
On Tuesday, 3 April 2018 at 18:57:29 UTC, WebFreak001 wrote:
you need to use a static foreach for this. You can insert a
static foreach basically where you can insert a function
definition like void foo() {}
foreach is more like a function call like foo(), so you can't
put it in the mixin t
Hello people.
I currently have a function which multiple times per second takes
in arguments, and appends the argument as my special type. The
following code should explain what I do more properly:
struct MySpecialType { char c; }
auto foo(Args...)(Args args)
{
MySpecialT
On Tuesday, 3 April 2018 at 18:49:00 UTC, Carlos Navarro wrote:
QUESTION:
Obviously I'm no geting mixins/templates nor traits and I'm
failing miserably to find/identify the right examples or
documentation to help me tackle this thing. What is wrong in
this code? is this pattern sintactically
On Monday, 2 April 2018 at 15:05:04 UTC, Seb wrote:
On Monday, 2 April 2018 at 14:51:57 UTC, Vladimirs Nordholm
wrote:
On Monday, 2 April 2018 at 14:20:49 UTC, Dennis wrote:
[...]
Ah! First time I read the docs I didn't understand the
typeof(exp) explanation, but yours made me understand tha
QUESTION:
Obviously I'm no geting mixins/templates nor traits and I'm
failing miserably to find/identify the right examples or
documentation to help me tackle this thing. What is wrong in this
code? is this pattern sintactically possible? what I'm getting
wrong?
CONTEXT:
I'm a newbie trying
On Monday, 2 April 2018 at 15:15:05 UTC, Dennis wrote:
On Monday, 2 April 2018 at 14:51:57 UTC, Vladimirs Nordholm
wrote:
Do you think I should I omit the @property tag, if the only
wanted behaviour is to set a value (`foo.bar = "baz";`) ?
You're probably fine either way, it's mostly for makin
The Dogme method, based on the writing of Scott Thornbury,
“considers language learning to be a process where language
emerges rather than one where it is acquired”. The entire method
is based on conversation and the teaching (or in group lessons
‘moderation’) as such does not follow specific s
On Tuesday, 3 April 2018 at 15:02:34 UTC, markmst wrote:
Why Pay For Learning a Foreign
I actually read this until "Why Pay For Learning a Foreign
Language". I didn't get the joke... Go figure..
Many language learners will have a similar story to narrate. They
have often used a foreign word accidentally, which may sound
similar in the English as well as in the target language and yet
are completely different in their meanings, Such linguistic
goof-ups are referred to as "false friends"
On Tuesday, 3 April 2018 at 13:12:05 UTC, Timoses wrote:
On Tuesday, 3 April 2018 at 05:20:55 UTC, Seb wrote:
Better diagnostics and error messages is a key goal in 2018
for dmd ;-)
Awesome! How about telling the user which of the template
constraints failed? Would be so awesome. Currently, t
On Tuesday, 3 April 2018 at 05:20:55 UTC, Seb wrote:
Better diagnostics and error messages is a key goal in 2018 for
dmd ;-)
Awesome! How about telling the user which of the template
constraints failed? Would be so awesome. Currently, there's a
need to check every single one (as mentioned by
On Tuesday, 3 April 2018 at 02:10:09 UTC, helxi wrote:
For reference:
https://en.cppreference.com/w/cpp/utility/optional
See also this topic recently discussed:
https://forum.dlang.org/post/p9qvb8$1j1n$1...@digitalmars.com
On Monday, 2 April 2018 at 21:32:47 UTC, Steven Schveighoffer
wrote:
On 4/2/18 5:16 PM, Per Nordlöw wrote:
On Monday, 2 April 2018 at 20:43:01 UTC, Alexandru Jercaianu
wrote:
I am not completely sure how to solve this, but maybe we can
find some clues here [1].
It seems like we should use addRo
26 matches
Mail list logo