Hi James,

It's not a special case, F# allows you to define custom prefix and in-fix operators - this is just a custom operator infix operator.

Cheers,
Rob

By on 2/12/2008 1:45 PM ()

Thanks for quick response.

I tried it out and created an operator that behaved just like the |>, but called +>. Okay that makes some sense. The definition was as simple as the book suggested. Puts my mind at ease.

I am assuming, then, the syntax shown there can only be used with operator characters. For example, if I try:

1
2
3
let (test) f x = x f
I get a syntax error.
let test f x = x f

does not cause a syntax error, but cannot be used as an infix notation.

Am I on track?

By on 2/12/2008 2:23 PM ()

Yes, only operator characters can be operators and the first character determines whether it is post fix or infix. The informal specifications has the full details:
[link:research.microsoft.com]

Cheers,
Rob

By on 2/13/2008 12:00 AM ()

Thanks, again!

By on 2/13/2008 4:07 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper