Skip to content

Commit

Permalink
Add Vale
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Oct 20, 2023
1 parent f0e0481 commit abef7c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MinAlertLevel = suggestion

[*]
BasedOnStyles = Vale
2 changes: 1 addition & 1 deletion docs/internals/virtual-object.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Virtual Object

Virtual objects are implemented as a string that contains some metadata and a reference to a variable. For example, in `$'\x1C\x1Dtype=array;&SUB_OBJECT'`, the metadata is `type=array`, and the reference is to the (global) variable `SUB_OBJECT`. Virutal objects always start with `$'\x1C\x1D`, to identify them amongst regular strings
Virtual objects are implemented as a string that contains some metadata and a reference to a variable. For example, in `$'\x1C\x1Dtype=array;&SUB_OBJECT'`, the metadata is `type=array`, and the reference is to the (global) variable `SUB_OBJECT`. Virtual objects always start with `$'\x1C\x1D`, to identify them amongst regular strings

The `type=<type>` may look redundant since the type can be checked without subshell creation with `${var@a}` or `${var@A}`. However, this only works on newer Bash versions. Additionally, it is faster to check the types when setting the object and then saving that data as a string, rather than re-checking the type on every access. Lastly, `bash-object` may be extended in the future to support custom objects, so a field for it in the meatdata is useful

0 comments on commit abef7c4

Please sign in to comment.