whython
whython copied to clipboard
Fork of Python with some terrible custom features hacked in
Trying to make monads integrate well with the shitshow that is Python would be hilarious
New numeric type that only stores the next lower power of 2 >> print(log2(16)) 16 >> print(log2(19)) 16 >> print(log2(9)) 8 it would still participate in math operations like a...
Make integers callable Possible implement this with iterable integers and callable iterators `100(lambda x: print(f"hi {x}"))` could be equivalent to `def call_int(int,arg_callable): for i in range(100): arg_callable(i) usage like `10(10(lambda...
Iterable integers actually make sense if you are comfortable with throwing away some readability ` for i in 100: print(i) ` this would be equivalent to ` for i in...
An expression `x++` would be equivalent to `(x := x + 1)`. - It would have to be postfix only, to prevent ambiguity with `+(+(x))` - For maximum inconsistency with...
If `True` and `False` exist, why not `Maybe`, which has a 50% chance of being either?
Currently, if you try something like `str.foo = 3`, you get this: ``` Traceback (most recent call last): File ".code.tio", line 1, in str.foo = 3 TypeError: can't set attributes...
Nim has this really cool thing called UFCS that works something like this: `foo(bar, baz) = bar.foo(baz)` and `foo.bar = bar(foo)`. I propose that if you can't find a function...
Something along the lines of: print([-1,2,-3,4,-5](abs)) #[1,2,3,4,5] print([-1,2,-3,4,-5](lambda a,b: a*a+b*b)) #1373609
Make calls that are missing args into partials? Create a new singleton sentinel NoArg to signify a missing arg to a partial. If you can create "NoArg", then you can...