An alphabetical listing of all pages in the boo.codehaus.org Wiki.
Space Index
|
|||||||||||||||||||||||||||||||
0-9 |
Aboo.codehaus.org is the home and authority for the boo project. The site runs on Atlassians EnterPrise Wiki which includes JIRA for bug tracking and project managemnt and the Confluence Wiki for collaborating and sharing knowledge. Our wiki pages are organized into three primary areas: # Contributors ...
AST structure used by the Boo Compiler is described in the ast.model.boo http://svn.boo.codehaus.org/boo/trunk/ast.model.boo?view=auto file included with boo. That file is in turn used by scripts/astgen.boo http://svn.boo.codehaus.org/boo/trunk/scripts/astgen.boo?view=auto ...
Windows Windows makes this task anything but intuitive for beginners. Basically, the system path allows you and other executables to access programs when they aren't in the same directory as the commandline is. This allows you to access a program without typing in its location. Control ...
Some resources for learning how to use the standard ADO.NET API for interacting with databases from .NET and Mono: ADO.NET Quickstart samples http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/ADOPlusOverview.aspx Overview of ADO.NET http://msdn.microsoft.com/library/default.asp?url ...
Now that you've got the basics down (you did read my first tutorial Hello Boo a beginner tutorial and studied up using the Language Guide right?) its time to witness the sleek, rumbling power of Boo KungFu, but first ...
Applications created with Boo This page itemizes free and commerical applications written in boo. For information about which development environment to use with boo, refer to the General Help General Help#IDE. Free / Open Source db4o boo browser http ...
benchmark shows the relative speed of a large property array vs field array vs indexer array. The benchmark uses this "timer" macro http://jira.codehaus.org/browse/BOO170. The benchmark has since been updated to include tests of lists as well as rawArrayIndexing ...
Tutorials and resources on using ASP.NET and boo to develop webbased applications. It is possible to run ASP web applications that are coded with boo, either inline in the aspx page, or as a separate boo file which the aspx page inherits. We don't have much ...
example shows the benefits of having first class functions Functions As Objects . For a good overview of the .net framework asynchronous design pattern take a look at this article http://msdn.microsoft.com/library/default.asp?url=/library/enus/cpguide/html/cpconasynchronousdesignpatternoverview.asp. Now ...
See the Async attribute http://svn.boo.codehaus.org/boo/trunk/examples/attributes/Async/ in the examples folder included with boo. Below is an updated version of this attribute that could be included with Boo.Lang.Useful: #region license // Copyright (c) 2005, Sorin Ionescu // All ...
|
||||||||||||||||||||||||||||||
BBamboo Prevalence http://bbooprevalence.sourceforge.net/, all the data is stored in RAM for must faster access. It was created by Rodrigo B. de Oliveira, author of the boo programming language itself. See the example included with boo. Here it is online: http://svn.boo.codehaus.org/boo ...
step processes AST attributes (such as \Required\ or \Property(Name)\), just like the next step ExpandMacros processes AST macros. Attributes can be used where macros cannot to process classes, methods, parameters, fields, properties and other things outside ...
Scans the AST for type definitions, and binds each type reference used as a base type to its corresponding type system object. This must be done after the BindTypeDefinitions step, since type definitions can use other type definitions as base ...
step scans the AST looking for class, interface, struct and enum definitions and creates corresponding type system objects (InternalClass, InternalInterface etc.), binding each type definition to an IType instance. After this step, the Entity property of each TypeDefinition ...
Scans the AST for type member definitions methods, constructors, properties, fields and events and creates the corresponding type system objects to represent them, binding the two together. After this step is run, every TypeMember node in the AST is bound to an IMethod ...
boo language binding for the free SharpDevelop IDE http://www.icsharpcode.net/OpenSource/SD/ was created by Daniel Grunwald. SharpDevelop 2.2 and .NET 2.0 SharpDevelop http://www.icsharpcode.net/OpenSource/SD/ for .NET 2 is a stable and excellent open source IDE for the Windows ...
You can use IKVM http://www.ikvm.net/ to access your boo assemblies from java or access java classes from boo. IKVM http://www.ikvm.net/ is an open source java runtime for .NET and Mono. It has tools to create ...
Scripting support in a hurry. Occasionally, we developers need to do something zany like expose a part of our program or library via easy to understand "scripting" for regular usersfor the user, there's no compiler, IDE; just a plain text file with "code ...
Boo is fast! Running as fast as C# running on .Net 1.1, much faster than Python, and somewhat faster than Java. And running as fast as C# 2.0 when using .Net 2.0 See
Some initial notes about the extensible compiler architecture used by Boo: See also the pages on Type Inference, Syntactic Macros, and Duck Typing. The boo compiler and platform was created by Rodrigo B. de Oliveira, so please contact him ...
comparative double precision benchmark in C#, C, Java, Python, and Boo. It computes a piece of the Mandelbrot set. The times to complete the benchmark on a 1.7GHz Pentium M IBM T41p running Windows XP Professional SP1: \\ \\ Language / runtime Normalized time ...
extras directory you're going to find this neat little utility that allows you not only to edit boo scripts with a nice syntax highlighting but also to run them (F5) and/or see their expanded form (CTRLE). For Windows Users booxw can be found ...
comparative generator method benchmark in C# 2.0, Python, and Boo. It implements the simple weightless cooperating threads as described in Charming Python: Implementing "weightless threads" with Python generators http://www106.ibm.com/developerworks/linux/library/lpythrd.html. The times to complete the benchmark ...
Just a place to share what people like about boo. External Reviews Boo Scares Up OpenSource Developers http://www.eweek.com/article2/0,1895,1928387,00.asp eWeek Dynamic .NET Scripting with Boo http://usefulinc.com/edd/blog/contents/2005/03/26boo/read by Edd Dumbill ...
Boo Manifesto http://boo.codehaus.org/BooManifesto.org. A must read for those interested in boo. This document contains the foundinnng principals that drive the language development
NOTE: This information is very much out of date. Ubuntu now has packages for everything you need the "boo" package takes care of core installation, and the "monodevelopboo" package will allow you to develop boo files on mono. Note, however, that the version ...
Some things that could be optimized by the boo compiler. See also the Boo Style Checker ideas. (this is done, see http://jira.codehaus.org/browse/BOO137) Convert "for i in range\(x)" to an optimized while loop, instead of using the rangeenumerator class. Also ...
Boo uses the ANTLR http://www.antlr.org/ parser generator to create the parser for boo source code. The parsing rules are defined in the boo.g http://svn.boo.codehaus.org/boo/trunk/src/Boo.Lang.Parser/boo.g?view=auto grammar file included with the boo source ...
Boo Primer by Charles Kenneth Knight A version is also available in Portuguese http://brmono.org/wiki/doku.php?id=boo, translated by C?ssio Rog?rio Eskelsen. # Starting Out Part 01 Starting Out # Hello, World\! Part 01 Starting ...
ideas for things the boo compiler could check, using a special compiler step. It is similar to pychecker or pylint. See also the Boo Optimizations page. All class/enum/struct/property/method names should begin with a capital letter and ideally ...
todo/wish list for stuff to include in Boo.Lang.Useful.dll a library of helper classes and functions for boo users. All the code in Boo.Lang.Useful would be in boo, not C#. Useful things about Boo contains documentation on members present in the assembly. Boo.Lang.Useful.Attributes AsyncMethodAttribute DisposableAttribute ...
Here is a summary of boo's builtin functions. The actual source code underlying these functions is in Boo/Lang/Builtins.cs http://svn.boo.codehaus.org/boo/trunk/src/Boo.Lang/Builtins.cs?view=auto. array array is a function used to create empty arrays or convert ...
Array literals Arrays are statically sized homogeneous data structures. l = (,) // empty array (typed (object)) l = (1, 2, 3) // integer array with three elements l = ("Eric", ) // string array with a single element List literals Lists ...
|
CCallable types are a generalization of the concept of a delegate in the CLI. In boo, not only delegates and methods can be called as functions but also any object references of type System.Type or any Boo.Lang.ICallable implementing type. In the case of System.Type references, the appropriate constructor will be called, if any ...
First letter lowercase with all words capitalized and run together after. Ex: assemblyReference, customerName, veryLongName
Type casting in boo works the same as in C# (see this article http://www.codeproject.com/dotnet/CheatSheetCastingNET.asp). The only difference is that with explicit casts in boo you use the builtin "cast" function (see below). You can try to cast one type ...
Here's an example illustrating some of the basics about classes. Until more documentation is here, for examples of using classes, see the classes\.boo files under tests/testcases/integration http://svn.boo.codehaus.org/boo/trunk/tests/testcases/integration ...
Introduction Martin Fowler has a good introduction to closures http://www.martinfowler.com/bliki/Closure.html on his bliki. Syntax There are two syntaxes for closures: a block based syntax with syntactically significant whitespace and a braces based that ignores whitespace. Block based syntax ...
good discussion on coding conventions in general take a look at this page http://c2.com/cgi/wiki?CodingConventions. The following conventions must be followed by any code committed to our repository (which also means that the source files already in the repository do ...
open up a command line either do Start > Run... > "cmd" or do CtrlAltDelete > File > New Task > "cmd". The command line (emulated DOS on 2000/XP) allows basic access to the file system, and, more importantly, allows you to call ...
Single Line Comments Everything that comes after a hash character (#) or a double backslace (//) is ignored until the end of the line. # this is a comment // This is also a comment print("Hello, world!") // A comment can start anywhere in the line Multiline Comments Multiline comments in boo ...
image borrowed from the Wikipedia article on the Common Language Infrastructure http://en.wikipedia.org/wiki/CommonLanguageInfrastructure)\\ !OverviewoftheCommonLanguageInfrastructure.png align=center! \\ See the ECMA355 standard http://www.ecmainternational.org/publications/standards/Ecma335.htm for details. Microsoft .NET http://www.microsoft.com/net/ is only one ...
Some basic compatibility: namespace Boo.Compatibility.Python class Dict(Hash): def constructor(): super() def constructor(h as Hash): super() Update(h) def Update(h as Hash): for key in h.Keys: selfkey = hkey def Get(key, default ...
Options when compiling boo scripts. Right now this is just a list of potential options for the boo compiler, some of which do not exist yet and may never exist. For those options that can be on or off, this list suggests two names for each ...
Pipelines consist of a set of steps that the compiler passes the code through. The source code for all the steps is here http://svn.boo.codehaus.org/boo/trunk/src/Boo.Lang.Compiler/Steps/. The order of steps when you compile a script is like this: # First the Boo Parser ...
many ways you can make boo better. As an user you can contribute by reporting any issues you find, by adding, commenting on and/or fixing the documentation on this website (see that little edit link down the page?), by helping other ...
Thr boo Cookbook is filled with recipes on how to do interesting things in boo
|
||||||||||||||||||||||||||||||
DAttached to this page is a zip file (datastructuresandalgorithms.zip) containing some code converted from the online book Data Structures and Algorithms with ObjectOriented Design Patterns http://www.brpreiss.com/books/opus6/, by Bruno R. Preiss. He has versions of the book that are coded with C ...
Just a note that we could use some docs on: reference types value types (see also Userdefined value types aka structs and I assume a struct keyword will be added too) null = vs. == == vs. is is vs. isa typeof ...
Some tutorials and resources on designing relational databases. Practical Database Design, part 1: Keys and datatypes http://www106.ibm.com/developerworks/web/library/wadbdsgn1.html Practical Database Design, part 2: Normalization, history, and event logging http://www106.ibm.com/developerworks ...
Examples of working with databases from boo. For general information about learning to use relational databases in .NET and Mono, see the ADO.NET page here. There also is a page with links to tips about Database Design. You can also store objects ...
An assortment of recipes for working with data types
db4objects http://www.db4o.com/ (db4o) is a GPLlicensed native object database. You can store complex objects without using SQL syntax. There is a db4o example http://svn.boo.codehaus.org/boo/trunk/examples/db4o/ included with boo. See the db4o object browser ...
Boo has some support for Design by Contract with the Required attribute. def doit(required(x >= 0) x as int): print x doit(10) doit(0) doit(1) //raises a System.ArgumentException Since boo has an extensible ...
page notes some differences between C# and boo. C# to Boo Converter The easiest way to see how code in boo differs from C# is to use the C# to boo converter included in the Boo AddIn For SharpDevelop. The converter is also accessible ...
DirectX Samples in Boo These are examples that use the Managed DirectX API for .NET. They require the DirectX SDK http://msdn.microsoft.com/directx/directxdownloads/ from Microsoft. And of course these run on Windows only. For a crossplatform alternative for 3D graphics, see OpenGL 3D samples ...
region license // Copyright (c) 2005, Sorin Ionescu // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // Redistributions of source code must retain the above copyright notice ...
Stable Releases You can always download the latest distribution from here http://dist.codehaus.org/boo/distributions/?C=M;O=D. Debian and Ubuntu users, for your convenience, there is deb packages available on boo's google group files ...
Duck Typing Boo is a statically typed language, like Java or C#. This means your boo applications will run about as fast as those coded in other statically typed languages for .NET or Mono. But using a statically typed language sometimes constrains ...
benchmark compares a duck typed call to a normal call. Duck Typing calls are about 160 times slower. Module class DuckBM: pass def add(a as int, b as int): return a b def add(a as int, b as string ...
Boo's IQuackFu interface enables adding behavior to a class at runtime. This example shows how to add dynamic inheritance http://www.objectfaq.com/oofaq2/body/basics.htm#S1.10 to boo, also called mixin programming http://c2.com/cgi/wiki?MixIn or delegation ...
|
EAn example showing how to encrypt and decrypt a string using a password. //encrypt.boo import System.Security.Cryptography import System.Text import System.IO import System def encrypt(s as string) as string: return encrypt(s, "d!&%#@?,:") def decrypt(s as string) as string: return ...
keyword enum introduces an enumerated type, a set of name to integer value associations. enum Python: Eric John TerryG TerryJ Graham Michael which is equivalent to: enum Python: Eric = 0 John = 1 TerryG = 2 TerryJ ...
Creating an event What's that timmy? You're exposing your API to someone else, and they want convient handydandy events?\! No problem\! As with everything in Boo, its dead simple to get up and running within moments with the event keyword. class Clicker ...
handle exceptions in Boo you use the try except block, and an optional ensure keyword, which may be used to have some code executed no matter the exception was raised or not. Just for a comparative, it is equivalent to try catch finally block from ...
Calls an AbstractAstMacro's Expand method. For example the print macro transforms this code: print item into this: System.Console.WriteLine(item
|
||||||||||||||||||||||||||||||
FFrequently asked questions. Have a question? Post it here or to one of our Mailing Lists. License boo is licensed under a MIT/BSD style license. The current license is always available here http://svn.boo.codehaus.org/boo/trunk/license.txt. How ...
Fields and properties are used to store and control access to data (integers, strings, etc.) inside a class. Fields store the values, and by default are "protected", they can only be accessed from methods inside the class (or a subclass). You can declare a field as "public ...
fireAndForget macro automatically calls the appropriate EndMethod of an asychronous call. Example: class Foo: AsyncMethod def PrintMessage(message): print message def Main(): foo = Foo() fireAndForget foo.BeginPrintMessage("Hello World!") #region license // Copyright (c ...
Under Construction Firebird, formerly known as Interbase. An alternative to MySQL. Can be run as a standalone server, or embedded with your app. http://firebird.sourceforge.net/ http://www.dotnetfirebird.org/ http://www.gomono.com/firebird.html http://www.codeproject.com/useritems/EmbeddedFirebird.asp
Functions do not necessarily have to be created inside of classes in Boo. This is valid code: def doWickedAndNaughtyThings(): print "I'm doing evil, wicked things to you." print "No, don't call the police!" print "...crap." doWickedAndNaughtyThings() So is this: class Wife: def ...
Functions and methods in boo are first class objects whose type exposes some very useful methods: Invoke(
|
GMini browser in less than 100 lines Mini browser in less than 100 lines In this example we'll use Glade# to construct the GUI of the application, and then use Gecko# to add the actual browser component. To make Gecko# application run and detect ...
pages with general help on developing applications for .NET and Mono, and other topics not specific to boo itself but useful for a boo developer. General Info about .NET and Mono .NET is Microsoft's application framework and runtime engine. Most people using Windows ...
Still having problems understanding generators, huh? Don't worry its easy stuff. The basic syntax is:
Note: If you are not familiar with the generator concept, this Generator Breakdown page should be read before continuning. Generator expressions are defined through the pattern:
Generator methods are defined by the use of the yield keyword: def fibonacci(): a, b = 0, 1 while true: yield b a, b = b, ab Given the definition above the following program would print the first five elements of the Fibonacci series ...
From time to time there is the need to represent closed sets such as customers in Brazil or open sets like the numbers in the Fibonacci series in a suscint and memory conservative way. Enter generators. Generators are language constructs capable of producing more than one value ...
Gentle.NET http://www.mertner.com/confluence/display/Gentle/Home lets you work with relational databases without using SQL directly. See this basic example http://www.mertner.com/confluence/pages/viewpage.action?pageId=73 from the Gentle.NET user guide ...
Here is a way to check what version of boo your script is running in . Boo now has a BooVersion builtin: print BooVersion //> 0.5.6.1767 The old way to do that is to check the version of the Boo.Lang.dll assembly. We find the assembly by getting the Assembly property ...
Warm up by reading the boo manifesto http://boo.codehaus.org/BooManifesto.pdf Download the latest distro http://dist.codehaus.org/boo/distributions/ or get the latest sources Subversion Check out some cool language features Language Features and the language reference Language ...
Using Git with the Boo Subversion repository Everything you need to track the Subversion can be found on the Git SVN tutorial http://git.or.cz/course/svn.html. It can take a while to import the full Boo history into Git. To speed up the process ...
Learning boo if you are familiar with Python It might come as no surprise to anyone but I'd better state it here anyway: boo is not python. It looks a lot like python and there's a reason for that: we love python\! Specially The dirty hungarian phrasebook :) General Tips ...
Recipes for working the forms and 3D API's such as Direct X, OpenGL, and wx.Net
|
||||||||||||||||||||||||||||||
HHashtables (also called dictionaries, maps, or associative arrays) are data structures that allow you to store named items. They are similar to Python's dictionaries. For example: d = print d"foo" //prints "bar" emptydict = {} print d.GetType() //> Boo.Lang.Hash Boo's hash ...
Hello, Boo!" This tutorial assumes you have basic computing knowledge and are comfortable with the command line interface of your operating system. If you're familiar with programming in general, you might just want to browse the code snippets and ignore the rest of the article ...
How many ways can you say Hello World? This example shows console, WinForms and Gtk versions of "Hello, world!". Console print("Hello, world!") WinForms import System.Windows.Forms f = Form(Text: "Hello, boo!") f.Controls.Add(Button ...
example shows how to generate the "golden ratio" to 28 digits of precision using the decimal datatype and a Fibonacci Sequence generator function . // shows use of infinite fibonacci sequence with decimal datatype to generate golden ratio to 28 digits def fib ...
Boo is a new object oriented statically typed programming language for the Common Language Infrastructure with a python http://www.python.org inspired syntax and a special focus on language and compiler extensibility. If you want to try boo, read the Getting Started guide. To dive ...
Boo always come PREBUILT (i) There's always an up to date build in the bin/ directory of the distribution. Prerequisites In order to (re)build boo you are going to need to have the following tools already installed: An up to date version ...
basically three ways to compile your boo code: through the booc utility; through the booc task (one of the nant tasks Nant Tasks); through the Boo.Lang.Compiler API; booc utility booc r:System.Windows.Forms out:build/HelloForms.exe examples ...
You can use any text editor to create and edit boo source files. The important thing is to configure your editor to generate utf8 files. I spend most of my time with Boo Explorer and JEdit. There is also now an ...
course you can always compile your code to an .exe and run it as any other CLI program. But this section is all about running boo programs directly from memory. booi utility booi examples/HelloWorld.boo To execute a script ...
|
IFind out which webserver is behind a url import System.Net using response=WebRequest.Create("http://www.orkut.com").GetResponse(): print(response.Headers"Server") If you are behind a nontransparent firewall/proxy you may need to set the proxy credentials so the example ...
import TARGET (from ASSEMBLY)? (as ALIAS)? The import construct makes all the members of the imported target available to the current module. So instead of writing: System.Console.WriteLine("and now for something completely different... ") System.Console.WriteLine("import!") one can write: import System ...
Inicializes the NameResolution service object by loading up all the references and populating the list of imports. The NameResolution object handles converting lazy naming such as "Console.WriteLine" to things like "\mscorlib\System.Console::WriteLine(string
compier step, a TypeSystemService object is instantiated, which keeps track of the program's variables and their types
See the previous example as it has been processed in the steps ProcessMethodBodiesWithDuckTyping, ProcessSharedLocals, and ProcessClosures. An adapter class is created for event handlers. This allows us to say for example "button.Click = MyMethod" without having to manually cast to the correct event handler type ...
Boo has an interactive interpreter that is useful for testing out snippets of boo code. To use it, run the booish.exe command line tool, or you will also see a booish window in the top right corner of SharpDevelop if you install the Boo AddIn ...
Interfaces are introduced throught the interface keyword: interface IFoo: pass Interface methods don't need to have a body: interface IUnknown: def QueryInterface(id as System.Guid) as object But if they do it must be empty: interface IFoodMachine: def Spam(): pass If a method ...
Various recipes for the Net
Adds Boo.Lang and the builtins to the namespaces of the TypeSystemService
Creates a modulewide class to hold your code. Moves all the def statements (methods) into this cass, and moves the code that should be executed when a script is run into its own Main method inside the module class. For example this code: myarray = (1 ...
Here are some samples: import System.Runtime.InteropServices DllImport("user32.dll") def MessageBeep(n as uint) as int: pass def beep(): MessageBeep(0) beep() Actually, a more crossplatform way to make a beep sound is to call Microsoft.VisualBasic.Interaction.Beep() (add a reference to the Microsoft.VisualBasic.dll ...
You can see if people are hanging out in the #boo channel on the Codehaus IRC server: irc://irc.codehaus.org/boo If you do not have an IRC client, there is a webbased interface to the Codehaus IRC server here: http://irc.codehaus.org/ If no one is there, please ...
|
||||||||||||||||||||||||||||||
JYes, JEdit http://www.jedit.org/! What's wrong with that? :) extras/boo.xml is the syntax mode, just copy it to your |
KBoo Keywords Index #abstract #and #as #AST #break #callable #cast #char #class #constructor #continue #def #destructor #do #elif #else #ensure #enum #event #except #failure #final #from #for #false #get #given #goto #if #import #in #interface ...
|
||||||||||||||||||||||||||||||
LType Inference Builtin Literals for lists, hashes, arrays, regular expressions and timespans Slicing String Interpolation Statement Modifiers Syntactic Attributes Syntactic Macros Generators Generator Expressions List Generators Array Generators Generator Methods First Class ...
Welcome to the boo user guide. Contents Basic Features of Boo Structure of a Boo Script Import Comments Builtin Functions Summary Using .NET's Standard Class Library http://msdn.microsoft.com/library/default.asp?url=/library/enus/cpref/html ...
Basic Features of Boo Structure of a Boo Script """module docstring""" namespace My.NameSpace import Assembly.Reference class MyClass: pass def domyfunction(it): print(it) domyfunction(3) assembly: AssemblyTitle('foo') // Module attribute defines "global" class // Entry point ...
http://media.xircles.codehaus.org/projects/boo/logos/medium.png! http://boo.codehaus.org
List generators aka list comprehensions and list displays provide a quick way to create a list with selected elements from any enumerable object. List generators are defined through the following syntaxes: element for item in enumerable element for item in enumerable ...
Lists Lists are mutable sequences of items. They are similar to lists in Python. Lists are surrounded by brackets, just like python: \1,2,3\ Here is some sample code demonstrating different operations you can do on lists: //the "as List" is optional: mylist as List ...
loop The for loop sintax is: for var in range: // action where range can be any type of collection. Examples: // print numbers from 0 until 9 for i in range(0, 10): print(i) it is equivalent to for (int i = 0; i ...
|
Mprint print System.Console.WriteLine() print
Boo Google Group We have started a mailing list for boo users at Google groups: http://groupsbeta.google.com/group/boolang See that page for instructions on subscribing and to view the archives. Other Mailing Lists The subscribe and unsubscribe links for the other mailing ...
Below are boo http://boo.codehaus.org versions of the examples in Martin Fowler's blog on closures http://martinfowler.com/bliki/Closures.html : class emp: public isManager = false public name = "" public salary = 100 def ToString(): return name def managers ...
An assortment of recipes that bring boo and math together in science and in the classroom
How to combine Boo.Lang.dll into your own app using ILMerge http://www.microsoft.com/downloads/details.aspx?familyid=22914587b4ad4eae87cfb14ae6a939b0&displaylang=en. Anytime you create an application or library using Boo, you have to distribute the Boo.Lang.dll with it in order for it to run ...
Multidimensional arrays in Boo When declaring a variable or a field as a multidimensional array, use this syntax: foo as (int, 3) //declare a 3 dimensional array of integers. When creating a brand spanking new multidimensional array, use this syntax: foo = matrix ...
examples demonstrate the use of duck typing to implement multimethods http://en.wikipedia.org/wiki/Multimethods (also called multiple dispatch http://en.wikipedia.org/wiki/Multipledispatch). With multimethods, the decision about which method to call is deferred until runtime based on the actual ...
|
||||||||||||||||||||||||||||||
Nexample shows how to use boo to enrich your nant build files . boo includes some nant taks Nant Tasks, more specifically, the boo task allows you to embed boo code directly into your nant build ...
booc> Compiles boo programs. Parameters target Output type, one of library, exe, winexe. Optional. Default: exe. output The output assembly. Required. pipeline AssemblyQualifiedName for the CompilerPipeline type to use. Optional. tracelevel Enables compiler tracing, useful ...
Boo Home News FAQ Manifesto http://boo.codehaus.org/BooManifesto.pdf Documentation Getting Started Boo Primer Language Guide Tutorials Cookbook Still Need Help? Still Need Help For Developers Contributors Writing Tests Coding Conventions Features ...
Syndicate this site via RSS http://docs.codehaus.org/spaces/blogrss.action?key=BOO
ObjectRelational Mapper NHibernate http://nhibernate.sourceforge.net/ is a port of the Java Hibernate object relational mapper (ORM). ORMs translate your classes and objects into SQL commands for storing those objects and retrieving them from a relational database. Gentle.NET Gentle.NET ORM ...
See http://www.99bottlesofbeer.net/ Simple version: import System.Threading def getbottle(n as int): return "no more bottles of beer" if n==0 return "1 bottle of beer" if n==1 return "$ bottles of beer" b = getbottle(n = 5 ...
Converts things such as for loops. For example, this code: for item as System.Int32 in myarray: System.Console.WriteLine(item) is transformed into this: iterator1 = myarray.GetEnumerator() while iterator1.MoveNext(): item = iterator1.getCurrent() System.Console.WriteLine(item
compiler step, the default modifiers for classes, methods, properties, and fields are added where appropriate. Classes and other types are by default public, properties, methods, and events are made public by default, and fields are by default protected. A constructor is added to a class definition if it does ...
|
OThose recipes that didn't have a home in one of the cookbook collections
OpenGL 3D samples These samples use the Tao Framework http://www.monoproject.com/Tao for OpenGL on .NET and Mono. Tao is constantly changing (and moving), so these samples may be out of date. Redbook.Cube example in boo //cube.boo //when compiling with booc, add ...
Boo has operator overloading. Overloaded operators must be defined as static. For example: struct myNum: i as double def constructor(j as int): i = j static def opMultiply(x as myNum, j as int): x.i = x.i j ...
benchmark of operator overloading in boo. Benchmarks are shown for boo without operator overloading, boo with function calls in place of arithmetic operators, boo with operator overloading using a simple struct called "myNum", boo with operator overloading using a class instead ...
Marcos Sanchez Provencio (see this note http://groupsbeta.google.com/group/boolang/browsefrm/thread/fb1b766304f3365e). import System.Data.OracleClient connectionString ="Data Source=rioja;User ID=system;Password=xxxx;" dbcon = OracleConnection(connectionString) dbcon.Open() dbcmd = dbcon.CreateCommand(); sql = "SELECT ...
Recipes for integrating boo with other languages. In addition to these recipes, information on differences between Boo and other languages can found at the following: Differences with Python Differences with C
|
||||||||||||||||||||||||||||||
PPreamble This page will attempt to summarize the generalities involving creating binary packages (.rpm, .deb, what have you) of boo. The specifics of each packaging system are beyond the scope of this document. Please refer to the documention for whatever packaging system you are using ...
Parameters are the objects you can pass to Functions, Closures, or Callable Types which handle Events. A parameter is declared with a name, followed by "as", followed by the type: paramname as type. If there is no "as type", then the type is assumed to be type object. Examples Method/Function example def ...
Part 01 Starting Out Boo is an amazing language that combines the syntactic sugar of Python http://www.python.org/, the features of Ruby http://www.rubylang.org/, and the speed and safety of C# http://msdn.microsoft.com/vcsharp/. Like C#, Boo is a staticallytyped language, which ...
Part 02 Variables Using Booish as a Calculator There are four basic mathematical operators: addition , subtraction {{\}}, multiplication {{\}}, and division {{/}}. There are more than just these, but that's what will be covered now. $ booish >>> 2 4 // This is a comment 6 >>> 2 4 # So is this also a comment ...
Part 03 Flow Control Conditionals If Statement A control statement that contains one or more Boolean expressions whose results determine whether to execute other statements within the If statement. An {{if}} statemnt allows you to travel down multiple logical ...
Part 04 Flow Control Loops For Loop A loop whose body gets obeyed once for each item in a sequence. A {{for}} loop in Boo is not like the {{for}} loop in languages like C and C#. It is more similar to a {{foreach}}. The most common usage for a {{for}} loop ...
Part 05 Containers and Casting Lists A linked list that can hold a variable amount of {{objects}}. {{Lists}} are mutable, which means that the {{List}} can be changed, as well as its children. print(0, 'alpha', 4.5, char('d')) print List ...
Part 06 Operators Mathematical Name Syntax example Comments Multiplication {{a b}} Division {{a / b}} Remainder {{a % b}} Often called mod or modulus Addition {{a b}} Subtraction {{a b}} Exponent {{a b}} Do not confuse this with Bitwise Xor Bitshift Right ...
Functions A sequence of code which performs a specific task, as part of a larger program, and is grouped as one, or more, statement blocks Builtin Functions You have already seen a few functions. {{range()}}, {{print()}}, and {{join()}}. These are functions built into Boo. Here's ...
Part 08 Classes A cohesive package that consists of a particular kind of compiletime metadata. A class describes the rules by which objects behave. A class specifies the structure of data which each instance contains as well as the methods (functions) which manipulate the data ...
Part 09 Methods A function exclusively associated with a {{class}} Defining a Method Methods must be defined in {{classes}}. They are declared just like functions are. class Cat: def Roar(): pring "Meow!" cat = Cat() cat.Roar() Meow! An object of {{Cat ...
Part 10 Polymorphism, or Inherited Methods The ability for a new object to implement the base functionality of a parent object in a new way. Two keywords are used to make Polymorphism happen: {{virtual}} and {{override}}. You need to describe a method as {{virtual}} if you want ...
Part 11 Structs Short for structure, a term meaning a data group made of related variables. The main difference between {{structs}} are different than {{classes}} is that it is a value type instead of a reference type. This means that whenever you return this value, or set ...
Part 12 Namespaces A name that uniquely identifies a set of objects so there is no ambiguity when objects from different sources are used together. {{Namespaces}} are useful because if you have, for example, a {{Dog}} {{namespace}} and a {{Furniture}} {{namespace}}, and they both have a {{Leg ...
Part 13 Enumerations A set of name to integer value associations. Declaring an Enumeration Enumerations are handy to use as fields and properties in {{classes}}. enum Day: Sunday Monday Tuesday Wednesday Thursday Friday Sunday class Action: Property(Day ...
Part 14 Exceptions A mechanism designed to handle runtime errors or other problems (exceptions) inside a computer program. Exceptions are very important, as they are raised whenever an error occurs in the system. (Or at least they should be.) Catching Exceptions An exception stops ...
Part 15 Functions as Objects and Multithreading Having Functions act as {{objects}} exposes three very useful methods: # {{function.Invoke(
Part 16 Generators Generator Expressions An phrase that creates a {{generator}} based on the syntax: {{
Part 17 Macros print Macro The {{print}} Macro will display one or more objects to the screen. There are two ways to call the {{print}} macro. # With only one argument # With two or more arguments print "Hello there" print "Hello", "there" Hello there Hello there In the second ...
Part 18 Duck Typing Duck typing is a humorous way of describing the type nonchecking system. Initially coined by Dave Thomas in the Ruby community, its premise is that (referring to a value) "if it walks like a duck, and talks like a duck, then it is a duck". Even ...
Part 19 Using the Boo Compiler The Boo Compiler is typically called in this fashion: {{booc
Part 20 Structure of a Boo Project On the Projectlevel Here I'll use the example of the IRC bot I write: Goomba Goomba (Goomba namespace) Configuration (Goomba.Configuration namespace) Config.boo # class Config Data (Goomba.Data namespace) Column.boo # class Column ...
Part 21 Documentation A communicable material used to explain some attributes of an object, system or procedure. I've saved the most important for last, as documentation is itself, just as important as the code which it describes. When documenting your code, be sure ...
Part 22 Useful Links Boo http://boo.codehaus.org/ Download Boo http://dist.codehaus.org/boo/distributions/?M=D MSDN Search http://search.microsoft.com/search/search.aspx?View=msdn&st=a Very handy if you want to look up something ...
All words capitalized and run together. First letter is capitalized. Ex: CompilerParameters, AddRange
Have a design pattern to contribute to the Boo community? Add it here
Marcos Sanchez Provencio (see this note http://groupsbeta.google.com/group/boolang/browsefrm/thread/fb1b766304f3365e). You need the Npgsql http://gborg.postgresql.org/project/npgsql/projdisplay.php data provider (included with Mono). import Npgsql connectionString = "Server=tequila;Database=tutos ...
compiler step, basic syntax errors are checked. It checks that: Fields And Properties Fields, Fields And Properties Properties, Methods Functions, Functions, Events, Interfaces, Callables Callable Types, and Classes don't begin with "", ""get", "set", "add", "remove", or "raise". These are used ...
See the previous example from the ProcessMethodBodiesWithDuckTyping and ProcessSharedLocals steps. Now a callable class is created for closures. More processing will occur in later steps. import System.Windows.Forms from System.Windows.Forms Boo.Lang.ModuleAttribute public final transient class TempModule(System.Object): private static ...
example this code: list = ("one", "two", "three") newlist = item.ToUpper() for item as string in list is transformed into this: Boo.Lang.ModuleAttribute public final transient class TempModule(System.Object): private static def Main(argv as (System.String)) as System.Void: locals = TempModule.locals2() locals.list0 = ('one ...
ProcessMethodBodies step does a tremendous amount of work. One of the things it does is handle when you set properties by passing them to the constructor, using the builtin \\eval\\ function. Also adding an event handler (Click = OnClick) is transformed into a method ...
previous example from the ProcessMethodBodiesWithDuckTyping step had a closure that accessed (and modified) an outside variable (clickcount). Here a class is created to share that object. import System.Windows.Forms from System.Windows.Forms Boo.Lang.ModuleAttribute public final transient class TempModule(System.Object): private ...
|
QDownload :: Wiki http://docs.codehaus.org/pages/listpagesdirview.action?key=BOO :: Subversion :: Mailing Lists :: IRC IRC Channel :: Roadmap http://jira.codehaus.org/browse/BOO?report=com.atlassian.jira.plugin.system.project:roadmappanel :: Issue Tracker http://jira.codehaus.org/browse/BOO?report=com.atlassian.jira.plugin.system.project ...
|
||||||||||||||||||||||||||||||
RBoo has builtin support for regular expression literals. You surround the regular expression with / /, or @/ / for more complex expressions that contain whitespace. Boo even has an =\ operator like Perl.\\ Here are some samples of using regular ...
Relationship Manager is a design pattern I wrote a few years ago that I have used in many projects. I have ported it to Boo. See http://www.atug.com/andypatterns/rmboodotnet.htm for a web page dedicated to this port and the original The Relationship Manager ...
Release Schedule Starting with release 0.5, and for all following major releases (e.g. 0.6) a new subrelease is done every month that rolls out the latest bug fixes features added. These are the advantages to this approach: # It confirms that the development of Boo is active and ongoing ...
Scans the AST for TypeReference nodes, and binds them using NameResolutionService. After this step is run, any TypeReference nodes in the AST are bound to either the corresponding IType object, or to the Error entity. 
boo code as printed by the BooPrinterVisitor class http://svn.boo.codehaus.org/boo/trunk/src/Boo.Lang.Compiler/Ast/Visitors/BooPrinterVisitor.cs?view=auto used by the roundtrip compilation pipeline. Try, for instance: booc p:roundtrip examples/gtk.boo
|
SSummary The following is a sample GTK# application written in Boo. Unlike some applications, this one actually does something useful its an image (porn?) browser, and its crossplatform to boot! The code, with comments, comes in just over 100 lines ...
actually relatively simple; we only need a few of the Boo.Lang.Compiler classes to make it happen. The classes most important to us are: Boo.Lang.Compiler.BooCompiler the class that handles compilation of Boo code. Boo.Lang.Compiler.Pipelines.CompileToMemory a compiler pipeline that compiles Boo code into memory instead of a file ...
Using the Boo.Lang.Interpreter API is quite straightforward. You can expose values to the scripting environment through the SetValue call and you can read values from the scripting environment with the GetValue call. The Eval call allows you to execute arbitraly complex ...
list of needed recipes for searcing and sorting in Boo. Recipe 2.1 Sorting a Dictionary Recipe 2.2 Processing Selected Pairs of Structured Data Efficiently Recipe 2.3 Sorting While Guaranteeing Sort Stability Recipe 2.4 Sorting by One Field ...
Sometimes its useful to allow a self reference (to an object being created) in a callable constructor argument. If you try this you will get an "Unknown identifier" error; so declare the object before instantiating it: class X: public f ...
Dessert recipes that make you boo coding life sweeter
region license // Copyright (c) 2005, Sorin Ionescu // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // Redistributions of source code must retain the above copyright notice ...
pages provide the components for the overall layout of boo.codehaus.org WARNING: Do not edit casually
An alphabetical listing of all pages in the boo.codehaus.org Wiki
slicing operation is a simple way to extract a range of elements from a container. The boo compiler supports native slicing operations on lists, arrays and strings. Support for user defined slicing operations is planned but currently not implemented. General Syntax A slicing operation ...
SQLite http://www.sqlite.org/ is a small database engine that has become very popular. The database is stored as a local file, and you can embed the SQLite engine with your app using one of the libraries below. Here are three different libraries you ...
Have a question about Boo, but can't find the answer anywhere on the website? Don't worry, we've got a very friendly community waiting for you at the Boo Newsgroups http://groups.google.com/group/boolang. Before you post any Boo specific ...
String interpolation allows you to insert the value of almost any valid boo expression inside a string by quoting the expression with ${}. String interpolation kicks in for both double Double Quoted Strings and triple Triple Quoted Strings quoted strings: print ...
String Formatting See String Interpolation. Here's a quick example: firstname = "First" lastname = "Last" print "Your name is $ $ ." print "Now is $ ." ToString() method To convert a class or a type to a string, call the ToString() method. Or if you are writing your own ...
Helpful recipes for string manipulation in boo
Boo scripts have a set structure you need to follow to avoid errors when compiling. All of the items are optional, but order of the items is not: The structure is like: module docstring namespace declaration import statements module members: class/enum/def ...
Web Access http://svn.boo.codehaus.org/ provides a web interface for browsing the source code currently in SVN. Anonymous Subversion Access The code of the project can be checked out by anyone through anonymous svnserve access with the following command: svn co http ...
Toby Miller Syntactic macros allow new language constructs to be created. See Macros for a list of existing ones in boo. We could, for example, mimic VisualBasic's with statement. Given the following code: fooInstanceWithReallyLongName = Foo() fooInstanceWithReallyLongName.f1 = 100 fooInstanceWithReallyLongName.f2 ...
|
||||||||||||||||||||||||||||||
TtimeBlock macro times how long it takes to execute a block of code. See the Boo benchmarks page for examples using this macro. The original JIRA issue http://jira.codehaus.org/browse/BOO170 has the C# source for this macro. It has been converted to the boo ...
timer macro times how long it takes to execute a block of code. See the Boo benchmarks page for examples using this macro. The original JIRA issue http://jira.codehaus.org/browse/BOO170 has the C# source for this macro. It has been converted to the boo ...
Scans the AST for callable definitions and converts them to class definitions which inherit from System.MulticastDelegate, and adds the definition of the Invoke and BeginInvoke methods. These are later filled in by the CLR. That is, if the code before the step looks like this: callable MyCallable(arg as int) as bool ...
Sometimes you may want to handle one or more items passed to a method. Usually method overloading to handle each specific case is sufficient. But here is an example for treating a parameter as a sequence of items, even if only one item was passed ...
Triple quoted strings in Boo are used to preserve spacing and linebreaks without a thick slathering of \n's all over your precious code. It is good for visually representing XML, for instance: xml = """
Here are some tutorials and other introductions to using boo: Tutorials on this site The boo manifesto http://boo.codehaus.org/BooManifesto.pdf (pdf) by its creator, Rodrigo B. de Oliveira The boo Language Guide \ list of pages covering stuff not yet covered ...
Boo is a statically typed language. Static typing is about the ability to type check a program for type correctness. Static typing is about being able to deliver better runtime performance. Static typing is not about putting the burden of declaring types on the programmer ...
You should explore the rest of the Boo Compiler so this is more understandable, especially the Compiler Steps, the Abstract Syntax Tree structures, and the Boo Parser. Say you have a line of code like: m = x.something() What is m? What is x ...
|
UUnit tests are a way of ensuring the "correctness" of a program's behavior along side making sure that particular chunks of the program do not "regress" and cease functioning as expected. In a complex application where many functions depend on the bugfree performance of another, it is vital to make ...
Boo.Lang.Useful an assembly rife with things beautiful and useful yet not quite core to the Boo language. Welcome to this introductory guide, where we will plumb its murky depths in search of adventure on the high seas and delicious pirate treasures. What's so ...
Value types in boo are like value types in C# and include int, double, and other basic types. Userdefined value types can be created in boo by defining a struct or inheriting from System.ValueType. Value types are constructed on the stack rather than ...
you are more familiar with the python standard classes and objects, such as strings and dictionaries, you can use them via IronPython. In your boo project, add a reference to the IronPython.dll included with IronPython, and then you can use code like this: import IronPython.Objects ...
|
||||||||||||||||||||||||||||||
V |
WSome pages that might be nice to have, based on questions seen on the list and irc. It seems like a lot of times there are good examples in the test/testcases/integration/ http://svn.boo.codehaus.org/trunk/tests/testcases/integration/ folder. We just need to paste ...
import System.Threading import System.Reflection def CreateInstance(progid): type = Sy | ||||||||||||||||||||||||||||||

