microsoft / advanced-formula-environment

Create, edit, and reuse formulas in Excel
https://aka.ms/get-afe
MIT License
109 stars 11 forks source link

Function names starting with underscore #57

Closed KDean-Dolphin closed 9 months ago

KDean-Dolphin commented 9 months ago

I have a library of about 100 functions, of which about 40 are internal and not intended to be called directly. These functions are not guaranteed to be stable, i.e., the can be deleted, renamed, have their parameters changed, etc., without notice.

To distinguish these functions from the ones users are actually interested in, I prefix them with underscore (e.g., "_StringToArray", which is called by "ValidateAlphanumericString" and many others). I'm in the process of converting my library to a module because I would like to deploy updates via Gist for my more advanced users, and I just discovered that, if the name starts with an underscore, the function isn't published.

For example, this module will publish the first function but not the second:

DoSquare =LAMBDA(x, x * x);

_DoCube =LAMBDA(x, x * x * x);

Renaming "_DoCube" to "X_DoCube" works fine, so it's only a problem if the underscore is at the beginning. Furthermore, module names can start with underscore; the problem is restricted to function names only.

Needless to say, without renaming, which I don't want to do, my library is broken.

jack-williams commented 9 months ago

They are published, but we publish them as hidden names so they do not show up in autocomplete.

KDean-Dolphin commented 9 months ago

I just went digging through the workbook XML and found them! That's brilliant, thanks. I was getting #NAME! errors all over the place after I published, but it turned out to be completely unrelated. I'm closing the issue.