POV-Ray : Newsgroups : povray.off-topic : A silly little toy (~200 kb) : Re: A silly little toy (~200 kb) Server Time
10 Oct 2024 03:18:46 EDT (-0400)
  Re: A silly little toy (~200 kb)  
From: Invisible
Date: 16 Oct 2008 04:34:31
Message: <48f6fc97$1@news.povray.org>
scott wrote:

> What does the result y <- #2 mean?
> 
> Try the two below:
> 
> @Element[x,{1,y}]
> @Element[x,{y,1}]
> 
> The 2nd one contains the "y <- #2" result but the first one doesn't.

Consider the expression "?x: y = x". This is read as "there exists an x 
such that y = x". What it "really" does is replace x with a unique 
variable name (in this case, "#1").

The only reason you would do this is if you're running a recursive 
predicate, so that successive recursions all get unique variable names. 
Internally, all of the predefined functions except @Empty are recursive 
and so use such variables.

Ordinarily, all these temporary variables either have nothing bound to 
them, or are bound to a specific value. But occasionally they do show up 
in the final result. In the example you give, "y <- #2" actually means 
nothing at all, so the program should probably elide that. (It means 
that y is equal to some temporary variable which itself doesn't have a 
defined value, and hence y has no defined value - which would be the 
same as the result set not mentioning y at all!)

See? This stuff is harder than it looks! ;-)

> Also I agree with what Darren said, the dark blue used for the "<-" is a 
> bit too dark (visible, but hard to see, how about dark red instead?).

Hmm, yes, that *is* a little dark...


Post a reply to this message

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