{"size": 1401, "ext": "scrbl", "max_stars_repo_path": "doc/sagittarius/debug.scrbl", "max_stars_repo_name": "christoff-buerger/sagittarius-scheme", "max_stars_repo_stars_event_min_datetime": "2015-11-07T07:13:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T03:35:14.000Z", "max_issues_repo_path": "doc/sagittarius/debug.scrbl", "max_issues_repo_name": "christoff-buerger/sagittarius-scheme", "max_issues_repo_issues_event_min_datetime": "2016-04-28T21:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-01T08:42:21.000Z", "max_forks_repo_path": "doc/sagittarius/debug.scrbl", "max_forks_repo_name": "christoff-buerger/sagittarius-scheme", "max_forks_repo_forks_event_min_datetime": "2016-12-28T12:41:23.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-26T20:52:02.000Z"}
{"max_stars_count": 39, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 27.4705882353, "max_line_length": 82, "alphanum_fraction": 0.727337616}
@; -*- mode:scribble; coding: utf-8 -*-

@subsection[:tag "lib.sagittarius.debug"]{(sagittarius debug) - Debugging support}

@define[Library]{@name{(sagittarius debug)}}
@desc{This library provides debugging support reader macro.}

@define["Reader Macro"]{@name{#?=} @args{expr}}
@desc{This reader macro reads the next expression as followings;

@snipet{(debug-print @var{expr})}

@code{debug-print} is an internal macro of this library which prints the
read expression and its result.

Following example shows how to enable this;

@codeblock{
#!read-macro=sagittarius/debug
#!debug
(let ((a (+ 1 2)))
  #?=(expt a 2))

#|
#?=(expt a 2)
#?-    9
|#
}

@code{#!debug} enables the debug print.
}

@define[Function]{@name{macroexpand} @args{expr}}
@desc{Expands given @var{expr}. The returning value may or may not be used
as proper Scheme expression.
}

@define[Function]{@name{macroexpand-1} @args{expr}}
@define[Function]{@name{macroexpand-n} @args{expr n}}
@desc{Expands given @var{expr} @var{n} times. The first form's @var{n} is 1.

This procedure expands only globally defined macro and the result of expansion
is other macro such as next rule of @code{syntax-rules}. It doesn't consider
locally bound macros.

The returning value may or may not be used as proper Scheme expression.
}

Above 2 procedures are no more than debug aid. Depending on the result of
expansion is not guaranteed to work.
