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

Questions about the polymake shell mode #426

Open
fingolfin opened this issue Mar 17, 2023 · 2 comments
Open

Questions about the polymake shell mode #426

fingolfin opened this issue Mar 17, 2023 · 2 comments

Comments

@fingolfin
Copy link
Member

I recently discovered the polymake shell mode trigger by $ pressed at the start of a Julia prompt, just like the Pkg and shell prompt modes in Julia. Nice!

I have some questions / suggestions on this:

  1. the prompt does not seem to echo results, unlike the Julia prompt. So if I do $i = 42; in one line; and then on the next line enter $i;, I would expect it to print 42 but it does not. I figured out that I can do print($i); to see it, but I think it would be nice to get this echo. Would this be possible to add?

  2. Is there any documentation? Or a desire at least for some? I'd be happy to contribute, too.

  3. Could we also make it accessible via say Polymake.prompt() to make it more discoverable? Just like we have GAP.prompt() (in return, I also would like to be able to trigger the GAP prompt with a key press, but it has problems, like: not being discoverable; unclear what to do if other packages use the same hotkey; difficult to visually show what happens when entering/exiting the mode in demos)

  4. Why is the prompt common > (with a space) and not common> or even polymake>?

@benlorenz
Copy link
Member

  1. the prompt does not seem to echo results, unlike the Julia prompt. So if I do $i = 42; in one line; and then on the next line enter $i;, I would expect it to print 42 but it does not. I figured out that I can do print($i); to see it, but I think it would be nice to get this echo. Would this be possible to add?

This is supposed to mimic the normal polymake shell as closely as possible. Automatically printing objects can have some unintended side-effects in perl, e.g. visualization windows opening twice, because the to-string operator might be overloaded. So I would prefer not to change this.

  1. Is there any documentation? Or a desire at least for some? I'd be happy to contribute, too.

This seems to be undocumented, but we can add a short description for this prompt in a few places.

  1. Could we also make it accessible via say Polymake.prompt() to make it more discoverable? Just like we have GAP.prompt() (in return, I also would like to be able to trigger the GAP prompt with a key press, but it has problems, like: not being discoverable; unclear what to do if other packages use the same hotkey; difficult to visually show what happens when entering/exiting the mode in demos)

Yes, that should be easy to add. (I recently noticed that the $ hotkey is also used by the RCall package)

  1. Why is the prompt common > (with a space) and not common> or even polymake>?

It is again replicating the normal polymake prompt and common is one of the applications (like namespaces) in polymake. To avoid issues with function / type lookup Polymake.jl uses the most basic application as the global application and does not use polytope > by default as the polymake shell. You can switch the prompt with application("polytope"); (or using any other application) in the prompt.

But it might make sense to add polymake to the prompt as well to make it more clear that this is a polymake prompt, e.g. polymake (common)>.

@fingolfin
Copy link
Member Author

+1 from me for polymake (common)> (or so) as prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants