Hi Chris,
I tried your code in a 4.3 squeak and got your described results. Went back to
a 3.9 squeak and got the results expected with the printing actually working.
So I suspect there is a problem. I suspect it is not known. I wonder if the
problem is that color is now setting both foreground
a String in smalltalk: 'hello'
aString in java : "hello"
a Character in smalltalk : $h
a character in java: 'h'
Cheers
Alain
"calcrisk33" a écrit dans le message de news:
1303886113281-3477352.p...@n4.nabble.com...
> bool = $a worked like a charm! So what exactly does $ do? I'm more
> famil
On Wed, 27 Apr 2011 18:06:29 +0200, Mateusz Grotek
>is a character a string?
>in Smalltalk the answer is NO.
But of course in Smalltalk you can have a string with only one character in
it. But:
$a is not equal to 'a'
$a is equal to 'a' first or 'a' at: 1.
Having a Character class in Smalltalk
calcrisk33 pisze:
> bool = $a worked like a charm! So what exactly does $ do? I'm more familiar
> with Java and am trying to break that thought process... relating Squeak to
> Java.
>
> Appreciate it!
>
Some analogies:
If you know C:
Smalltalk|C
'abc'|"abc"
$a |'a'
If you know so
> "Tobias" == Tobias Pape writes:
Tobias> Every character is just a string of the length 1 (just like you
Tobias> used it in the first place).
Not really.
That would imply $a is 'a'. And it's very much not, which is what the
OP is discovering.
--
Randal L. Schwartz - Stonehenge Consultin
Am 2011-04-27 um 08:35 schrieb calcrisk33:
> bool = $a worked like a charm! So what exactly does $ do? I'm more familiar
> with Java and am trying to break that thought process... relating Squeak to
> Java.
Note that Java has not notion of first-class Characters.
Every character is just a st
$a is a way to input the Character "a". Just like you use 'Hello' to
input the string "Hello". In other words, it is a Character literal.
Does that make sense?
Matthias
On Wed, Apr 27, 2011 at 08:35, calcrisk33 wrote:
> bool = $a worked like a charm! So what exactly does $ do? I'm more famili