Before trying this library, I noticed that it could be installed by using ASDF-Install. ASDF is like a packaging system for Common Lisp libraries and ASDF-Install is a program that let's you locate and install thouse libraries with its dependencies.
I'm using Steel Bank Common Lisp which already has ASDF and ASDF-Install integrated with it.
In order to install Vecto the only thing that I did was:
* (require :asdf)
* (require :asdf-install)
* (asdf-install:install :Vecto)
After answering a couple of questions It downloaded and installed Vecto with all its dependencies.
The library has nice documentation. Here's a little example I created for this post.
(:use #:cl #:vecto))
(defun triangle (s c)
(set-rgb-stroke (car c)
(move-to 0 0)
(line-to (- s) 0)
(line-to 0 (- s))
(line-to s 0)
(defun gen-values (from to step)
(if (<= from to)
(gen-values (+ from step) to step))
(defun tria (file)
(with-canvas (:width 300 :height 300)
(mapcar #'(lambda (x)
(translate 150 150)
(rotate (cadr x))
(triangle (car x) (list (random 1.0)
(mapcar #'(lambda (length angle) (list length angle))
(gen-values 10 200 30)
(gen-values 0.0 3.14 0.4)))
This code generates the following image: