On Monday, 21 March 2016 at 13:19:34 UTC, denizzzka wrote:
On Monday, 27 July 2015 at 20:12:10 UTC, John Colvin wrote:
Yes, but then core.sync.semaphore doesn't support being
shared, so...
I don't really understand how
https://github.com/D-Programming-Language/druntime/blob/master/src/core/
On Thursday, 28 July 2016 at 15:16:20 UTC, Gorge Jingale wrote:
On Wednesday, 27 July 2016 at 10:41:54 UTC, ketmar wrote:
On Wednesday, 27 July 2016 at 10:39:52 UTC, NX wrote:
Lack of production quality tools
like? no, "refactoring" and other crap is not "production
quality tools", they are
In C, a function `void func()` doesn't declare a function without
arguments, instead it declares a function that takes unspecified
number of arguments. The correct way to declare a function that
takes no arguments is to use the `void` keyword: `void
func(void)`.
What is the correct way to ref
So my last variant is right?
How can I inspect code, to better understand how GC works? Also
where I can find idiomatic code with comments? Just to read for
better understand design solutions.
On Friday, 29 July 2016 at 06:38:17 UTC, Andre Pany wrote:
Hi,
is there a way to alias a string mixin?
Neither foo nor foo2 compiles.
import std.meta : Alias;
alias foo = (s) => Alias!(mixin(generateCode(s)));
alias foo2(string s) = Alias!(mixin(generateCode(s)));
string generateCode(string s)
On Friday, 29 July 2016 at 10:57:37 UTC, ciechowoj wrote:
In C, a function `void func()` doesn't declare a function
without arguments, instead it declares a function that takes
unspecified number of arguments. The correct way to declare a
function that takes no arguments is to use the `void` ke
On Friday, 29 July 2016 at 12:11:44 UTC, pineapple wrote:
On Friday, 29 July 2016 at 06:38:17 UTC, Andre Pany wrote:
Hi,
is there a way to alias a string mixin?
Neither foo nor foo2 compiles.
import std.meta : Alias;
alias foo = (s) => Alias!(mixin(generateCode(s)));
alias foo2(string s) = Ali
On Friday, 29 July 2016 at 12:15:22 UTC, Mike Parker wrote:
Yes, this is correct as long as the calling convention is not
stdcall or something else:
Though, I should add the caveat that you need to ensure the
definition of the C function does not specify any parameters.
AFAIK, this is lega
On 7/29/16 2:38 AM, Andre Pany wrote:
Hi,
is there a way to alias a string mixin?
Neither foo nor foo2 compiles.
import std.meta : Alias;
alias foo = (s) => Alias!(mixin(generateCode(s)));
s is a runtime parameter. You can't mixin stuff that is only available
at runtime.
alias foo2(string
On Friday, 29 July 2016 at 12:22:54 UTC, Andre Pany wrote:
It is more or less syntax sugar. In the main function instead
of writing "mixin(generateCode(s));" I want to write "foo(s);".
So, the mixin statement is hidden while the functionality of
mixin stays.
Kind regards
André
As far as I k
On Friday, 29 July 2016 at 12:20:17 UTC, Mike Parker wrote:
Though, I should add the caveat that you need to ensure the
definition of the C function does not specify any parameters.
AFAIK, this is legal:
// foo.h
void func();
// foo.c
void func(int a, int b) { ... }
In which case you would
Use the `destroy` function to finalize an object by calling its
destructor. The memory of the object is not immediately
deallocated, instead the GC will collect the memory of the object
at an undetermined point after finalization:
class Foo { int x; this() { x = 1; } }
Foo foo = new Foo;
destr
On Friday, 29 July 2016 at 13:18:00 UTC, Suliman wrote:
But I can't understand if D have GC it should remove objects
when their life is finished. When I should to call `destroy`?
What would be if I will not call it?
`destroy` is mainly about running destructors deterministically.
From the sou
On Friday, 29 July 2016 at 13:18:00 UTC, Suliman wrote:
But I can't understand if D have GC it should remove objects
when their life is finished. When I should to call `destroy`?
What would be if I will not call it?
You should call destroy when you want to call the destructor
deterministicall
On Friday, 29 July 2016 at 13:18:00 UTC, Suliman wrote:
Use the `destroy` function to finalize an object by calling its
destructor. The memory of the object is not immediately
deallocated, instead the GC will collect the memory of the
object at an undetermined point after finalization:
class
This failure seems curious and I haven't been able to understand
why it occurs, or whether it might be intentional. For all other
callable types, including functions and delegates and types
implementing opCall, the assertion passes.
import std.traits : FunctionTypeOf;
void function() f
On Friday, July 29, 2016 13:18:00 Suliman via Digitalmars-d-learn wrote:
> Use the `destroy` function to finalize an object by calling its
> destructor. The memory of the object is not immediately
> deallocated, instead the GC will collect the memory of the object
> at an undetermined point after f
On 07/29/2016 02:15 PM, Mike Parker wrote:
And if it is a cross-platform library that is stdcall on Windows and
cdecl elsewhere:
extern(C) void fun();
extern(System), no?
D won't let you hide the mixin, the keyword is there specifically
to indicate code is being injected in that location.
This isn't what you are looking for, but you can do something
like this:
-
string generateCode(string s){return "";}
void main()
{
enum s = "
On Friday, 29 July 2016 at 18:34:56 UTC, Jesse Phillips wrote:
Here the generateCode() is mixed in to the context of foo(),
which is fine if your code is performing actions but is no good
if you're creating declarations that you want to use in the
context of main().
Here is a fully functionin
Cases to consider: Arrays and AAs with const(T) Elements, where T
is a value or a reference type respectively.
class C { }
struct S { }
const(S)[] varr;
const(C)[] carr;
const(S)[S] vaav;
const(C)[S] caav;
const(S)[C] vaac;
const(C)[C] caac;
pragma(msg, ty
On 7/29/16 3:00 PM, Q. Schroll wrote:
Cases to consider: Arrays and AAs with const(T) Elements, where T is a
value or a reference type respectively.
[snip]
Questions:
(1) Why do I have to specify the type here? Why does inference fail?
(2) Why not just S[S]?
The copy of a const S is a S so why
On Friday, 29 July 2016 at 18:39:23 UTC, Jesse Phillips wrote:
On Friday, 29 July 2016 at 18:34:56 UTC, Jesse Phillips wrote:
Here the generateCode() is mixed in to the context of foo(),
which is fine if your code is performing actions but is no
good if you're creating declarations that you wan
I have some java code I need to convert and at one point it uses
an Object[] array to store various ints, longs, and strings. Java
has built in Integer and Long classes that wrap the primitives in
an object and strings are already objects.
On Friday, 29 July 2016 at 20:13:34 UTC, stunaep wrote:
I have some java code I need to convert and at one point it
uses an Object[] array to store various ints, longs, and
strings. Java has built in Integer and Long classes that wrap
the primitives in an object and strings are already objects.
On 07/29/2016 01:25 PM, Cauterite wrote:
On Friday, 29 July 2016 at 20:13:34 UTC, stunaep wrote:
I have some java code I need to convert and at one point it uses an
Object[] array to store various ints, longs, and strings. Java has
built in Integer and Long classes that wrap the primitives in an
On Friday, 29 July 2016 at 20:26:47 UTC, Ali Çehreli wrote:
I was going to suggest Algebraic because it allows arrays of
mixed primitive types (wrapped in Algebraic):
https://dlang.org/phobos/std_variant.html#.Algebraic
Ali
It could work, but keep in mind Algebraic is a structure, not an
On 07/29/2016 01:40 PM, Cauterite wrote:
> On Friday, 29 July 2016 at 20:26:47 UTC, Ali Çehreli wrote:
>>
>> I was going to suggest Algebraic because it allows arrays of mixed
>> primitive types (wrapped in Algebraic):
>>
>> https://dlang.org/phobos/std_variant.html#.Algebraic
>>
>> Ali
>
> It c
On Tuesday, 26 July 2016 at 15:11:00 UTC, llaine wrote:
Hi guys,
I'm using D since a few month now and I was wondering why
people don't jump onto it that much and why it isn't the "big
thing" already.
Everybody is into javascript nowadays, but IMO even for doing
web I found Vibe.d more inte
On Friday, 29 July 2016 at 18:24:52 UTC, ag0aep6g wrote:
On 07/29/2016 02:15 PM, Mike Parker wrote:
And if it is a cross-platform library that is stdcall on
Windows and
cdecl elsewhere:
extern(C) void fun();
extern(System), no?
Yeah, that's what I had intended.
On Friday, 29 July 2016 at 20:25:16 UTC, Cauterite wrote:
On Friday, 29 July 2016 at 20:13:34 UTC, stunaep wrote:
I have some java code I need to convert and at one point it
uses an Object[] array to store various ints, longs, and
strings. Java has built in Integer and Long classes that wrap
t
So I ran into a problem earlier - trying to allocate 2GB or more
on Windows would fail even if there was enough room. Mentioned it
in the D irc channel and a few fine folks pointed out that
Windows only allows 2GB for 32-bit applications unless you pass a
special flag which may or may not be a
On 07/30/2016 07:00 AM, 岩倉 澪 wrote:
auto mem = malloc(2^^31);
2^^31 is negative. 2^^31-1 is the maximum positive value of an int, so
2^^31 wraps around to int.min.
Try 2u^^31.
Hello!
I'm used small device(Electronic dictionary) which installed
Windows CE 6.0.
How can i found D compiler(ldc or dmd) for Windows CE?(I just
wonder. not serious.)
regards,
On Saturday, 30 July 2016 at 05:21:26 UTC, ag0aep6g wrote:
On 07/30/2016 07:00 AM, 岩倉 澪 wrote:
auto mem = malloc(2^^31);
2^^31 is negative. 2^^31-1 is the maximum positive value of an
int, so 2^^31 wraps around to int.min.
Try 2u^^31.
bah, I'm an idiot! CASE CLOSED. Thanks for the
35 matches
Mail list logo