isaacg1 / pyth

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

Flags #135

Closed Ypnypn closed 9 years ago

Ypnypn commented 9 years ago

I have this rough idea for adding flags to Pyth.

Let's say 1 is "all string comparison is ignore-case"; 2 is "suppress printing by default"; 4 is "printing is space-separated."

To use multiple flags, add them up, and put the sum at the beginning of the code.

So 5lots of pyth code applies flags 1 and 4.

This shouldn't cause problems, because it's otherwise rare to start a program with a number. If someone really needs to print a number at the beginning, they can always do something like h4.

I'm not really sure flags would actually be useful. This is just a thought I had.

isaacg1 commented 9 years ago

Why not use the command line for the flags? They're counted the same in code golf.

orlp commented 9 years ago

This is implemented in Pyth5 as meta-commands. However, I don't like to make 'useful' flags that alter behavior - I want to reserve it for development / debugging only. As such, the only meta-command implemented in Pyth5 is ;# end, which makes Pyth ignore the rest of the file (except later meta-commands).

isaacg1 commented 9 years ago

This doesn't seem incredibly useful.