On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
Hi
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.l
Hi
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic array as length i
On Wednesday, 12 July 2017 at 02:06:41 UTC, Steven Schveighoffer
wrote:
I do agree it's not intuitive for an initializer, especially
when:
auto a = [1, 2, 3]; // typeof(a) == int[]
short[] b = [1, 2, 3]; // works
Thank you for getting back to me, that's where my train of
thought was going. W
On Tuesday, 11 July 2017 at 22:46:00 UTC, Steven Schveighoffer
wrote:
On 7/5/17 12:04 PM, crimaniak wrote:
...
Because of the temporary copy likely inside map closes the
connection.
See the bug I reported:
https://github.com/mysql-d/mysql-native/issues/117
Yes, it seems to be the same issue
On 7/11/17 9:27 PM, Brandon Buck wrote:
I apologize if this has been touched on before, I'm not quite sure what
to search for and what I did try didn't bring anything up.
Okay, so I'm learning D, using the D Tour flow and I went over
interfaces. Everything is making sense. I key in the example
I apologize if this has been touched on before, I'm not quite
sure what to search for and what I did try didn't bring anything
up.
Okay, so I'm learning D, using the D Tour flow and I went over
interfaces. Everything is making sense. I key in the example (as
I like to copy it by hand and then
On Wednesday, 12 July 2017 at 00:44:38 UTC, Deech wrote:
Hi all,
I've been learning D for a few weeks by reading through
Programming In D [1] and had a question about Eponymous
Template section [2]. Here's the example:
```
template LargerOf(A, B) {
static if (A.sizeof < B.sizeof) {
alia
Hi all,
I've been learning D for a few weeks by reading through
Programming In D [1] and had a question about Eponymous Template
section [2]. Here's the example:
```
template LargerOf(A, B) {
static if (A.sizeof < B.sizeof) {
alias LargerOf = B;
} else {
alias LargerOf = A;
}
}
On Tuesday, 11 July 2017 at 06:18:44 UTC, Biotronic wrote:
On Monday, 10 July 2017 at 20:03:32 UTC, Igor Shirkalin wrote:
[...]
If DRuntime is not made aware of the thread's existence, the
thread will not be stopped by the GC, and the GC might collect
memory that the thread is referencing on
On 7/5/17 12:04 PM, crimaniak wrote:
Hi all!
After some hard time with debugging, I found ResultRange returned by
query() and Prepared::query() of mysql-native package can't be combined
with map() because after map() it becomes empty resultset.
[snip]
As you see simple each() and foreach()
On 07/11/2017 01:25 PM, Jean-Louis Leroy wrote:
> On Tuesday, 11 July 2017 at 17:20:33 UTC, Ali Çehreli wrote:
>
>> @Virtual("t", "d", "w")
>> string fight(Character t, Dragon d, Hands w) {
>> return "you just killed a dragon with your bare hands. Incredible
>> isn't it?";
>> [...]
>> mixin Pr
On Tuesday, 11 July 2017 at 17:20:33 UTC, Ali Çehreli wrote:
@Virtual("t", "d", "w")
string fight(Character t, Dragon d, Hands w) {
return "you just killed a dragon with your bare hands.
Incredible isn't it?";
[...]
mixin ProcessMethods();
Great suggestion! I think this could work:
st
On Tuesday, 11 July 2017 at 17:20:33 UTC, Ali Çehreli wrote:
That's some serious code you've written there and you must be
happy that 'virtual' is not a keyword in D. ;)
Thanks. Haha I would have used virtual_ like I did in C++ ;-)
Maybe others can come up with ideas on a better syntax.
Wh
On 7/11/17 2:12 PM, ag0aep6g wrote:
On 07/10/2017 04:57 PM, ag0aep6g wrote:
alias T = int;
T** f(const T** input) pure
{
T** output;
return output;
}
void main()
{
T i;
T* p = &i;
immutable T** r = f(&p);
}
[...]
Now change `T` to `alias T = immutable int;`.
On Tuesday, 11 July 2017 at 12:15:39 UTC, Suliman wrote:
I am using dlang-requests. I need authentificate on
https://scihub.copernicus.eu/dhus/login and than do some
data-parsing.
MultipartForm form;
form.add(formData("login_username", "Suliman"));
form.add(formData("login_password
On 07/10/2017 04:57 PM, ag0aep6g wrote:
alias T = int;
T** f(const T** input) pure
{
T** output;
return output;
}
void main()
{
T i;
T* p = &i;
immutable T** r = f(&p);
}
[...]
Now change `T` to `alias T = immutable int;`. The program gets rejected.
The erro
On 07/10/2017 04:24 PM, Jean-Louis Leroy wrote:
> FYI, having a lot of fun. See
>
https://github.com/jll63/meth.d/blob/experiments/source/meth/examples/adventure.d
I'm glad you're trying out multi-methods with D:
https://github.com/jll63/meth.d/tree/experiments
That's some serious code you
On Tuesday, 11 July 2017 at 16:04:52 UTC, SrMordred wrote:
I never notice this before, but i tried to put a basic hello
world from vibe.d (like the one that are in the dlang front
page examples now), into the most basic instance on google
cloud (with 600mb of RAM) and the compilation returned
On Tuesday, 11 July 2017 at 16:04:52 UTC, SrMordred wrote:
I never notice this before, but i tried to put a basic hello
world from vibe.d (like the one that are in the dlang front
page examples now), into the most basic instance on google
cloud (with 600mb of RAM) and the compilation returned
I never notice this before, but i tried to put a basic hello
world from vibe.d (like the one that are in the dlang front page
examples now), into the most basic instance on google cloud (with
600mb of RAM) and the compilation returned
"Killed
dmd failed with exit code 137."
So I look at the RA
On Tuesday, 11 July 2017 at 12:15:39 UTC, Suliman wrote:
I am using dlang-requests. I need authentificate on
https://scihub.copernicus.eu/dhus/login and than do some
data-parsing.
MultipartForm form;
form.add(formData("login_username", "Suliman"));
form.add(formData("login_password
I am using dlang-requests. I need authentificate on
https://scihub.copernicus.eu/dhus/login and than do some
data-parsing.
MultipartForm form;
form.add(formData("login_username", "Suliman"));
form.add(formData("login_password", "123")); // changed
auto content =
postContent("ht
On Tuesday, 11 July 2017 at 08:23:02 UTC, Miguel L wrote:
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=
Miguel L wrote:
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile time. The
closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic arr
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic array as length is no
On 07/10/2017 11:14 PM, FoxyBrown wrote:
auto GetStaticAddress(T)()
{
mixin("auto p = cast(T*)&T."~__traits(allMembers, T)[0]~";");
return p;
}
Returns the address of a struct's static members.
No, it returns the address of T's first member.
It's pretty obvious, the compiler seems
26 matches
Mail list logo