Hans Aberg wrote Thursday, March 26, 2009 8:57 AM
On 26 Mar 2009, at 00:55, Trevor Daniels wrote:
The manual says that \char #65 produces the letter "A". Here, 65
is an ordinary integer. Which position number basis? The ASCII
hexadecimal number for "A" is 41, in languages like C/C++
written as 0x41, and in Unicode U+0041. What is the decimal
number? In decimal, 4*16+1 = 65. What is the representation in
the computer? All ASCII characters are translated as binary
numbers. Since the hexadecimal form is 41, 0x4 is binary 0100,
and 0x1 is binary 0001, 0x41 is binary 01000001. So 0x41 is
one 8-bit byte.
So the manual is a bit short: it should say that the number is a
decimal integer representing the Unicode code point.
No, the argument to \char is a hex number.
No, the argument is an integer: Robin Bannister pointed out that
Guile, which LilyPond calls, has syntax for different number
basis:
http://www.gnu.org/software/guile/manual/html_node/Number-Syntax.html
So when you have used it, you probably have written
\char #x41
Right?
You and Robin are right - you can specify either hex or
decimal encodings for the code point in \char. I'll
amend the NR (again!) to clarify this.
Hans
Trevor
_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond