On Wednesday, 9 September 2015 at 19:37:54 UTC, Alex Parrill
wrote:
It's a flexible array member [1], not a pointer. Changing it to
`char*` would make it incompatible with the C functions using
it.
[1]: https://en.wikipedia.org/wiki/Flexible_array_member
TIL a new detail about C on the D for
On Friday, 11 September 2015 at 06:45:07 UTC, Mike McKee wrote:
On Friday, 11 September 2015 at 06:00:39 UTC, Mike McKee wrote:
[...]
I think the start of this probably looks like the following,
but I'm not certain:
import gtk;
import gobject.Type;
import std.stdio;
import std.c.process;
i
On Friday, 11 September 2015 at 06:00:39 UTC, Mike McKee wrote:
On Ubuntu Linux, I can draw a simple Hello World interface (and
a button on it to close the window) with Glade and save the
file. Now how do I use GtkD and D to load that interface?
Anyone got a super simple tutorial for that?
I
On 09/06/2015 12:05 PM, Bahman Movaqar wrote:
> alias bool function(int n) validator_t;
There is the relatively newer alias syntax which is more intuitive:
alias Validator = bool function(int n);
> bool isEven(int n) { ... }
> bool isPrime(int n) { ... }
> /**
> * keep
On Ubuntu Linux, I can draw a simple Hello World interface (and a
button on it to close the window) with Glade and save the file.
Now how do I use GtkD and D to load that interface? Anyone got a
super simple tutorial for that?
On Friday, 11 September 2015 at 01:36:31 UTC, Mike Parker wrote:
On Thursday, 10 September 2015 at 18:10:43 UTC, Adam D. Ruppe
wrote:
BTW it is pretty rare that you should actually write a WinMain
in D. The right thing to do in most cases is to write a normal
main function. You can still get
On Friday, 11 September 2015 at 00:50:15 UTC, Adam D. Ruppe wrote:
On Friday, 11 September 2015 at 00:48:28 UTC, Prudence wrote:
static Array!(bool delegate(int, WPARAM, LPARAM)) callbacks;
Try just using a regular array instead of the library Array.
static bool delegate(int, WPARAM, LPARAM)
On Thursday, 10 September 2015 at 18:10:43 UTC, Adam D. Ruppe
wrote:
BTW it is pretty rare that you should actually write a WinMain
in D. The right thing to do in most cases is to write a normal
main function. You can still get the windows gui subsystem with
a linker flag.
Specifically, add
On Friday, 11 September 2015 at 00:55:41 UTC, Adam D. Ruppe wrote:
On Friday, 11 September 2015 at 00:52:00 UTC, BBasile wrote:
While trying to get why some call to memmove without the right
import didn't lead to a compilation failure i've found that
imported symbols are not private ! Is that a
On Friday, 11 September 2015 at 00:52:00 UTC, BBasile wrote:
While trying to get why some call to memmove without the right
import didn't lead to a compilation failure i've found that
imported symbols are not private ! Is that a bug ? The specs
don't say that a selective import is public !
Ye
On Friday, 11 September 2015 at 00:48:28 UTC, Prudence wrote:
static Array!(bool delegate(int, WPARAM, LPARAM)) callbacks;
Try just using a regular array instead of the library Array.
static bool delegate(int, WPARAM, LPARAM)[] callbacks;
my guess is the Array library thing isn't marked as s
While trying to get why some call to memmove without the right
import didn't lead to a compilation failure i've found that
imported symbols are not private ! Is that a bug ? The specs
don't say that a selective import is public !
-- other.d --
module other;
private import core.stdc.string: mem
I can't create a shared array:
static Array!(bool delegate(int, WPARAM, LPARAM)) callbacks;
(prepending shared produce a ton of errors with the Array class)
I've tried making it a pointer and other things.
The array must be static and must be shared. Without shared
everything works but I don
On Friday, 4 September 2015 at 16:11:59 UTC, Stephen wrote:
On Friday, 4 September 2015 at 05:51:02 UTC, Mike Parker wrote:
* What was previously said *
* Bump * Hopefully I'm allowed to bump this...?
On Thursday, 10 September 2015 at 18:06:43 UTC, Prudence wrote:
Is there a flag for knowing when a project is compiling for
windows(Uses WinMain) vs a console(normal main)?
You'd have to choose the main yourself anyway, so document what
process you use for that for people to use.
BTW it is p
Is there a flag for knowing when a project is compiling for
windows(Uses WinMain) vs a console(normal main)?
version(Windows) is always valid for a console app, so it is
useless to disambiguate between a console app and a windows app.
(Say I have both a main and a winmain in my code, I need to
Is there an easy way of knowing when you do not have to initialize the
D runtime system to call D code from, in this case, Python via a C
adapter?
I naïvely transformed some C++ to D, without consideration of D runtime
systems, compiled it and it all worked. Which is good, but…
--
Russel.
==
On 09/03/2015 02:20 PM, Matt Kline wrote:
> neither the docs nor the current Phobos implementation
> make any mention of such exceptions.
There is LinkTerminated but you must use spawnLinked():
http://dlang.org/phobos/std_concurrency.html#.LinkTerminated
http://ddili.org/ders/d.en/concurren
On Thursday, 10 September 2015 at 13:48:16 UTC, Namal wrote:
Hello,
how can I define the range for the sum function which I want to
sum up? For instance how do I sum up the first 3 elements of an
array
int[] a = [1,2,3,4,5,6,7,8,9];
or the last 3?
In this case, you can simply slice array
On Thursday 10 September 2015 15:48, Namal wrote:
> Hello,
>
> how can I define the range for the sum function which I want to
> sum up? For instance how do I sum up the first 3 elements of an
> array
>
> int[] a = [1,2,3,4,5,6,7,8,9];
>
> or the last 3?
First you slice the first/last 3, the
Hello,
how can I define the range for the sum function which I want to
sum up? For instance how do I sum up the first 3 elements of an
array
int[] a = [1,2,3,4,5,6,7,8,9];
or the last 3?
On Thursday, 10 September 2015 at 08:22:29 UTC, Daniel N wrote:
this(string caller = __MODULE__)(int val) if(caller ==
"std.conv") // Use scoped!Awesome
That's disgustingly genius. I'm a bit jealous I didn't think
of it myself!
One slight problem though: you couldn't call super() from
On Wednesday, 9 September 2015 at 23:44:14 UTC, Idan Arye wrote:
public:
mixin MakeUnique!(int);
I actually think that should be a free function in the module
because then it can be used by derived classes too without having
to mix it in each of them as well.
On Thursday, 10 September 2015 at 12:34:54 UTC, Daniel Kozák
wrote:
On Thu, 10 Sep 2015 11:38:35 +
"Gary Willoughby" wrote:
On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote:
> - RefCounted
>
> Only for D structs. std::shared_ptr works for all.
RefCounted works with classes as
On Thu, 10 Sep 2015 11:38:35 +
"Gary Willoughby" wrote:
> On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote:
> > - RefCounted
> >
> > Only for D structs. std::shared_ptr works for all.
>
> RefCounted works with classes as well.
>
> http://dlang.org/phobos/std_typecons.html#.RefCo
On Wednesday, 9 September 2015 at 20:28:35 UTC, Laeeth Isharc
wrote:
I have a DateTime[][] arg ...
I would like to find the intersection of the dates.
A suggestion:
auto minLength = arg.map!(a => a.length).reduce!min;
auto minIdx = arg.map!(a =>
a.length).countUntil(minLength);
a
On Wednesday, 9 September 2015 at 23:22:49 UTC, ponce wrote:
- RefCounted
Only for D structs. std::shared_ptr works for all.
RefCounted works with classes as well.
http://dlang.org/phobos/std_typecons.html#.RefCounted
On Wednesday, 9 September 2015 at 20:35:53 UTC, anonymous wrote:
When you pass a slice (without ref), what's actually passed is
a pointer and length. The contents are not copied. That means,
when you alter an array element, the change will be done the
original, even without ref:
Thanks both.
On Thursday, 10 September 2015 at 08:22:29 UTC, Daniel N wrote:
import std.typecons;
class Awesome1
{
private:
int val;
this(string caller = __MODULE__)(int val) if(caller ==
"std.conv") // Use scoped!Awesome
{
this.val = val;
}
}
class Awesome2
{
private:
int val;
this(st
On Wednesday, 9 September 2015 at 23:44:14 UTC, Idan Arye wrote:
How about using a mixin
template(http://dlang.org/template-mixin.html)?
Thanks, it's a good solution. My only reservation is I would
prefer to find a way to directly invoke a symbol in std.* as
otherwise different frameworks m
On Tuesday, 8 September 2015 at 12:56:00 UTC, Laeeth Isharc wrote:
This is really very clear and helpful, and I appreciate your
taking the time. I will place it on the wiki if that's okay.
Thats ok.
Library support is surely one of the largest impediments to the
adoption of D, and we ou
31 matches
Mail list logo