Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AFE does not recognize names of the form "Func.1A" #13

Closed
cjhesse opened this issue Mar 9, 2022 · 3 comments · Fixed by #23
Closed

AFE does not recognize names of the form "Func.1A" #13

cjhesse opened this issue Mar 9, 2022 · 3 comments · Fixed by #23
Labels
bug Something isn't working

Comments

@cjhesse
Copy link

cjhesse commented Mar 9, 2022

Prior to knowing AFE existed, I created several functions that used a similar concept of a namespace, but after the period, I used a number followed by a letter. On its own, a name can't begin with a number, but both Name Manager and LAMBDA handle my names fine.

One example is "TLU.3D"--a three-dimensional table lookup function.

It appears that AFE is recognizing "TLU" as the namespace, but when it sees "3D" it doesn't import it because it starts with a number. It does this even though "TLU.3D" meets name definition requirements.

For such named functions, AFE won't import them from name manager, nor can I import them by pasting the text. AFE doesn't give the "Incorrect name syntax" message either. Is this a feature or a bug?

@jack-williams jack-williams added the bug Something isn't working label Mar 9, 2022
@jack-williams
Copy link
Contributor

Behind the scenes we model namespaces as a file, using the base name to define the name, like:

// in namespace TLU
3D = LAMBDA(x, ... );

This assumes that the base is itself a valid name. In cases where the name is not individually valid, we report an error and do not save it to the manager.

We should not "split" names into namespace / base when each part is individually not a valid name. Instead, we should treat it as atomic and put it in the top level namespace. So it would look something like:

// in namespace 'Workbook'
TLU.3D = LAMBDA(x, ...);

@cjhesse
Copy link
Author

cjhesse commented Mar 11, 2022

That sounds like a good solution to me.

I wanted to note that I created a gist with the affected functions in text form, and when I imported them that way, they all went to the workbook namespace and worked as expected. If the "hidden worksheet" option is enabled, they continue working with AFE after saving and reopening the workbook, but if the "hidden worksheet" is disabled, they won't be recognized later.

Perhaps the capability to import from text into the workbook namespace, or to move items (and rename as appropriate) from a given namespace into the workbook namespace would be helpful.

@jack-williams
Copy link
Contributor

The latest version of manages namespaces, now called modules, explicitly. This is in contrast to the previous behaviour of representing names both as namespaces and in the manager, determined by splitting on a dot. As a result, AFE will no longer try and split something like TLU.3D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants