Boo programming language |
Boo is an object oriented, static typing programming language for the Common Language Infrastructure with a Python programming language-inspired syntax and a special focus on language and compiler extensibility. Some features of note include type inference, generator (computer science)s, multimethods, optional duck typing, macros, true Closure (computer science)s, currying, and First-class object functions.
Boo is open source–licensed under an MIT License/BSD license style license.
Boo can be used together with Microsoft .NET and Mono development platform.
=Code samples=
==Hello world program==
print Hello, world!
==Fibonacci series generator (computer science) function==
def fib(): a, b = 0L, 1L while true: yield b a, b = b, a + b
==Basic Windows Form example demonstrating Class (computer science), Closure (computer science), and events==
import System.Windows.Forms import System.Drawing class MyForm(Form): def constructor(): b = Button(Text: Click Me ) b.Location = Point(100, 50) b.Click += do(): MessageBox.Show( you clicked the button! ) self.Controls.Add(b) f = MyForm() Application.Run(f)
==Asynchronous design pattern with a Closure (computer science)==
import System def run(): print( executing ) print started result = run.BeginInvoke({ print( called back ) }) System.Threading.Thread.Sleep(50ms) run.EndInvoke(result) print done
==Currying==
plusX = { a as int | return { b as int | return a + b }} print plusX(3)(4)
In English: plusX is a function taking integer a, which returns another function taking integer b that returns a+b.
=See also=
=External links=
*[http://boo.codehaus.org/ Boo Homepage] *[http://boo.codehaus.org/Language+Guide Boo Language Guide] *[http://groups-beta.google.com/group/boolang Boo Google discussion group] *[http://boo.codehaus.org/Duck+Typing Duck Typing] - dynamic typing in boo *[http://boo.codehaus.org/Gotchas+for+Python+Users Gotchas for Python users] *[http://boo.codehaus.org/Recipes Boo Recipes], including: **[http://boo.codehaus.org/XML+Serialization Serializing objects] **[http://boo.codehaus.org/Regular+Expressions Regular expressions] **[http://boo.codehaus.org/Invoke+Native+Methods+with+DllImport Invoking native methods with DllImport] **[http://boo.codehaus.org/Opengl+3D+Samples 3D OpenGL Samples] **[http://docs.codehaus.org/x/czU Multimethods in boo] **[http://docs.codehaus.org/x/VTU Dynamic Inheritance - fun with IQuackFu]|
|