I came across a strange syntax in the Boo Language Guide :
setter = { value | a = value }
What does | operator mean?
The Boo documentation seems to be missing in this area - it seems like
is short for
setter = def(value): a = value
Well, I never used Boo, my (educated) guess is that it is for passing a parameter to the lambda-style close function. In this case {p | C} refers to an anonymous function containing a single parameter associated with p in C.
Adam is right. An example point is to show that lambdas in boo have read and write access to the enclosing area.
This syntax for specifying code blocks (anonymous functions) was borrowed from Ruby and Smalltalk.
Source: https://habr.com/ru/post/1696611/More articles:Relative root with ASP.NET Visual Studio debugger - asp.netLong caching static page - c #Speech recognition in different languages - windows-vistaEquipment scaling on the site - hardwareWhy .Net WPF DependencyProperties Must Be Static Members Of The Class - .netHow to use ADAM to run unit tests? - testingWhat is the best way to get information about a particular Java OS? - javaГде начинается "Управление изменениями" и "Неисправность проекта"? - project-managementWhat is the best way to interpret Perfmon analysis in specific cases / application data? - performanceInfoPath 2003 и xs: любой тип - xmlAll Articles