bcholmes: (Default)
[personal profile] bcholmes

Geek question:

What is the feature of a language that you consider "strong typing"? How does strong typing manifest itself (or not) in your favourite language or two?

(no subject)

Date: 2005-12-03 08:47 pm (UTC)
From: [identity profile] http://users.livejournal.com/merle_/
You're probably just channelling old C memories, not BASIC.

char a = 'a';
a = a + 1;
/* a == 'b' now */


If your character is represented as a char/byte, then yes, incrementing it shifts the letter up. But if it's a string then it depends on how "+" is interpreted: either it will concatenate a "1", or, horrors, it will increment your pointer and...

Some BASICs let you work with character codes. Commodore BASIC had tons of poke/peek/call things that were basically invoking magic machine code, so you would probably have been passing char/byte values around.

Profile

bcholmes: (Default)
BC Holmes

February 2025

S M T W T F S
      1
2345678
9101112131415
16171819202122
2324252627 28 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Powered by Dreamwidth Studios