Fix error messages involving definition forms
authorMark H Weaver <mhw@netris.org>
Fri, 27 Jan 2012 04:55:24 +0000 (23:55 -0500)
committerMark H Weaver <mhw@netris.org>
Fri, 27 Jan 2012 14:52:58 +0000 (09:52 -0500)
commit40e92f09fc3330aa33a169ad1aa6bf458633984c
treefe90fc1469384329b9dd08b79c223957257b9b2b
parentd4b5c773e46284ff1aedf0ff7a907f5a37deaf8d
Fix error messages involving definition forms

* module/ice-9/psyntax.scm (syntax-type): Return an additional value
  that contains the entire form in _all_ cases, including for definition
  forms.  Previously, the entire form was not returned for definition
  forms.

  (expand-expr): Add an additional argument that contains the entire
  form in _all_ cases, including for definition forms.  Use it to
  include the entire form in error messages, notably for definitions in
  expression context.  Include the source location information, which
  was previously missing from these errors when the rhs expression was
  an atom.  Improve the "definition in expression context" error message
  to be more comprehensible for Scheme beginners.

  (expand-top-sequence, expand, expand-body): Adjust as needed to handle
  the additional return value from 'syntax-type' and the additional
  argument to 'expand-expr'.

* module/ice-9/psyntax-pp.scm: Regenerate.

* NEWS: Update.
NEWS
module/ice-9/psyntax-pp.scm
module/ice-9/psyntax.scm