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

Ideas for improvement #156

Open
isaacg1 opened this issue Oct 7, 2015 · 17 comments
Open

Ideas for improvement #156

isaacg1 opened this issue Oct 7, 2015 · 17 comments

Comments

@isaacg1
Copy link
Owner

isaacg1 commented Oct 7, 2015

This will be a thread for ideas for improvement of pyth:

Pyth eval/exec (not in safe mode)
Remove sets, make operations explicit.
bitwise operations
setwise operations
bagwise operations
operation on one location in a list. Like X, but an arbitrary operation.

@Maltysen
Copy link
Contributor

Maltysen commented Oct 8, 2015

Why not pyth eval in safe mode? Also, what are bags?

@isaacg1
Copy link
Owner Author

isaacg1 commented Oct 8, 2015

@Maltysen bags are like sets with multiplicity. .- uses them.
Pyth eval in safe mode should work, now that I think of it.

@Maltysen
Copy link
Contributor

Maltysen commented Oct 8, 2015

so like collections.Counter?

@isaacg1
Copy link
Owner Author

isaacg1 commented Oct 8, 2015

I haven't used that one, but it sounds about right. One difference is that bags usually don't allow negative counts, however.

@vendethiel
Copy link
Contributor

Could .e be made to work with a pfn? a simple example j+.eG

@jakobkogler
Copy link
Contributor

http://codegolf.stackexchange.com/questions/75335

It's really hard to split a sequence into pieces by a specific criterion.
Not really sure how a good solution should look like.
But a "split list by indices" function would be a good start. Like xG[1 5 should give ["a", "bcde", "fgh..."]

@isaacg1
Copy link
Owner Author

isaacg1 commented Mar 11, 2016

@jakobkogler That is the existing functionality of c. See here: https://pyth.herokuapp.com/?code=cG%5B1+5&debug=0

@jakobkogler
Copy link
Contributor

Oh, right.

2016-03-11 9:02 GMT+01:00 isaacg1 [email protected]:

@jakobkogler https://github.com/jakobkogler That is the existing
functionality of c. See here:
https://pyth.herokuapp.com/?code=cG%5B1+5&debug=0


Reply to this email directly or view it on GitHub
#156 (comment).

@FliiFe
Copy link
Contributor

FliiFe commented Apr 6, 2016

Maybe a string compression algorithm for short strings (.Z actually outputs something longer for short strings. For example, it outputs a 23 byte long string for a 11 bytes long string). I'm thinking about something like smaz (see this). Could be the same way of working, but with a new token (§n , ...)

@jakobkogler
Copy link
Contributor

@FliiFe Yeah, .Z is pretty bad. Don't think anybody ever used it.
But there is .", which compresses strings quite well.

@FliiFe
Copy link
Contributor

FliiFe commented Apr 8, 2016

Also, An issue I often come across, is that I can't find the list() constructor. And even cQk throws an error. The shortest I have found is :Q"."1

@isaacg1
Copy link
Owner Author

isaacg1 commented Apr 8, 2016

It looks like you're trying to convert a string to a list of characters. A couple of ways to do this are cQ1, which chops the string into pieces of length 1, and mdQ.

@FliiFe
Copy link
Contributor

FliiFe commented Apr 8, 2016

Oh, didn't think about them. Thanks! Another thing I've been thinking of, is a variable with default value 1

@jackHedaya
Copy link

Perhaps a way to write in Python and then have it converted to Pyth?

@isaacg1
Copy link
Owner Author

isaacg1 commented Jul 19, 2017

@jackHedaya That's very unlikely to ever be possible - the two languages are too different.

@jackHedaya
Copy link

I see... Perhaps better error displaying? For example showing at what point there is an error in terms of Pyth code.

@isaacg1
Copy link
Owner Author

isaacg1 commented Jul 20, 2017

@jackHedaya Could you give an example of the sort of thing you're thinking of?

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

6 participants