This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: port-line and port-column


> hmm, `C-a M-: (current-column) RET' says 0.  the `1-' in the comment
> seems to be a verb, not an adjective.  here's the referenced code:
>                 ;; Columns in error msgs are 1-origin.
>                 (move-to-column (1- column))

Wrong.  "1-orgin" means "starts at 1", as opposed to "0-origin",
which means "starts at 0".  This is a an old debate (does the
first element of an array have index 1, as in Fortran, or 0,
as in C?), with old terminology.

The referenced code takes the the 1-origin column number from the
error message, and subtracts 1 (to convert it it to 0-origin),
before passing it to move-to-column (which expects a 0-origin column
number).

One can argue either way, but I think if the first line is
line one, then the first column for consistency should be column one.
The convention as currently implemented (but not documented!)
in Guile is broken.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner