Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variableDiff misses documentation #37

Open
LFSaw opened this issue Nov 13, 2017 · 6 comments
Open

variableDiff misses documentation #37

LFSaw opened this issue Nov 13, 2017 · 6 comments

Comments

@LFSaw
Copy link
Contributor

LFSaw commented Nov 13, 2017

changes introduced in #26 are lacking documentation.

@telephon
Copy link
Collaborator

telephon commented Nov 13, 2017

It would be good indeed to have a file with some more tests and examples. Especially the different behaviors of the VarDiff variants should be made explicit and also tested. @rkuivila could you do that?

I'd say that the whole interface is still provisional, once it is safe, I'd like to refactor it into Steno, and at the same time make VarDiff more general so it can be moved to the default library.

@rkuivila
Copy link
Contributor

rkuivila commented Nov 13, 2017 via email

@telephon
Copy link
Collaborator

Well, there is not much philosophy behind DiffString apart from the one that the programmers of the unix diff have cast into it. It is really just an interface to the unix diff, and it makes those distinctions. It has nothing to do with the steno semantics, as long as:

  1. the diff semantics are explainable and make sense in the steno paradigm
  2. they can be executed withing the steno paradigm

So, I would propose that delete, insert, retain are the natural categories and swap should be eliminated.

Yes, why not. I think it might be better to make these operations part of the external interface of steno, so you can also put a letter somewhere by hand.

My suggestion is that I open a branch where I do a refactoring until VarDiff can operate on steno from without.

@rkuivila
Copy link
Contributor

rkuivila commented Nov 13, 2017 via email

@telephon
Copy link
Collaborator

It strikes me that there is no "correct" order of execution of update functions. Deletions might be need to be before or after additions depending on what is being represented.

So the user could iterate that array of triples and select functions based on the args. That would give the user the option to reorganize things as needed with a sort.

Yes, that's true for the general case. But will indices stay consistent with order? When removing an item you'll have to keep track of the shift of indices that come after it.

Similarly, "swap" appears to be a deletion and insertion at an index that happens to be within the range of the source string. This seems to reflect the implementation rather than the desired semantics.

Actually, thinking about it again, I'd say the opposite: reducing swap to remove + insert is exposing an operational implementation detail. Swapping one element against another has a specific meaning, that in some cases you might want to account for (e.g. one might want to swap a synth, but keep the parameters). But for the current case it doesn't matter and I don't mind if we don't want to support it.

@LFSaw
Copy link
Contributor Author

LFSaw commented Nov 13, 2017

reducing swap to remove + insert is exposing an operational implementation detail. Swapping one element against another has a specific meaning, that in some cases you might want to account for

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants