The functionality to extend and augment the context-sensitive menus is quite nice. I especially like the submodule ContextMenu:-Test whose exports allow one to programmatically test the results and new menus.

But what about installing menus with items whose type checks relate to locals?

Here's a simple example.

> newCM:=ContextMenu:-New():
> newCM[Entries][Add]("local to global", "convert(%EXPR,`global`)", `local`):
> newCM[Entries][Add]("global to local", "convert(%EXPR,`local`)", `global`):
> ContextMenu:-Install(newCM);

> z:=proc() local x; x; end():
> type(z,`local`);
true

> ContextMenu:-Test:-GetGeneratedMenu(z);
["local to global"]
> ContextMenu:-Test:-GetGeneratedMenu(y);
["global to local"]
> y;
y

> z;
x

Now right-click on both the outputs above, the y and the x. Notice that the menu that appears for the local x does not actually contain the intended entry "local to global". Yet the GetGeneratedMenu(z) result does show up with "local to global". So the library function appears to act as if that menu entry should show up. But in practice, when right-clicking, it doesn't seem to appear.

You might think, well, who would want to have context menu entries to deal with something as esoteric as escaped locals? Ok, but what about objects that appear as, say, unevaluated module export calls?

acer


Please Wait...