(<), (+), (!) is the syntax to obtain the function of <, + !, where is this syntax documented in the Language Guide/Reference?

So putting the parenthesis around the operator when in the correct context give you the function of this operator. Where is this syntax documented?

I don’t think it is documented, because it’s actually just the operator without arguments which give you the function of the operator. Adding parentheses simply ensures that the parser doesn’t find any arguments.

2 Likes

Indeed, the brackets aren’t necessary.

E.g. you can do [1, 2, 3].reduce(0, +)

1 Like

Somtimes, you have to use parenthesis's

or this:

let not = (!)

when you need to get the operator's function.

I think document this would be very helpful.

3 Likes

Did anyone ever file a bug for the throws issue?

I reported it: [SR-15854] Compiler thinks function closure parameter default value "throws" when it's not - Swift

1 Like