POV-Ray : Newsgroups : povray.off-topic : Unit Testing question : Re: Unit Testing question Server Time
30 Jul 2024 00:29:26 EDT (-0400)
  Re: Unit Testing question  
From: Darren New
Date: 10 Jun 2011 16:11:11
Message: <4df27a5f$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.