From 22f09f22d82a247d741795c1646fd74878482bc7 Mon Sep 17 00:00:00 2001 From: Alex Knauth Date: Sun, 11 Oct 2015 14:48:52 -0400 Subject: [PATCH] Create README.md --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d5c82db --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +debug +== +A meta-language for debugging, based on sugar/debug from [mbutterick/sugar](https://github.com/mbutterick/sugar) + +To debug the value of an expression, simply put `debug` in front of the language at the top of +the file (for instance `#lang debug racket`), and put `#R`, `#RR` or `#RRR` in front of the +expression. + +- `#R` reports the value and returns it +- `#RR` reports the value with a line number and returns it +- `#RRR` reports the value with the file and line number, and returns it + +```racket +#lang debug racket +#R(+ 1 2) +``` +Shows the output: +``` +(+ 1 2) = 3 +3 +``` + +```racket +#lang debug racket +(+ 1 2 #R(* 3 4)) +``` +Shows the output: +``` +(* 3 4) = 12 +15 +```