You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, an InsertChar atom can be a direct children of the root atom, since we assume that the whole RList corresponds to a single string. However, in the process to create a nested data structure, we may want to have multiple strings in the same tree.
To accomplish that, we'll create a container for chars, called Str. Multiple Strs may appear as children of the root empty node, and InsertChar operations are only valid within a Str.
Data structures
type Str struct {} // implements AtomValue
Str atoms only accept InsertChar and Delete atoms as children.
InsertChar atoms only accept InsertChar and Delete atoms as children.
The root node must not accept InsertChar as children.
Build changes
RList.AsString() must validate that the cursor corresponds to a Str node.
RList.SetCursor must now be able to move in two dimensions: among the children of the root node, and over the children of a Str, as it does now.
Note: a good solution here should allow for deeply nested structures. We should be looking on how to specify a path within the (semantic) structure, and then translate it into a position in the array.
Add operation to crdt/rlist_operations_test.go
Run go test -fuzz FuzzList and fix any crashes that appear
Write manual tests in crdt/rlist_test.go
Demo changes
Fix cmd/demo/demo.go to create a str before starting to insert chars.
(bonus) allow multiple strings in the user interface.
The text was updated successfully, but these errors were encountered:
Currently, an
InsertChar
atom can be a direct children of the root atom, since we assume that the wholeRList
corresponds to a single string. However, in the process to create a nested data structure, we may want to have multiple strings in the same tree.To accomplish that, we'll create a container for chars, called
Str
. MultipleStr
s may appear as children of the root empty node, andInsertChar
operations are only valid within aStr
.Data structures
Str
atoms only acceptInsertChar
andDelete
atoms as children.InsertChar
atoms only acceptInsertChar
andDelete
atoms as children.InsertChar
as children.Build changes
RList.AsString()
must validate that the cursor corresponds to aStr
node.RList.SetCursor
must now be able to move in two dimensions: among the children of the root node, and over the children of aStr
, as it does now.crdt/rlist_operations_test.go
go test -fuzz FuzzList
and fix any crashes that appearcrdt/rlist_test.go
Demo changes
cmd/demo/demo.go
to create a str before starting to insert chars.The text was updated successfully, but these errors were encountered: