|
![](/i/fill.gif) |
On 6/10/2011 11:26, Orchid XP v8 wrote:
> Yeah, well, Smalltalk is no functional language. ;-)
Oh, sorry, I thought we were still talking about Haskell.
Yeah, the thing is when you compile the expression #[1, 2, 3] it creates a
list and points the executable code to that, or some such.
The same thing happens with Python default arguments.
> When you define a class named Foo, it defines a global variable named Foo
> which contains a Class object describing the class.
Yes. But "global variable" is a bit of a misnomer in a language where global
variables are simply names in a hashtable that the compiler looks up at runtime.
> The fun thing is, since True and False are classes, they are also global
> variables, and you can do something like True := 42, which utterly confuses
> everything.
I think true, false, and nil are usually special-cased in the compiler
(along with ifTrue:ifFalse:, etc) for performance reasons. But yes, in
theory, you could do that.
--
Darren New, San Diego CA, USA (PST)
"Coding without comments is like
driving without turn signals."
Post a reply to this message
|
![](/i/fill.gif) |