Open Tinynja opened 7 months ago
Hi thanks for your efforts. However, I am not convinced yet, that this feature is necessary. The string type was introduced 8 years ago and in my experience they are way more convenient to use then chars in 99 % of cases. As for older Matlab versions, this package requires R2019b anyway. Can you describe the cases where you found it convenient to have chars in more detail?
Summary
I added the option StringToChar to
load.m
andloadFile.m
, which lets the user choose if YAML String should be converted to MATLAB string (default, false) or MATLAB char (true).Rationale
Depending on the context, MATLAB char are sometimes easier to manipulate than MATLAB string, especially in older versions of MATLAB. Therefore in many of my use cases, I found it useful to have an option to decide what should YAML String be converted to.
I can't imagine any YAML combination where using char would create a bug, because Sequences are converted to cell arrays, and Mappings are converted to struct, which both support char's correctly.
Feel free to change the name of the option or the implementation of the feature!