I've run into a strange syntax in Boo Language Guide :
setter = { value | a = value }
What does the | operator mean?
The documentation of Boo seems to be lacking in this area -- it seems that
setter = { value | a = value }
is shorthand for
setter = def(value):
a = value
Well, having never used Boo, my (educated) guess is that it's for passing parameter to the closure lambda-style functions. In this case, { p | C } refers to an anonymous function taking a single parameter bound to p within the code C.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With