When are unnecessary casts useful?

K

Keith Thompson

Malcolm McLean said:
How many bits you need for a char depends on your language. 64 is a good
choice, however, because then the bits can be a 8x8 raster.

How is an 8x8 raster useful? We're talking about a representation of
a character code, not a graphical representation of what the character
looks (and 8x8 bits would be inadequate for that anyway).
 
G

Guest

Keith said:
How is an 8x8 raster useful? We're talking about a representation of
a character code, not a graphical representation of what the character
looks

They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)
(and 8x8 bits would be inadequate for that anyway).

It's enough if you use an 8x8 font.
 
K

Keith Thompson

Harald van Dþÿ3k said:
They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)

And the values of the characters '0' through '9' would no longer be
contiguous.
It's enough if you use an 8x8 font.

I see no point in tying the type char to any particular font (assuming
that's what Malcolm has in mind).
 
K

Keith Thompson

Harald van D_k said:
They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)

And the values of the characters '0' through '9' would no longer be
contiguous.
It's enough if you use an 8x8 font.

I see no point in tying the type char to any particular font (assuming
that's what Malcolm has in mind).

[My first reply was incorrect tagged "charset=utf-16be", so I'm
re-posting. I'll try to fix whatever's causing that.]
 
G

Guest

Keith said:
Harald van D_k said:
Keith said:
[...]
How many bits you need for a char depends on your language. 64 is a good
choice, however, because then the bits can be a 8x8 raster.

How is an 8x8 raster useful? We're talking about a representation of
a character code, not a graphical representation of what the character
looks

They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)

And the values of the characters '0' through '9' would no longer be
contiguous.

Good point. You'd need a special exception in that system, swapping
the character containing the representation of '0' with an otherwise
unused representation, and similarly for the other digits.
I see no point in tying the type char to any particular font (assuming
that's what Malcolm has in mind).

If I ignore your previous paragraph here, there could be a rare
exception: a system that already uses 64-bit chars anyway, and where
the font cannot be changed, and where even in text mode any
combination of pixels can be printed in a character block. Generally
speaking though, neither do I, and even that system should probably be
redesigned to allow the font to be changed, since the hardware is
clearly capable of it.
[My first reply was incorrect tagged "charset=utf-16be", so I'm
re-posting. I'll try to fix whatever's causing that.]

You've said it's caused by my name, but you're the first I've seen
have this particular problem with it, so no idea here, sorry.
 
N

Nelu

Keith Thompson said:
Harald van D??3k said:
Keith said:
[...]
How many bits you need for a char depends on your language. 64 is a good
choice, however, because then the bits can be a 8x8 raster.

How is an 8x8 raster useful? We're talking about a representation of
a character code, not a graphical representation of what the character
looks

They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)

And the values of the characters '0' through '9' would no longer be
contiguous.
It's enough if you use an 8x8 font.

I see no point in tying the type char to any particular font (assuming
that's what Malcolm has in mind).

Is the utf16-be you're using, again, related to the discussion? :)).
Or is it just my reader?...
 
W

Walter Roberson

They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)

You'd have fun writing a time-and-space efficient toupper()
and so on.
 
C

CBFalconer

Walter said:
Keith said:
[...]
How many bits you need for a char depends on your language. 64 is
a good choice, however, because then the bits can be a 8x8 raster.
How is an 8x8 raster useful? We're talking about a representation
of a character code, not a graphical representation of what the
character looks
They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc.
(My apologies if I got the number wrong.)

You'd have fun writing a time-and-space efficient toupper()
and so on.

You make the matrix hold a 6 wide by 8 high bit map, leaving two 8
bit areas free, to hold the equivalent ascii char and an 8 bit
attribute set. An attribute bit can shift thing down 2 bits,
allowing for descenders. The result is displayed in a 6 by 10
field, nicely compatible with most scans.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
 
R

Richard Bos

=?utf-8?B?SGFyYWxkIHZhbiBExLNr?= said:
They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)

And what about if you wanted both an all-white _and_ an all-black square
in your charset? You wouldn't be able to have a null character, then.
It's enough if you use an 8x8 font.

An 8x8 font is itself clearly not enough. It was good enough for 1980's
English-only home computers; it's not enough for anything serious today.

Richard
 
G

Guest

Richard said:
=?utf-8?B?SGFyYWxkIHZhbiBExLNr?= said:
Keith said:
[...]
How many bits you need for a char depends on your language. 64 is a good
choice, however, because then the bits can be a 8x8 raster.

How is an 8x8 raster useful? We're talking about a representation of
a character code, not a graphical representation of what the character
looks

They could be equal. With 64-bit chars, ' ' could be equal to
0xFFFFFFFFFFFFFFFF, 'A' could be equal to 0xFFE7DBDBC3DBDBFF, etc. (My
apologies if I got the number wrong.)

And what about if you wanted both an all-white _and_ an all-black square
in your charset? You wouldn't be able to have a null character, then.

Sure you would. The all-black square would be the null character. You
wouldn't be able to store it in C strings, but you would be able to
read and write it using the standard C character-based I/O functions.
An 8x8 font is itself clearly not enough. It was good enough for 1980's
English-only home computers; it's not enough for anything serious today.

I hope you mean it's not enough for everything serious today.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top