case 1:
delete ar;
case 2:
ar.destroy();
case 3:
GC.free(ar.ptr);
case 4:
ar = null;// (assumed that ar is only one pointer to the same
array)
What is the difference?
How to free memory to the system immediately?
___
Thank You & Best Regards,
Ilya
Am 30.12.2013 00:24, schrieb Mike Wey:
The normal version works on Windows, i'll include these in the installer.
As for installing the themes separately you'll need auomake and GnuMake.
I don't know if you have these installed, but i've created a zip
http://gtkd.org/Downloads/gtk-icon-theme.zip
module test;
class Foo {
public static ulong next = 0;
public static ulong getNext() {
return next++;
}
}
void main() {
Foo.getNext();
}
/*
The next++ is the culprit.
Using a ++next does not throw an exception.
*/
On Mon, Dec 30, 2013 at 05:34:10AM +0100, Marco Leise wrote:
> Am Sat, 28 Dec 2013 15:24:31 +
> schrieb "Dicebot" :
>
> > AFAIK it is intentionally banned to constrain operator
> > overloading abuse.
>
> That and it makes the compiler faster.
[...]
And discourages writing unreadable code li
On 12/29/2013 10:58 AM, Jonathan wrote:
> Given a struct
>
> struct Foo{
>enum INT_C {Yes, No}
>INT_C a;
> }
[...]
> The second choice is: do we qualify by the struct name:
>
> this(int y)
> {
>//option 1
>a = Foo.INT_C.Yes;
That's what I do without thinking much about it.
>
On Sunday, 29 December 2013 at 22:28:00 UTC, Carl Sturtivant
wrote:
Very nice. Only one problem: when I use dmd/win32 to build the
DLL, and analyze the resulting export, it's
_D5mixin43__T7ExternCS28_D5mixin1X3fffFkPS5mixin1AZiZ3fffUkPS5mixin1AZi
and not _fff or similar. So somehow the extern(C)
Am Sat, 28 Dec 2013 15:24:31 +
schrieb "Dicebot" :
> AFAIK it is intentionally banned to constrain operator
> overloading abuse.
That and it makes the compiler faster.
--
Marco
On 12/29/2013 11:11 PM, David Held wrote:
On 12/28/2013 5:13 AM, Timon Gehr wrote:
[...]
I wouldn't call this an 'eager map'. It's a shallow wrapper around a
foreach loop.
The point being that foreach loops aren't composable.
Dave
Wrapping it will not change that.
On 12/30/2013 5:36 AM, FreeSlave wrote:
Also you may read
http://www.gamedev.net/blog/1140/entry-2254003-binding-d-to-c/
Better to go to [1], where I combined that series of posts into a single
article and updated a few things, too.
[1]
http://www.gamedev.net/page/resources/_/technical/ga
If you like Parser Expression Grammar there's Pegged:
https://github.com/PhilippeSigaud/Pegged
On 12/29/2013 06:26 PM, Benjamin Thaut wrote:
I'm currently working with a file chooser. Whenever I open a folder that
actually contains file I get the following error message:
Assertion file 'gtk' line 0: Could not find the icon 'gtk-file'. The
'hicolor' theme
was not found either, perhaps you
On Sunday, 29 December 2013 at 14:24:05 UTC, bearophile wrote:
Ali Çehreli:
On 12/29/2013 04:00 AM, Mike:
Do you happen to know of any clever technique to make object,
and
everything that inherits from it, a referenced counted object?
There is std.typecons.RefCounted:
http://dlang.org/pho
On Sunday, 29 December 2013 at 22:11:22 UTC, monarch_dodra wrote:
On Sunday, 29 December 2013 at 21:47:52 UTC, Namespace wrote:
Well, a ref *can't* be null. In terms of default value, both
can have them, in terms of referencing a static object though.
The only functional difference I know of i
On Sunday, 29 December 2013 at 22:01:19 UTC, Dicebot wrote:
Does this look clean enough? (Not sure I have completely
understood the question)
/* export extern(C) int f( uint argc, A* argv) { return
Wrapper!f(
argc, argv); } */
struct A {}
int Wrapper(alias func, T...)(T args) { return 42; }
On 12/29/2013 02:11 PM, David Held wrote:> On 12/28/2013 5:13 AM, Timon
Gehr wrote:
>> [...]
>> I wouldn't call this an 'eager map'. It's a shallow wrapper around a
>> foreach loop.
>
> The point being that foreach loops aren't composable.
Agreed. However, if they were composable they would have
On Sunday, 29 December 2013 at 21:47:52 UTC, Namespace wrote:
On Sunday, 29 December 2013 at 19:42:39 UTC, Jonathan wrote:
If I want to write a function that operates on a struct
struct S { }
What are the differences between:
void(S* s)
void(ref S s)
You cannot set a default value (like nu
On 12/28/2013 2:07 AM, FreeSlave wrote:
[...]
If you want to get result just now, then use 'array' function from
std.array module.
map!fun(range).array;
or
array(map!fun(range));
Syntactically compact and slightly better expression of intent, but much
less efficient than just calling reduce
On 12/28/2013 5:13 AM, Timon Gehr wrote:
[...]
I wouldn't call this an 'eager map'. It's a shallow wrapper around a
foreach loop.
The point being that foreach loops aren't composable.
Dave
Does this look clean enough? (Not sure I have completely
understood the question)
/* export extern(C) int f( uint argc, A* argv) { return Wrapper!f(
argc, argv); } */
struct A {}
int Wrapper(alias func, T...)(T args) { return 42; }
template ExternC(alias existingFunc)
{
import std.str
On Sunday, 29 December 2013 at 19:42:39 UTC, Jonathan wrote:
If I want to write a function that operates on a struct
struct S { }
What are the differences between:
void(S* s)
void(ref S s)
You cannot set a default value (like null) for ref parameters,
but you can for pointer.
I want to be able to define a number of extern(C) functions that
will define a C API in a DLL, varying only in their names, each
as follows.
export extern(C) int f( uint argc, A* argv) { return Wrapper!f(
argc, argv); }
Here Wrapper!f is a wrapper around a D function named f that does
the
On Sunday, 29 December 2013 at 19:25:46 UTC, Jonathan wrote:
Are there any good lexer and parser libraries (like flex/bison)
for D? If not, how much work would be involved in using flex
and bison and wrapping it to D? How straightforward is it to
pass a struct from C to D (the documentation
There is also http://www.semitwist.com/goldie/ but I did not use
it.
Jonathan:
I would like to know if D tries to statically check these
assertions.
Currently D doesn't statically verify them. I have an enhancement
request in the works for something related, but it's not powerful
enough for your use case.
Bye,
bearophile
On Sunday, 29 December 2013 at 19:42:39 UTC, Jonathan wrote:
If I want to write a function that operates on a struct
struct S { }
What are the differences between:
void(S* s)
s is a pointer to an instance of S, in the raw C sense.
void(ref S s)
s can be used as a normal S, but changes ar
On Sunday, 29 December 2013 at 19:25:46 UTC, Jonathan wrote:
Are there any good lexer and parser libraries (like flex/bison)
for D? If not, how much work would be involved in using flex
and bison and wrapping it to D? How straightforward is it to
pass a struct from C to D (the documentation
On Sunday, 29 December 2013 at 18:58:07 UTC, Jonathan wrote:
Given a struct
struct Foo{
enum INT_C {Yes, No}
INT_C a;
}
-- we wish to make a constructor. We want to set the answer to
Yes if we construct the struct with an integer. There are some
stylistic choices to be made.
The first
If I want to write a function that operates on a struct
struct S { }
What are the differences between:
void(S* s)
void(ref S s)
Also, for my general knowledge, is there a way to set default
function parameters, such as scope or lazy?
Are there any good lexer and parser libraries (like flex/bison)
for D? If not, how much work would be involved in using flex and
bison and wrapping it to D? How straightforward is it to pass a
struct from C to D (the documentation
http://dlang.org/struct.html just says that D structs go direc
D allows inputs and outputs to have assertions placed on them.
i.e.
int f(int x){
in{
assert(even(x));
}
out{
assert(odd(x));;
}
}
I would like to know if D tries to statically check these
assertions. If so that would give a subtyping mechanism which
would be kind of neat.
Given a struct
struct Foo{
enum INT_C {Yes, No}
INT_C a;
}
-- we wish to make a constructor. We want to set the answer to
Yes if we construct the struct with an integer. There are some
stylistic choices to be made.
The first choice is: do we use this (I seem to recall being told
in Ja
I'm currently working with a file chooser. Whenever I open a folder that
actually contains file I get the following error message:
Assertion file 'gtk' line 0: Could not find the icon 'gtk-file'. The
'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
On Sunday, 29 December 2013 at 16:06:51 UTC, Dicebot wrote:
AFAIK shared libraries are not yet supported by GDC / LDC, at
least not as supported as in DMD.
Thank you, at least now I know I mainly wasted my time, and can
now move on to other ideas.
Although I got some interesting stuff workin
On Sunday, 29 December 2013 at 14:50:52 UTC, H. S. Teoh wrote:
Yes, since C code will not throw D exceptions (C doesn't know
anything
about D exceptions). Unless you pass in a function pointer to a
D
function that does throw an exception... but that case doesn't
work for
other reasons, so it ge
AFAIK shared libraries are not yet supported by GDC / LDC, at
least not as supported as in DMD.
I also get another strange error I can't solve, whenever I
compile something with GDC without the standard library
(-nostdlib) I get this whenever I try to access the shared
library. (like the above but without libgphobos, with nostdlib
instead)
undefined symbol: _Dmodule_ref
Any ideas?
On Sat, Dec 28, 2013 at 09:57:06PM +, ponce wrote:
[...]
> >I noticed that in Deimos and Derelict that most(if not all) C
> >function declarations are marked as nothrow. What are the
> >speed/safety benefits of including this?
>
> No speed or safety benefit, but it allows to call these C funct
37 matches
Mail list logo