From abef7c44adef227f789567aae2aba70c0a3028e9 Mon Sep 17 00:00:00 2001 From: Edwin Kofler Date: Fri, 20 Oct 2023 07:20:43 -0700 Subject: [PATCH] Add Vale --- .vale.ini | 4 ++++ docs/internals/virtual-object.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .vale.ini diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 0000000..4011b8f --- /dev/null +++ b/.vale.ini @@ -0,0 +1,4 @@ +MinAlertLevel = suggestion + +[*] +BasedOnStyles = Vale diff --git a/docs/internals/virtual-object.md b/docs/internals/virtual-object.md index 115a197..d913b5f 100644 --- a/docs/internals/virtual-object.md +++ b/docs/internals/virtual-object.md @@ -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=` 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