Skip to content

Instantly share code, notes, and snippets.

@cv
Created January 5, 2009 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cv/43226 to your computer and use it in GitHub Desktop.
Save cv/43226 to your computer and use it in GitHub Desktop.
graph = method(
Origin mimic do(
G = Origin mimic
G {} = macro(
msg = call arguments first
until(msg nil?,
left = msg arguments first name print
connector = msg name print
right = msg next name println
msg = msg next next next
)
)
)
)
;; taken straight from http://www.graphviz.org/Gallery/undirected/process.gv.txt
graph G {
run -- intr;
intr -- runbl;
runbl -- run;
run -- kernel;
kernel -- zombie;
kernel -- sleep;
kernel -- runmem;
sleep -- swap;
swap -- runswap;
runswap -- new;
runswap -- runmem;
new -- runmem;
sleep -- runmem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment