On 21/03/10 15:38, Markus Roberts wrote:
> Brice --
> 
> No, I haven't addressed it.  Thanks for bringing it back to my attention.
> 
> The problem is that we want:
> 
>     notice $a
>     $a = "foo"
> 
> to be exactly the same as
> 
>     $a = "foo"
>     notice $a
> 
> in that source order *does not matter* in the propagation of values.  That's
> the essence of the futures patch, and depends on the fact that $a can be
> assigned at most once in any scope.
> 
> On the other hand, we can at least in theory write things like
> 
>     if $x =~ /a(.*)/ or $x =~/(.*)z/ {
>         notice $1
>     }
> 
> and if $x were "abcxyz" and we intend to maintain the no side effect, order
> independent semantics, what should $1 be in the block?

Obviously we can't find a correct answer because there is none. So let's
chose a convention and treat ephemeral variables a little bit
differently than the regular case.

I'd tend to favor the rule of last executed wins (which is certainly the
easiest to come with).

And this problem won't happen as much as the following (which is the
root of the issue):

if $a =~ /a(.*)/ {
  if $b =~ /b(.*)/ {
  }
}

This one is guaranteed to fail in 0.25.x :-(

> As you can see, this isn't really a question about the patch but about what
> the desired effect is.  Only when we figure that out can we tell if the
> patch is a step in the right direction.

To reinstate my thoughts: I don't care the result is not coherent for
things that don't make sense (ie your previous example), as long as what
is supposed to work runs fine :-)
-- 
Brice Figureau
My Blog: http://www.masterzen.fr/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to