numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
18 stars 6 forks source link

Default value of 'getkeyval()' does not work #65

Closed numeredev closed 1 year ago

numeredev commented 1 year ago

DESCRIPTION

Describe the bug Using the default value of getkeyval() for the third parameter (as described by the documentation, it is sDef="") does not work but throws an empty expression error. If the default value is used explicitly, the error goes away.

To Reproduce Steps to reproduce the behavior:

  1. Create a key-value cluster kvlist{}
  2. Try to read a value of an non-existing key using getkeyval(kvlist{}, "non-existing-key")
  3. See error (disappears, if used like getkeyval(kvlist{}, "non-existing-key", "")

Expected behavior The behavior of getkeyval(kvlist{}, "non-existing-key") and getkeyval(kvlist{}, "non-existing-key", "") should be identical.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

(Do not write below this line)


DEVS' SECTION

ANALYSIS

The problem is rooted in the fact that the StringArg class does not default to an empty string (which might be intentional). Figure out, why is that and how to resolve the missing default value the optimal way.

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST