You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If "namespace" pragma exists in scratch file and then you edit something, terms will behave counterintuitively.
foo.bar = 5
fizz.bar = 6
scratch/main> add foo.bar fizz.bar
namespace foo
scratch/main> edit foo.bar fizz.bar
Now in the scratch file you'll essentially be creatingfoo.foo.bar and foo.fizz.bar instead of editingfoo.bar and fizz.bar because the term names remain unaltered but the existence of namespace foo implicitly alters those term names.
Environment (please complete the following information):
ucm --version release/0.5.29
macOS 15
** What should happen**
I think what should happen is:
for anything being edited that's part of the namespace, strip the namespace from the term when it's inserted into the scratch file
for anything being edited that is not part of the namespace, append a "project root" prefix to the term name so it doesn't get added to the namespace when you add/update.
The text was updated successfully, but these errors were encountered:
A namespace pragma unfortunately can't really be used safely in conjunction with edit. It's really only meant to speed up the authoring workflow for deeply-nested namespaces.
You might think we could render something like edit foo.bar.baz.qux as
namespace foo.bar.baz
qux = ...
but the problem is foo.bar.baz.qux could (for example) refer to itself and a term named qux:
foo.bar.baz.qux = ... foo.bar.baz.qux ... qux ...
That prevents us from putting a namespace foo.bar.baz directive, since it (by design) re-targets free variables (like qux) that refer to locally-bound top-level definitions.
So, in short, I wouldn't freely mix namespace directives with edit and expect things to work well.
Describe and demonstrate the bug
If "namespace" pragma exists in scratch file and then you edit something, terms will behave counterintuitively.
Now in the scratch file you'll essentially be creating
foo.foo.bar
andfoo.fizz.bar
instead of editingfoo.bar
andfizz.bar
because the term names remain unaltered but the existence ofnamespace foo
implicitly alters those term names.Environment (please complete the following information):
ucm --version
release/0.5.29** What should happen**
I think what should happen is:
The text was updated successfully, but these errors were encountered: