kitten icon indicating copy to clipboard operation
kitten copied to clipboard

Allow named words to be used infix

Open evincarofautumn opened this issue 8 years ago • 3 comments

Probably borrowing the Haskell syntax:

a `f` b == a b f

evincarofautumn avatar Jul 19 '15 01:07 evincarofautumn

Why not

a (f) b == a b f

the opposite of symbol words, e.g. (+)?

trans avatar Oct 26 '16 00:10 trans

Well, I don’t like the backticks—accent marks aren’t quotes, and don’t really belong in the language. So this looks better, but I worry that it would overload parentheses too much. I want to avoid creating traps where simple mistakes give strange or misleading error messages:

(x + 1) (x) f  // Oops, accidentally called (x + 1) f x

There’s no clearly right design here, so I’ve left it alone for now because it’s not a critical feature.

evincarofautumn avatar Oct 26 '16 01:10 evincarofautumn

Maybe

1 f. 2

I suppose it looks a little odd, but then the reciprocal can be

1 .f 2

trans avatar Oct 27 '16 00:10 trans