Re: Dynamically loading a D dynamic library from a c++ program

2014-09-27 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-09-26 21:52, John Colvin wrote: Yes, but it depends on the complexity of the headers. C++ templates aren't supported for example. Templates are supported, if they're already instantiated. -- /Jacob Carlborg

Re: Dynamically loading a D dynamic library from a c++ program

2014-09-27 Thread John Colvin via Digitalmars-d-learn
On Saturday, 27 September 2014 at 09:19:57 UTC, Jacob Carlborg wrote: On 2014-09-26 21:52, John Colvin wrote: Yes, but it depends on the complexity of the headers. C++ templates aren't supported for example. Templates are supported, if they're already instantiated. Sorry, yes, I should

Re: Can I make a variable public and readonly (outside where was declared) at same time?

2014-09-27 Thread via Digitalmars-d-learn
On Friday, 26 September 2014 at 18:18:45 UTC, Steven Schveighoffer wrote: On 9/26/14 1:36 PM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Alternatively, you could create a union with a private and a public member with the same types, but I wouldn't recommend it. Besides, the

Recursive data-types

2014-09-27 Thread ponce via Digitalmars-d-learn
I'm dabbling with Scheme interpreter and ultimately I would need to declare the following types. -- struct Function { Environment env; Atom params; Atom body_; } // An atom is either a string, a double, a symbol, a function or a list of atoms alias Atom =

Re: Recursive data-types

2014-09-27 Thread Rikki Cattermole via Digitalmars-d-learn
On 27/09/2014 11:26 p.m., ponce wrote: I'm dabbling with Scheme interpreter and ultimately I would need to declare the following types. -- struct Function { Environment env; Atom params; Atom body_; } // An atom is either a string, a double, a symbol, a function or

Re: Recursive data-types

2014-09-27 Thread ponce via Digitalmars-d-learn
On Saturday, 27 September 2014 at 11:40:19 UTC, Rikki Cattermole wrote: How to get out of this trap? Do I have to drop Algebraic and go back to manual tagged unions? Converting Function to a class. No where near ideal. But it'll work. It does work! Thanks. Actually it's quite appropriate

Problem building dmd d_do_test tool - missing link operand

2014-09-27 Thread Nick Treleaven via Digitalmars-d-learn
Hi, I used to run the ddoc tests with no problem, but for the last month or so I ran into problems building the d_do_test tool from latest Git dmd. (As I didn't need the latest dmd at the time, I just used an older one for a while). Maybe I'm doing something wrong with my build setup for

Re: Problem building dmd d_do_test tool - missing link operand

2014-09-27 Thread Nick Treleaven via Digitalmars-d-learn
On 27/09/2014 12:59, Nick Treleaven wrote: # in dmd/test $ make DMD=../src/dmd.exe QUIET='' Building d_do_test tool OS: win32 ../src/dmd.exe -m32 -unittest -run d_do_test.d -unittest /usr/bin/link: missing operand after `d_do_test,,nul,user32+kernel32/noi;' Try `/usr/bin/link --help' for more

Re: Recursive data-types

2014-09-27 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Sep 27, 2014 at 11:26:31AM +, ponce via Digitalmars-d-learn wrote: I'm dabbling with Scheme interpreter and ultimately I would need to declare the following types. -- struct Function { Environment env; Atom params; Atom body_; } // An atom is

Debugging on OSX

2014-09-27 Thread Phil via Digitalmars-d-learn
I've seen a few old threads mentioning this, but couldn't find anything more recent. What support is there for debugging on OSX? I'm currently trying MonoD, but the option to run with debugger is greyed out.

Re: Recursive data-types

2014-09-27 Thread Meta via Digitalmars-d-learn
On Saturday, 27 September 2014 at 11:26:33 UTC, ponce wrote: I'm dabbling with Scheme interpreter and ultimately I would need to declare the following types. -- struct Function { Environment env; Atom params; Atom body_; } // An atom is either a string, a double, a

Re: Recursive data-types

2014-09-27 Thread ponce via Digitalmars-d-learn
On Saturday, 27 September 2014 at 14:08:18 UTC, H. S. Teoh via Digitalmars- What about using Atom*[] instead of Atom[]? Atom[] seems simpler to me.

Re: Recursive data-types

2014-09-27 Thread ponce via Digitalmars-d-learn
On Saturday, 27 September 2014 at 15:45:20 UTC, Meta wrote: Also, you might want to use This* instead of This[], unless you want an Atom to be able to contain a whole array of other atoms. That's indeed what I want.

Re: Recursive data-types

2014-09-27 Thread thedeemon via Digitalmars-d-learn
On Saturday, 27 September 2014 at 11:40:19 UTC, Rikki Cattermole wrote: These definitions can't work since Function and Atom need each other in this recursive definition. How to get out of this trap? Do I have to drop Algebraic and go back to manual tagged unions? Converting Function to a

Re: Can I make a variable public and readonly (outside where was declared) at same time?

2014-09-27 Thread AsmMan via Digitalmars-d-learn
On Friday, 26 September 2014 at 18:18:45 UTC, Steven Schveighoffer wrote: On 9/26/14 1:36 PM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Alternatively, you could create a union with a private and a public member with the same types, but I wouldn't recommend it. Besides, the

std.container.Array support in msgpack

2014-09-27 Thread Nordlöw
I'm trying to figure out how to add raw bytes the packed stream in msgpack-d. My current try is import std.stdio; import std.conv: to; import std.container: Array; import msgpack; static void stringArrayPackHandler(E)(ref Packer p, ref Array!E x) { //

Re: Can I make a variable public and readonly (outside where was declared) at same time?

2014-09-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/27/14 5:48 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net Yes, that's what I originally intended. Just forgot the const, and didn't even notice it after I reread it :-P I wondered... ;) -Steve