Re: vibe.d: How to get the conent of a file upload ?

2020-09-20 Thread wjoe via Digitalmars-d-learn
On Sunday, 20 September 2020 at 00:36:30 UTC, Adam D. Ruppe wrote: [...] I browsed in your arsd docs a bit and I'll have a closer look at the CGI module a bit later. Your http2 module piqued my interest as it could come in handy some time later :) Looks like your modules cover everything I

Re: dub sub-projects

2020-09-20 Thread Vladimirs Nordholm via Digitalmars-d-learn
On Sunday, 20 September 2020 at 18:55:39 UTC, rikki cattermole wrote: But since you insist on them being separate repositories, then they are just regular old dependencies. Ah, well it's not that I _insist_ on them being their own dependencies, it's just the only way I've encountered a setup

Re: dub sub-projects

2020-09-20 Thread rikki cattermole via Digitalmars-d-learn
On 21/09/2020 6:24 AM, Vladimirs Nordholm wrote: I am unsure what the dub file would look like. I read that there is something called "subPackages", but in my mind I see them as dependencies. Is "subPackages" the right approach here? Yes but no. Normally all of these (what appear to be small

Re: dub sub-projects

2020-09-20 Thread Vladimirs Nordholm via Digitalmars-d-learn
On Sunday, 20 September 2020 at 18:24:31 UTC, Vladimirs Nordholm wrote: Hello. I wonder what the best-practice is for dub projects with sub-projects. Excuse me if the terminology is wrong. Let me explain my situation. ... The project I am referring to is my project scone

dub sub-projects

2020-09-20 Thread Vladimirs Nordholm via Digitalmars-d-learn
Hello. I wonder what the best-practice is for dub projects with sub-projects. Excuse me if the terminology is wrong. Let me explain my situation. I have a library which I want to split up into multiple projects. The main project will be a "wrapper" with some additional code. The sub-projects

Re: Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread realhet via Digitalmars-d-learn
On Sunday, 20 September 2020 at 17:08:49 UTC, realhet wrote: On Sunday, 20 September 2020 at 16:18:19 UTC, Steven Schveighoffer wrote: On 9/20/20 11:52 AM, realhet wrote: On Sunday, 20 September 2020 at 14:54:09 UTC, Steven Schveighoffer wrote: On 9/20/20 9:30 AM, realhet wrote: Yeah, I

Re: Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread realhet via Digitalmars-d-learn
On Sunday, 20 September 2020 at 16:18:19 UTC, Steven Schveighoffer wrote: On 9/20/20 11:52 AM, realhet wrote: On Sunday, 20 September 2020 at 14:54:09 UTC, Steven Schveighoffer wrote: On 9/20/20 9:30 AM, realhet wrote: Yeah, I think this might work. -Steve That would be a 3rd category out

Re: Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/20/20 11:52 AM, realhet wrote: On Sunday, 20 September 2020 at 14:54:09 UTC, Steven Schveighoffer wrote: On 9/20/20 9:30 AM, realhet wrote: ref inout(int) x() inout { return array[0]; } This doesn't work when I type: v.x++; It should, as long as v is mutable. I want to make a similar

Re: Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread realhet via Digitalmars-d-learn
On Sunday, 20 September 2020 at 15:52:49 UTC, realhet wrote: On Sunday, 20 September 2020 at 14:54:09 UTC, Steven Schveighoffer wrote: On 9/20/20 9:30 AM, realhet wrote: I managed to do the constant swizzles and it seems so elegant: auto opDispatch(string def)() const

Re: Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread realhet via Digitalmars-d-learn
On Sunday, 20 September 2020 at 14:54:09 UTC, Steven Schveighoffer wrote: On 9/20/20 9:30 AM, realhet wrote: ref inout(int) x() inout { return array[0]; } This doesn't work when I type: v.x++; I want to make a similar type like the GLSL vectors. Where the following thing is valid: vec4 a,

Re: Building LDC runtime for a microcontroller

2020-09-20 Thread Dylan Graham via Digitalmars-d-learn
On Sunday, 20 September 2020 at 15:13:25 UTC, Steven Schveighoffer wrote: On 9/20/20 10:51 AM, Dylan Graham wrote: On Saturday, 19 September 2020 at 20:39:38 UTC, aberba wrote: Do you attend our monthly D online meetups? We have monthly online meetups? I would love to join of course!

Re: Building LDC runtime for a microcontroller

2020-09-20 Thread Dylan Graham via Digitalmars-d-learn
On Saturday, 19 September 2020 at 23:22:50 UTC, IGotD- wrote: On Friday, 18 September 2020 at 07:44:50 UTC, Dylan Graham wrote: I use D in an automotive environment (it controls parts of the powertrain, so yeah there are cars running around on D) on various types of ARM Cortex M CPUs, I

Re: Building LDC runtime for a microcontroller

2020-09-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/20/20 10:51 AM, Dylan Graham wrote: On Saturday, 19 September 2020 at 20:39:38 UTC, aberba wrote: Do you attend our monthly D online meetups? We have monthly online meetups? I would love to join of course! Happening next weekend! 

Re: Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/20/20 9:30 AM, realhet wrote: Hi, struct S{   int[2] array;   ref  x()   { return array[0]; }   auto x() const { return array[0]; } } If there a way to write the function 'x' into one function, not 2 overloads. I tried auto/const/ref mindlessly :D, also remembered 'inout', but

Re: Building LDC runtime for a microcontroller

2020-09-20 Thread Dylan Graham via Digitalmars-d-learn
On Saturday, 19 September 2020 at 20:39:38 UTC, aberba wrote: On Friday, 18 September 2020 at 07:44:50 UTC, Dylan Graham wrote: On Monday, 7 September 2020 at 19:12:59 UTC, aberba wrote: [...] [...] Wow. Happy to hear this. Do you attend our monthly D online meetups? We have monthly

Re: DDoc generation

2020-09-20 Thread DlangUser38 via Digitalmars-d-learn
On Friday, 18 September 2020 at 11:41:05 UTC, Russel Winder wrote: Hi, I am trying to get to grips with DDoc for documenting an application. Getting the individual module HTML files seems to be the easy bit. The question is how to get an index.html (or equivalent) so as to have an

Re: Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread realhet via Digitalmars-d-learn
On Sunday, 20 September 2020 at 13:30:36 UTC, realhet wrote: Hi, More specifically: struct S{ int[2] array; ref swizzle(string code)(){ static if(code=="x") return array[0]; else static if(code=="y") return array[1]; else static assert("Unhandled"); }

Is there a way to return an lvalue and also an rvalue from the same member function?

2020-09-20 Thread realhet via Digitalmars-d-learn
Hi, struct S{ int[2] array; ref x() { return array[0]; } auto x() const { return array[0]; } } If there a way to write the function 'x' into one function, not 2 overloads. I tried auto/const/ref mindlessly :D, also remembered 'inout', but obviously those weren't solve the

Re: Good repos to learn D

2020-09-20 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 20 September 2020 at 04:27:59 UTC, H. S. Teoh wrote: On Sat, Sep 19, 2020 at 08:26:36AM +, Imperatorn via Digitalmars-d-learn wrote: What are some good examples of pretty large/medium size, good structured repos in D? I'm looking for examples to learn from [...] Phobos itself.