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

Wish: run the replpad with a GET parameter #43

Open
gchiu opened this issue Apr 5, 2019 · 2 comments
Open

Wish: run the replpad with a GET parameter #43

gchiu opened this issue Apr 5, 2019 · 2 comments
Assignees

Comments

@gchiu
Copy link
Collaborator

gchiu commented Apr 5, 2019

eg. http://hostilefork.com/media/shared/replpad-js?do=nzpower

or http://hostilefork.com/media/shared/replpad-js/?do=<nzpower>

so the replpad immediately runs the user utility instead of dropping to the console.

@hostilefork
Copy link
Owner

I definitely like the idea of having some syntax for this.

Rather than just doing something random for it, though, I feel like we should look at the finer points and actually design the arguments feature.

So not only would we be thinking about what the right levels of indirection are (a table like the one where <nzpower> lives to be translated into a URL), but also running scripts from GitHub URLs, or passing arguments to these scripts.

Also these parameters have to live alongside other parameters for controlling the behavior of the ReplPad, such as the developer parameter for running from a local build of libr3.

I know little about conventions for this kind of parameterization, so if anyone has things they know it might be good to start from listing that.

@hostilefork
Copy link
Owner

hostilefork commented Apr 14, 2019

@gchiu was impatient so I added a very basic version of this feature, despite lack of a formal specification:

a57e3f3

I still would like a reasoned formal specification. There are questions here about how this interacts with the REPL, e.g. when it should drop you to it after running... kind of all the same questions we'd have about specifying on the command line. It would be nice if there could be some consistency in the switches, e.g. r3 --do xxx lining up with ?do=xxx in some way.

Before this goes any further I'd like to understand what notations and escapings are legal or illegal, and such. There's issues like how <script> in the shell introduces file redirection with > and <...and I know these are likely tricky URL characters. Let's try and see if this can be done in a forward-looking way.

(See also new helper: JS-EVAL, for easily getting string/integer/null values from JavaScript expressions...and a bugfix for PRINT after a ReplPad-Reset)

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

4 participants