isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
263 stars 57 forks source link

Multiplying a string by a negative number returns the reversed string multiplied #232

Closed Jim-Bar closed 7 years ago

Jim-Bar commented 7 years ago

Currently, doing *_2"abc will return an empty string. With the patch, the result would be cbacba which is more useful.

isaacg1 commented 7 years ago

In what scenarios is this more useful? I've had the empty string behavior be useful before.

Jim-Bar commented 7 years ago

I cannot objectively claim that it would be more useful than the current behaviour. Still, I encountered a challenge where this feature would have been more useful. What could be done is:

Jim-Bar commented 7 years ago

In this particular challenge, this feature would be useful (maybe two times in the same challenge).

isaacg1 commented 7 years ago

I'll implement the suggestion you mentioned - use both behavior.