I hadn't thought of using macros —good idea. My approach to using Cairo was to 
create a module that calls Cairo functions but maintaining a current context, 
so I can write:

    using EasyCairo, Color
    newpng(1600, 1000)
    background(color("black"))
    setopacity(0.7)
    setcolor(0, 1, 0)
    rect(0,0,256,256, fill)
    setcolor(0, 1, 1)
    setline(10.0)
    move(0, 0)
    line(256, 256)
    move(256, 0)
    line(0, 256)
    stroke()
    finishpng("/tmp/test.png")
    run(`open /tmp/test.png`)

It's the lightest sprinkling of syntactic sugar...

Reply via email to