On Sun, May 24, 2020 at 4:55 PM David Mertz <mertz@gnosis.cx> wrote:
Changed subject line. This is far from original topic.

On Sun, May 24, 2020, 9:35 AM Ram Rachum <ram@rachum.com> wrote:
What's wrong with usingĀ @? If I understand correctly, it's used for matrix multiplication, which is far enough from function composition to avoid confusion. And it's slightly similar visually to a circle.

I like @. Function composition is kinda-sorta enough like for product that I can even make sense of the same operator.

But how would you go about getting a .__matmul__ attribute onto all functions.

That's easy, especially when everyone is talking about evil.

```
from forbiddenfruit import curse

def compose(self, other):
return lambda *args, **kwargs: self(other (*args, **kwargs))

for func in [compose, len]:
curse(type(func), "__matmul__", compose)

assert (len @ str)(789) == 3

```

https://repl.it/@alexmojaki/LeanEnergeticPublisher#main.py

But seriously, I don't see that much point to this idea. It's just slightly more concise while not being particularly readable or beginner friendly.

```
sorted(paths, key=lenĀ @ str)
sorted(paths, key=lambda p: len(str(p)))
```

I think the problem is just that lambda isn't the nicest syntax, and we'd like something more concise, e.g.

```
sorted(paths, key=:len(str($)))
```

which would be more generally useful. But I know this kind of thing has been discussed to death.