Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
best way to execute specific operations within Go? #2
Hello, I think this is extremely cool. I did however notice that both you, the Android/iOS ports, as well as Rob Pike's command line program all worked the same way (basically giving user's free reign over which commands that they'd like to execute).
My question is, what if you provided two html input fields with the purpose of (e.g.) subtracting X% from Y value. How would you go about executing this command with Rob Pike's code?
To make myself more clear, let's say the user submitted the form values, on the server you get them by:
Hope you don't mind me 'abusing' your repo with this question, but I doubt Rob Pike would reply, and besides him then I feel you're the best person to ask (:
How about writing an equation out, then sending the final equation to the function? i.e. "1" is in one edit field, and "2" is in another field... so create a final string "1+2" and send that equation string to the necessary function. This would simply be an equation an writer that takes multiple inputs, then puts it into a single final equation to send to an ivy function. Sorry, not sure if this helps you or if it is what you are after.
ivy is described as:
All the current versions of ivy offer a terminal-like UI for interacting with it.
As @z505 said, I think your best bet is to merge the values into an entire command, and send that to the ivy interpreter for processing.
Keep in mind it has state, e.g., you can declare variables, then use them in later invocations. You may or may not want that.
I'm not sure how else to answer this.
There's an "execute" flag in ivy that makes it execute a single expression. Look at how that works. See here.
Thanks a lot :)