Make e! and m! take a block to filter permutations right away
A stack-oriented programming language suitable for code golfing
Status: Alpha
Brought to you by:
aditsu
This one isn't really for golfing, as it would only save one byte. But I think it would be really convenient (and allow one to write more memory-efficient programs) if e!
and m!
took an optional block to filter the permutations right away. If you only want a small part of the permutations then filtering while they are generated would save a lot of memory.
Basically, these should be equivalent:
[1 2 2 3]e!{...}, [1 2 2 3]{...}e!
I know, I know, inconsistent operator parity and stuff, but ,
and $
are also unary operators which take an optional block (and then still operator on the array underneath).
I guess
m*
would also be a good candidate for this feature, but it's not unary to begin with.Last edit: Martin Büttner 2015-12-10