pyth icon indicating copy to clipboard operation
pyth copied to clipboard

Rearranging orders of operations to put potential input last

Open isaacg1 opened this issue 8 years ago • 8 comments

I'd like to accumulate a list of all functions that we should swap the order of operations on to allow the use of implicit Q more often. Starting list:

  • @<col><int>
  • c<str><str>
  • i<col><int>
  • j<col><int>
  • r<str><int>
  • .:<col><int>
  • .x<any><any>
  • .c, .C, .P

I'm not sure about these:

  • x<col><col>
  • X

isaacg1 avatar Apr 05 '16 07:04 isaacg1

This is actually a good reason to keep the lambdas ones the way they are now instead of switching them like we were planning. Maybe keep some like m and switch say f.

Maltysen avatar Apr 05 '16 13:04 Maltysen

I'd much prefer that they all go the same way, for learnability.

isaacg1 avatar Apr 05 '16 15:04 isaacg1

This isn't "switching" them per-say, but I feel like the default value on q should be removed or moved to something else after implicit Q has been added, since I find myself wanting to compare with the input fairly often.

Maltysen avatar Apr 14 '16 00:04 Maltysen

That's a good point, I'll change that now. This is a good place to accumulate additional examples like that one.

isaacg1 avatar Apr 14 '16 00:04 isaacg1

Also, .> and .<

isaacg1 avatar Apr 24 '16 08:04 isaacg1

I just realized that we don't have to necessarily have to switch the input order to have he order that they fill up in switch. For example: @3 could expand to @Q3.

Maltysen avatar Jun 13 '16 03:06 Maltysen

That's an interesting idea - I like anything we can do to increase backward compatibility while getting the same advantages.

On Sun, Jun 12, 2016 at 11:54 PM Maltysen [email protected] wrote:

I just realized that we don't have to necessarily have to switch the input order to have he order that they fill up in switch. For example: @3 could expand to @Q3.

— You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub https://github.com/isaacg1/pyth/issues/187#issuecomment-225484552, or mute the thread https://github.com/notifications/unsubscribe/ARXYrtJdhaOxK_hdu9oX20Oz2UwnP88oks5qLNR1gaJpZM4H_0Qb .

pyth-watcher avatar Jun 13 '16 04:06 pyth-watcher

Wouldn't that complicate the parser more? You need to detect you're at eof, and that you were parsing a @ (i.e. @hT)

vendethiel avatar Jun 13 '16 07:06 vendethiel