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

Add -to-head and -shuffle #291

Closed
wants to merge 0 commits into from
Closed

Add -to-head and -shuffle #291

wants to merge 0 commits into from

Conversation

cireu
Copy link
Contributor

@cireu cireu commented Mar 15, 2019

Close #283 and #285

The tests won't pass in Emacs 24.2 or any lower version because we use random to create random seed. And this feature was introduced in Emacs 24.3. But I think the function of -shuffle can work well.

@debanjum
Copy link

debanjum commented Mar 5, 2023

@cireu, any blockers on this (apart from the merge conflicts)? Anything I could help out with?
It'd be great to have -shuffle in dash.el!

@basil-conto basil-conto added the enhancement Suggestion to improve or extend existing behavior label Mar 5, 2023
@Fuco1
Copy link
Collaborator

Fuco1 commented Mar 5, 2023

For the tests we can use cl-flet

(cl-flet ((random (n) 1)) (random 5))

I don't remember if this existed in Emacs 24.1 and .2 though.

@basil-conto
Copy link
Collaborator

Yet another possibility, as an alternative to controlling the randomness, is to enumerate all possible shuffle results.

@Fuco1
Copy link
Collaborator

Fuco1 commented Mar 5, 2023

is to enumerate all possible shuffle results.

I don't think that would be possible. Factorial grows faaaaast.

@basil-conto
Copy link
Collaborator

is to enumerate all possible shuffle results.

I don't think that would be possible. Factorial grows faaaaast.

I meant for small test cases of course :)

@Fuco1
Copy link
Collaborator

Fuco1 commented Mar 16, 2023

Uh, what happened here?:O The diff is thousands of lines

@cireu
Copy link
Contributor Author

cireu commented Mar 16, 2023

damn this PR was so long ago I still use the master branch of fork to create PR, so silly 😅 .

I will create a new PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Suggestion to improve or extend existing behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]Add new function -shuffle
4 participants