Re: (De)Serializing interfaces

2015-08-28 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-22 21:14, nims wrote: I think interfaces are very powerful and I heavily use them. The only problem I have with them is that serializing/deserializing them to XML or JSON doesn't seem to work. So far I got to try Orange and painlessjson. Using Orange all I got was a lot of compiler

Re: (De)Serializing interfaces

2015-08-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-22 21:14, nims wrote: Using Orange all I got was a lot of compiler errors. Seems I completely overlooked interfaces. I'll see if I can add support for them. -- /Jacob Carlborg

Re: (De)Serializing interfaces

2015-08-24 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Monday, 24 August 2015 at 09:26:40 UTC, Edwin van Leeuwen wrote: On Saturday, 22 August 2015 at 19:14:16 UTC, nims wrote: Painlessjson indeed does not support interfaces/subclasses at the moment. There was some discussion about it here: https://github.com/BlackEdder/painlessjson/issues/8 ,

Re: (De)Serializing interfaces

2015-08-24 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Saturday, 22 August 2015 at 19:14:16 UTC, nims wrote: I think interfaces are very powerful and I heavily use them. The only problem I have with them is that serializing/deserializing them to XML or JSON doesn't seem to work. So far I got to try Orange and painlessjson. Using Orange all I

Re: (De)Serializing interfaces

2015-08-23 Thread nims via Digitalmars-d-learn
On Sunday, 23 August 2015 at 03:09:03 UTC, Rikki Cattermole wrote: Anyway to summise why D doesn't yet have something akin to Java or C#. Simply put, we generally work with the actual type not an interface. So libraries like Orange can serialize/deserialize with great certainty that it got

Re: (De)Serializing interfaces

2015-08-23 Thread nims via Digitalmars-d-learn
On Sunday, 23 August 2015 at 08:38:14 UTC, Rikki Cattermole wrote: What I was thinking was having a serialize method take an output range which you will just pass in a value. I'm not really sure what you mean. Replacing the operator by a range function or serializing everything automatically?

Re: (De)Serializing interfaces

2015-08-23 Thread nims via Digitalmars-d-learn
On Sunday, 23 August 2015 at 03:25:27 UTC, Kapps wrote: I've never used Orange, but one thing you could try is casting your object from MyInterface to Object, and registering the type Foobar like in http://dsource.org/projects/orange/wiki/Tutorials/SerializeBase, then serializing/deserializing

Re: (De)Serializing interfaces

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/23/2015 10:17 PM, nims wrote: On Sunday, 23 August 2015 at 08:38:14 UTC, Rikki Cattermole wrote: What I was thinking was having a serialize method take an output range which you will just pass in a value. I'm not really sure what you mean. Replacing the operator by a range function or

Re: (De)Serializing interfaces

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/23/2015 8:15 PM, nims wrote: On Sunday, 23 August 2015 at 03:09:03 UTC, Rikki Cattermole wrote: Anyway to summise why D doesn't yet have something akin to Java or C#. Simply put, we generally work with the actual type not an interface. So libraries like Orange can serialize/deserialize

Re: (De)Serializing interfaces

2015-08-23 Thread Rikki Cattermole via Digitalmars-d-learn
On Sunday, 23 August 2015 at 10:37:11 UTC, Rikki Cattermole wrote: On 8/23/2015 10:17 PM, nims wrote: On Sunday, 23 August 2015 at 08:38:14 UTC, Rikki Cattermole wrote: What I was thinking was having a serialize method take an output range which you will just pass in a value. I'm not really

(De)Serializing interfaces

2015-08-22 Thread nims via Digitalmars-d-learn
I think interfaces are very powerful and I heavily use them. The only problem I have with them is that serializing/deserializing them to XML or JSON doesn't seem to work. So far I got to try Orange and painlessjson. Using Orange all I got was a lot of compiler errors. Painlessjson did compile

Re: (De)Serializing interfaces

2015-08-22 Thread Kapps via Digitalmars-d-learn
On Saturday, 22 August 2015 at 19:14:16 UTC, nims wrote: I think interfaces are very powerful and I heavily use them. The only problem I have with them is that serializing/deserializing them to XML or JSON doesn't seem to work. So far I got to try Orange and painlessjson. Using Orange all I

Re: (De)Serializing interfaces

2015-08-22 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/23/2015 7:14 AM, nims wrote: I think interfaces are very powerful and I heavily use them. The only problem I have with them is that serializing/deserializing them to XML or JSON doesn't seem to work. So far I got to try Orange and painlessjson. Using Orange all I got was a lot of compiler