I requiring an undo feature in my code. Rather than go the
regular route of using commands, I'm wondering if D can
facilitate an undo system quite easily?
We can think of an undo system in an app as a sort of recorder.
The traditional method is to use commands and inverse-commands
Is there a way to integrate a undo/redo system in an already
existing app without a huge amount of recording to support it?
I.e., converting to using commands. I'd like to specify what is
going to be modified and what needs to be done to restore the
state. Given D's strong meta capab
A simple(incomplete) undo system.
I'm curious about the overhead. The idea is to wrap any system
changes using the Add function. This function stores both the
forward and backward state changes using delegates.
By using forward, we call the action passed to set the data and
backward
On Tuesday, 10 October 2017 at 02:36:56 UTC, Mr. Jonse wrote:
I requiring an undo feature in my code. Rather than go the
regular route of using commands, I'm wondering if D can
facilitate an undo system quite easily?
We can think of an undo system in an app as a sort of recorder.
On Thursday, 12 October 2017 at 02:18:49 UTC, Mr. Jonse wrote:
A simple(incomplete) undo system.
I'd think that for D you'd want to do type wrapping where a new
type is created which saves changes and can manage an Undo tree.
__gshared Data data = new Data();
auto undoa
Is there any idiomatic undo designs in D that give a more natural
implementation than the standard techniques?
On Saturday, 23 June 2018 at 01:58:31 UTC, DigitalDesigns wrote:
Is there any idiomatic undo designs in D that give a more
natural implementation than the standard techniques?
- The "stuff to undo" can be a forward range ("save" primitive, +
assignable from a stored state
On Saturday, 23 June 2018 at 14:06:08 UTC, Basile B. wrote:
On Saturday, 23 June 2018 at 01:58:31 UTC, DigitalDesigns wrote:
Is there any idiomatic undo designs in D that give a more
natural implementation than the standard techniques?
- The "stuff to undo" can be a forward ra
On Saturday, 23 June 2018 at 01:58:31 UTC, DigitalDesigns wrote:
Is there any idiomatic undo designs in D that give a more
natural implementation than the standard techniques?
There is the solution above, but there I've implemented something
similar in Diamond.
It's a little bit
Hi,
I am porting C++ code that undo "Object Slicing" by casting
const-references:
http://en.wikipedia.org/wiki/Object_slicing
My translation in D Code
struct A
{
// stuff
}
struct B
{
A a;
alias a this;
// stuff
}
void myFunction(ref const(A) a
Ok, solved it, I just use pointer casts and it seems to work when
the struct is sliced.
On Monday, 14 July 2014 at 13:23:57 UTC, ponce wrote:
Hi,
I am porting C++ code that undo "Object Slicing" by casting
const-references:
http://en.wikipedia.org/wiki/Object_slicing
My transl
23:57 UTC, ponce wrote:
>> Hi,
>>
>> I am porting C++ code that undo "Object Slicing" by casting
>> const-references:
>> http://en.wikipedia.org/wiki/Object_slicing
>>
>>
>> My translation in D Code
>>
>>
>> struct A
On Monday, 14 July 2014 at 18:43:36 UTC, Ali Çehreli wrote:
On 07/14/2014 10:35 AM, ponce wrote:
> Ok, solved it, I just use pointer casts and it seems to work
when the
> struct is sliced.
I think there is a terminology issue here. Slicing cannot be
undone; once the object is sliced, the non-A
On Monday, 14 July 2014 at 18:43:36 UTC, Ali Çehreli wrote:
It is guaranteed by the language spec that yes, myFunction()
takes an A by reference. However, you can't know where that A
is coming from; so, the safety of that cast is up to you.
Consider:
void foo(A a) // <-- Already slice
On 07/14/2014 02:34 PM, ponce wrote:
> On Monday, 14 July 2014 at 18:43:36 UTC, Ali Çehreli wrote:
>> On 07/14/2014 10:35 AM, ponce wrote:
>>
>> > Ok, solved it, I just use pointer casts and it seems to work
>> when the
>> > struct is sliced.
>>
>> I think there is a terminology issue here. Slici
15 matches
Mail list logo