Method which I use now:
source D:
-
extern (C) {
int on_metFromD(CEditWin* uk, int aa, int bb) {
return (*uk).metFromD(int aa, int bb);
}
}
class CEditWin {
. . .
// Method for to call
int metFromD(int a, int b) {
return a + b;
}
}
main() {
On Thursday, 25 August 2016 at 20:43:19 UTC, Illuminati wrote:
On Thursday, 25 August 2016 at 20:42:42 UTC, Illuminati wrote:
http://judy.sourceforge.net/downloads/10minutes.htm
Would be nice to have such an implementation. Supposedly one
of the best all around data structures in existence?
On Saturday, 27 August 2016 at 00:04:47 UTC, pineapple wrote:
context(auto file = File("some_file.txt")){
file.write();
}
You don't need to do anything special for that in D, structs are
destructed automatically. Plain
auto file = File("some_file.txt");
file.write();
will
On Friday, 26 August 2016 at 23:44:53 UTC, Cauterite wrote:
On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote:
Does D have any such thing? I'm having to recreate the wheel
here and it isn't fun ;/ Getting in the way of real work ;/
@nogc is such a new language feature that you
I would just love if I could express this as something more like
context(auto file = File("some_file.txt")){
file.write();
}
On Friday, 26 August 2016 at 23:30:15 UTC, Cauterite wrote:
On Friday, 26 August 2016 at 23:28:27 UTC, pineapple wrote:
I've grown to very much appreciate how context initialization
and teardown can be very conveniently handled using `with` in
Python. Is there any clean way to imitate this
On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote:
Does D have any such thing? I'm having to recreate the wheel
here and it isn't fun ;/ Getting in the way of real work ;/
@nogc is such a new language feature that you can't expect a lot
of support yet from e.g. the standard
Does D have any such thing? I'm having to recreate the wheel here
and it isn't fun ;/ Getting in the way of real work ;/
Surely you would think that with the power D has such things
would exist by now?
On Friday, 26 August 2016 at 23:28:27 UTC, pineapple wrote:
I've grown to very much appreciate how context initialization
and teardown can be very conveniently handled using `with` in
Python. Is there any clean way to imitate this syntax in D?
Yep, scope guards.
auto p = OpenProcess(...);
I've grown to very much appreciate how context initialization and
teardown can be very conveniently handled using `with` in Python.
Is there any clean way to imitate this syntax in D?
On Friday, 26 August 2016 at 15:14:42 UTC, Steven Schveighoffer
wrote:
FYI, you cannot make this patch until we fully deprecate the
use of TypeInfo.init:
https://github.com/dlang/druntime/blob/master/src/object.d#L294
So at least until 2.075.
-Steve
Ah yes, good thinking. I'll keep that in
On 8/26/16 6:52 AM, Cauterite wrote:
On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote:
And I expect that it will become an error at some point in the future
to define an init member for a user-defined type, at which point,
there won't be any choice about fixing it.
I might
On Friday, August 26, 2016 10:52:47 Cauterite via Digitalmars-d-learn wrote:
> On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote:
> > And I expect that it will become an error at some point in the
> > future to define an init member for a user-defined type, at
> > which point,
On Friday, August 26, 2016 11:20:56 Johan Engelen via Digitalmars-d-learn
wrote:
> On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote:
> > You're supposed to be able to depend on .init existing. Default
> > initialization for structs can be disabled via
> >
> > @disable this();
> >
On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote:
You're supposed to be able to depend on .init existing. Default
initialization for structs can be disabled via
@disable this();
but even then, the init member still exists (it just isn't used
for default initialization).
On Friday, 26 August 2016 at 09:48:00 UTC, Jonathan M Davis wrote:
And I expect that it will become an error at some point in the
future to define an init member for a user-defined type, at
which point, there won't be any choice about fixing it.
I might take a crack at this patch. Sounds
On Friday, 26 August 2016 at 08:21:14 UTC, Alex wrote:
On Friday, 26 August 2016 at 07:20:00 UTC, Daniel Kozak wrote:
auto j2 = j.toString.parseJSON;
ha! cool! thanks! :)
found a bug...
https://issues.dlang.org/show_bug.cgi?id=16432
not very serious... but not found yet? ;)
On Friday, August 26, 2016 08:59:55 Cauterite via Digitalmars-d-learn wrote:
> How can I get the initial value of an arbitrary type? Since any
> struct can override it, .init is not reliable:
>
> struct Z {
> enum init = 6;
> string val = `asdf`;
> };
> assert(Z.init == 6);
>
How can I get the initial value of an arbitrary type? Since any
struct can override it, .init is not reliable:
struct Z {
enum init = 6;
string val = `asdf`;
};
assert(Z.init == 6);
assert(typeof(Z()).init == 6);
I know I could use
*(cast(Z*) typeid(Z).initializer.ptr)
but that
On Friday, 26 August 2016 at 07:46:13 UTC, Daniel Kozak wrote:
Another way is to implement deepCopy by yourself (something
like below)
import std.json;
import std.stdio;
JSONValue deepCopy(ref JSONValue val)
{
JSONValue newVal;
switch(val.type)
{
case JSON_TYPE.STRING:
On Friday, 26 August 2016 at 07:20:00 UTC, Daniel Kozak wrote:
auto j2 = j.toString.parseJSON;
ha! cool! thanks! :)
On Friday, 26 August 2016 at 06:56:06 UTC, Alex wrote:
Hi everybody,
I'm little at loss: as documented, a JSONValue is only shallow
copied:
...
So the effect that the code of "j" is altered was expected.
The question is: how to make a deep copy of a JSONValue? Is
there a simple way without
On Friday, 26 August 2016 at 07:21:55 UTC, Daniel Kozak wrote:
Dne 26.8.2016 v 09:12 magicdmer via Digitalmars-d-learn can you
try it from console?
something like dmd.exe -m32mscoff your_d_file.d
same error , it's only dll project like this. console project can
build successfully with
the
Dne 26.8.2016 v 09:12 magicdmer via Digitalmars-d-learn napsal(a):
On Friday, 26 August 2016 at 07:00:37 UTC, rikki cattermole wrote:
Okay so your Windows language is non-english, that'll be it.
You need to be looking into the encoding that Visual Studio is using
for you files. Something to
Dne 26.8.2016 v 08:56 Alex via Digitalmars-d-learn napsal(a):
void main()
{
import std.json;
import std.stdio;
string s = "{ \"language\": \"D\", \"rating\": 3.14, \"code\": 42 }";
JSONValue j = parseJSON(s);
writeln("code: ", j["code"].integer);
auto j2 = j;
On Friday, 26 August 2016 at 07:00:37 UTC, rikki cattermole wrote:
Okay so your Windows language is non-english, that'll be it.
You need to be looking into the encoding that Visual Studio is
using for you files. Something to do with the BOM or hasn't
even been set to utf-8 isn't quite right.
Dne 26.8.2016 v 08:52 magicdmer via Digitalmars-d-learn napsal(a):
On Friday, 26 August 2016 at 06:38:01 UTC, Daniel Kozak wrote:
That image is too small, so I can't see it :)
Dne 26.8.2016 v 08:26 magicdmer via Digitalmars-d-learn napsal(a):
I use VisualD create a windows dll project , and
On 26/08/2016 6:52 PM, magicdmer wrote:
On Friday, 26 August 2016 at 06:38:01 UTC, Daniel Kozak wrote:
That image is too small, so I can't see it :)
Dne 26.8.2016 v 08:26 magicdmer via Digitalmars-d-learn napsal(a):
I use VisualD create a windows dll project , and select the "Use
MS-COFF
Hi everybody,
I'm little at loss: as documented, a JSONValue is only shallow
copied:
void main()
{
import std.json;
import std.stdio;
string s = "{ \"language\": \"D\", \"rating\": 3.14,
\"code\": 42 }";
JSONValue j = parseJSON(s);
writeln("code: ", j["code"].integer);
On Friday, 26 August 2016 at 06:38:01 UTC, Daniel Kozak wrote:
That image is too small, so I can't see it :)
Dne 26.8.2016 v 08:26 magicdmer via Digitalmars-d-learn
napsal(a):
I use VisualD create a windows dll project , and select the
"Use MS-COFF object file fromat for win32" . when i build
That image is too small, so I can't see it :)
Dne 26.8.2016 v 08:26 magicdmer via Digitalmars-d-learn napsal(a):
I use VisualD create a windows dll project , and select the "Use
MS-COFF object file fromat for win32" . when i build it ,it display
the error follow ,look at the picture
I use
I use VisualD create a windows dll project , and select the "Use
MS-COFF object file fromat for win32" . when i build it ,it
display the error follow ,look at the picture
I use dmd 2.071.1
https://s14.postimg.org/a4wcv74ct/image.png
32 matches
Mail list logo