evincarofautumn / kitten

A statically typed concatenative systems programming language.
http://kittenlang.org/
Other
1.09k stars 39 forks source link

Allow named words to be used infix #148

Open evincarofautumn opened 9 years ago

evincarofautumn commented 9 years ago

Probably borrowing the Haskell syntax:

a `f` b == a b f
trans commented 7 years ago

Why not

a (f) b == a b f

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

evincarofautumn commented 7 years ago

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.

trans commented 7 years ago

Maybe

1 f. 2

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

1 .f 2