All 6 entries tagged Boo

No other Warwick Blogs use the tag Boo on entries | View entries tagged Boo at Technorati | View all 1 images tagged Boo

May 15, 2006

Specter Project

Writing about web page

SourceForge finally accepted my project proposal.

I'm waiting on the SVN migration to take affect – but the source will be online very soon I hope.

For now, you can read more on the website .

— Edit —
Source now available via SubVersion:

May 11, 2006

Boo AST Attribute Ideas

Here are some ideas I had for handy Boo AST (abstract syntax tree) attributes:
def Foo():
expands to
def Foo():
except ex:

Very handy for UI code that calls into business objects that may throw up exceptions. Not having to explicitly write the try…except block is a timesaver!


class MyForm:
btn = Button()

def ButtonClicked():
print "button clicked"
expands to
class MyForm:
btn = Button()

def constructor():
btn.Click += ButtonClicked

def ButtonClicked():
print "button clicked"
This allows the event hookup to appear on the handling method, rather than miles away in the constructor. This is great for UI code since it means u can delete a method and know there is not still a line of code else trying to point to it. (So basically is works like the VB.NET "handles" keyword.)

May 04, 2006


specter logo

May 02, 2006


I'm waiting for SourceForge to approve my Specter project (previously know as BooSpec). It's been 7 days so far already.. I'm hoping they're just really busy and will get round to me soon.
I'll blog as soon as the project is approved (fingers crossed!). Anyone who wants to collaborate will then be welcome to join the project.

I had another syntax idea today as well…

Instead of something like:

how about:
foo.Must.Be <= 42

I can make the object returned by "Be" overload the comparison operators. This makes for much less typing and I think is easier to read. Of course, I can support both forms in Specter and let the user decide which they prefer.

Similarly the equality specifications become:

foo.Must.Be == 42
Actually, now that I think about it… I can probably make the Boo macro look for statements that are just binary expressions (A op B) and output correct method calls at compile time. This would make for specs like this:
context "Sample spec":
x as int

x < 42
:D This could be awesome!

April 18, 2006


Follow-up to Behavior Driven Development: BooSpec from codeMonkey.Weblog();

Wooo! I thought it couldn't be done, but Boo's syntactic macros (given an afternoon of hacking!) allow me to do this:
import BooSpec

context TestContext:
data as string

data = "hello"

specify Print:
print data

e = TestContext()
Yup, that's right! The "context" macro is creating a new class. The setup and specify macros create methods. Basically what this means is soon we'll be able to write object behaviour specifications without all that nasty non-spec syntax getting in the way.
class EmptyStack:
def CountIsZero():
with simply:
context "Empty Stack"
specify "Count is zero":
I must say a huge thank you to the guys over on the BooLang group. Without their advice and examples I'd never have gotten here!

April 16, 2006

Behavior Driven Development: BooSpec

This weekend is watched this video I then spent a lot of time exploring a relatively new concept in the agile development world: Behavior Driven Development (BDD).

RSpec is a Ruby project to allow creation of runnable specifications. There is a related project for .NET called NSpec

I have also been exploring Boo , a cool new language targeting .NET. Whilst NSpec allows the creation of runnable specs, I don't like the slightly clunky syntax imposed by C#. I want my spec to be as human readable as possible. Basically we need extension methods in C#. These are coming in 3.0, but for now I thought I'd look at Boo. Boo allows me to more closely approximate RSpec's Ruby syntax, giving rise to Boo specs like this:

namespace Test

import BooSpec

class EmptyStack:
private stack as Stack

def SetUp():
stack = Stack(10)

def CountIsZero():

def PopThrowsException():
{ stack.Pop() }.Must().Throw(typeof(IllegalOperationException))

def PushedItemIsOnTop():

I especially like "{ stack.Pop() }.Must().Throw(typeof(IllegalOperationException))". It's just so succinct!

I'm tempted to start a new project called "BooSpec". This would be a library similar to RSpec and NSpec, but written in Boo. The BooSpec library could be used by any .NET language, except the Must() extension methods calls would have to revert to normal static calls. Of course there is nothing wrong with writing the spec in Boo and the application code in C# or VB.NET!

Google Ads

Search this blog

Most recent comments

  • I scratched my eye while i was holding some kind of plastic packaging.. Anyways the corner of the pl… by Ercan on this entry
  • About a year ago my contacts that i was wearing, i guess were fautly, because shortly after they wer… by Jon on this entry
  • I got shower gel in my eye 4 and a half days ago, and becasue i rubbed my eyes a lot, i have scratch… by Chris on this entry
  • This website may help–health/tc/Eye–Injuries–Home–Treatment by S on this entry
  • I somehow got dirt, or debris in my eye. The terrible pain sent me in a tailspin. I was afraid of sa… by Bobbi on this entry


September 2021

Mo Tu We Th Fr Sa Su
Aug |  Today  |
      1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30         


Blog archive

RSS2.0 Atom
Not signed in
Sign in

Powered by BlogBuilder