My proprietary programming language which legally can only be run from my computer in the UK: s->s.string::replace_all("math","$1s")
ladies, gentlemen, and people who don't give a fuck, may I introduce you to the worst piece of code I have ever written in my life: github.com/pxeger/whython/commit/…
@pxeger Hmm, what about if it does the application in reverse? So if bar is a two-argument function, bar(1) would be the same as baz => bar(baz, 1) isntead of baz => bar(1, baz)
@pxeger TBH, I think your ? operator is the exact opposite: it doesn't sound like a good idea, but it's ended up significantly more usable than I expected
ed is the standard text editor on Unix systems. Your goal is to write an ed clone.
Task
Write a programs that reads an input stream and after receiving a end of line character, print ? followed by a end of line character.
The input has to be a stream. Such as stdin, a socket, UART / Serial input...
Despite its dynamicity, Python does not allow monkey-patching built-in types such as file. It even prevents you to do so by modifying the __dict__ of such a type — the __dict__ property returns the dict wrapped in a read-only proxy, so both assignment to file.write and to file.__dict__['write'] f...
Matthias Goergens has a 25,604-character (down from the original 63,993-character) regex to match numbers divisible by 7, but that includes a lot of fluff: redundant parentheses, distribution (xx|xy|yx|yy rather than [xy]{2}) and other issues, though I'm sure a fresh start would be helpful in sav...
@pxeger This inspired me to search "butter" in the TNB transcript, and I discovered a huge conversation about peanut butter back in July 2015 that's really funny
@Fmbalbuena This might work as a challenge, where your score is how high you can go such that it works for all numbers below that (i.e. if you can do divisibility by 1,2,3,4 and 5, but not 6, your score is 5)
Not sure how much of it would just be lookup tables tho
It's a bit convoluted, but I was playing around with it ages ago trying to make a golfer Perl! Not much use if you need to predefine usable vars for every eventuality though I imagine...
@pxeger maybe adding ?= such that x ?= [expression] is equivalent to x = ([expression]) ? x but i can't help but feel like any language designer would hesitate to switch the order like that
...that's another idea backward versions of every augmented assignment operator
not sure if it would be worse to create an __ri[op]__ dunder for each of them or to refuse to