[Puppet - Bug #15329] Puppet lacks a proper undefined value

2013-10-31 Thread tickets

Issue #15329 has been updated by Paul Pham.


Bump... Are we any closer to a resolution on this?


Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-99300

* Author: Pieter van de Bruggen
* Status: Accepted
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: backlog
* Branch: 

$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet - Bug #15329] Puppet lacks a proper undefined value

2013-10-31 Thread tickets

Issue #15329 has been updated by Henrik Lindberg.


This is on the agenda for Puppet 4 - it is a major semver breaking change. It 
may be available earlier in experimental feature form but is not going to make 
it in time for Puppet 3.4.


Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-99302

* Author: Pieter van de Bruggen
* Status: Accepted
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: backlog
* Branch: 

$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-12-07 Thread tickets

Issue #15329 has been updated by Reid Vandewiele.


With regards to the potential addition of a `nothing` kind of keyword, after 
thinking about this for awhile I realized that I already use a largely 
functional equivalent for passing around nothing in the Puppet DSL. I use an 
empty array, `[ ]`. Here's a contrived example:

pre
class amanda (
  $server_package = 'amanda-server',
  $client_package = 'amanda-client'
) {

  package { $server_package:
ensure = installed,
before = Package[$client_package],
  }

  package { $client_package:
ensure = installed,
  }

}

case $::osfamily {
  'Debian': {
# In my Debian environment, I use a Zmanda provide the amanda service
$server = 'zmanda-backup'
# zmanda-backup provides client AND server, so client should be nothing
$client = [ ] 
  default: {
$server = undef
$client = undef
  } 
}   

class { 'amanda':
  server_package = $server,
  client_package = $client,
}
/pre

Is this the kind of usage you envision a separate nothing keyword being able 
to provide? If it is, would adding a nothing keyword that simply evaluated to 
an empty array provide that functionality, or is there more complexity that 
needs to be carried?

Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-78423

Author: Pieter van de Bruggen
Status: Accepted
Priority: Normal
Assignee: Henrik Lindberg
Category: 
Target version: 
Affected Puppet version: 
Keywords: backlog
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-12-06 Thread tickets

Issue #15329 has been updated by Reid Vandewiele.


Thanks for clarifying. Everything is starting to make more sense now. :-)

I understand the use case for `undef` when used as I described. When using the 
DSL I've actually never thought to try and use undef to override a defined 
resource default by passing in `undef` as a nothing value, since in my mind 
undef very clearly means its mnemonic, which is to undefine a setting, thus 
reverting to the default.

Can you indicate an example use case for wanting to pass in an explicit 
nothing parameter in the DSL in order to override a default, and describe the 
benefit (or draw/motivation) for doing so along with a pseudo-DSL sample (e.g. 
using a hypothetical nothing keyword)? I think a concrete example would 
further clarify a lot of the discussion in this thread.

Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-78355

Author: Pieter van de Bruggen
Status: Accepted
Priority: Normal
Assignee: Henrik Lindberg
Category: 
Target version: 
Affected Puppet version: 
Keywords: backlog
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-10-19 Thread tickets

Issue #15329 has been updated by eric sorenson.

Assignee changed from Pieter van de Bruggen to Henrik Lindberg
Priority changed from High to Normal
Keywords set to backlog

Flagging this top-line ticket for inclusion in the project backlog.

Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-74407

Author: Pieter van de Bruggen
Status: Accepted
Priority: Normal
Assignee: Henrik Lindberg
Category: 
Target version: 
Affected Puppet version: 
Keywords: backlog
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-10-19 Thread tickets

Issue #15329 has been updated by Andrew  Parker.


Henrik Lindberg wrote:
 Nothingness is a quite complicated topic - here is how nothingness is handled 
 in Scala: http://oldfashionedsoftware.com/2008/08/20/a-post-about-nothing/
 

The billion dollar mistake: 
http://qconlondon.com/london-2009/presentation/Null+References:+The+Billion+Dollar+Mistake

 In Puppet DSL, the semantics are quite `undef` as `undef` serves both as a 
 symbolic nil, has no value, and as anti-matter (annihilates the expression).
 
 To keep sanity it is probably also required to modify the auto type 
 conversion to boolean. Currently some type of emptiness (string is empty) is 
 true, but not other forms. Is nil true or false? (IMO neither). Auto 
 conversion to boolean is just a source of WAT.
 
 Without too much exploration, I think the best approach could be to introduce 
 nil (or null) as a new Literal with the same semantics as Java or Ruby 
 null/nil (i.e. somewhat ambiguous), as the much more sophisticated 
 Nothingness definitions available in Scala is not all that useful in a 
 semi-untyped language.


I don't really like the idea of heading down the path that creates the 
incredible confusion in Javascript with null vs. undefined 
(http://saladwithsteve.com/2008/02/javascript-undefined-vs-null.html). 
 
 Think first step towards doing something about this is to clearly define 
 undef and nil and perform a thorough analysis.



Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-74414

Author: Pieter van de Bruggen
Status: Accepted
Priority: Normal
Assignee: Henrik Lindberg
Category: 
Target version: 
Affected Puppet version: 
Keywords: backlog
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-10-19 Thread tickets

Issue #15329 has been updated by Henrik Lindberg.


Andrew  Parker wrote:
 I don't really like the idea of heading down the path that creates the 
 incredible confusion in Javascript with null vs. undefined 
 (http://saladwithsteve.com/2008/02/javascript-undefined-vs-null.html). 
 
I have been thinking more about this too - especially after looking at the 
Scala way; although very precise, it is also completely confusing and overkill. 
Having one value that is both antimatter and classic nil, does not work, but 
having two is at the same time is both one too many, and not enough.
 
In fact, I really hate undef as an antimatter value that can be passed 
around, and would prefer to get rid of that meaning completely in favor of a 
straight forward classic nil sense. Big problem is that there is no 
conditional fat comma. You are not allowed to do something like:

pre
file { 'title': if ($foo != undef) { mode = $foo}, owner = root }
/pre
Not would it be possible to easily support such syntax - it is just an example.

In all other cases, the syntax already allows passing a reasonable value, or no 
value at all (i.e. function calls).

A conditional fat comma could be introduced with the meaning, set to 'nil' 
(which we can continue to call 'undef') - it could look like this:
pre
file { 'title' : mode =? $foo, owner = root }
/pre
or some other clever way to express the operator. Oh, it could be done like 
this:
pre
file { 'title' : (mode = $foo), owner = root }
/pre

The big advantage with this scheme is that it is totally clear where an undef 
becomes antimatter / is a noop. User can decide to pass the undef as a value, 
or use it to not set, and there is no confusion with two separate 
nothingness values.


Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-74450

Author: Pieter van de Bruggen
Status: Accepted
Priority: Normal
Assignee: Henrik Lindberg
Category: 
Target version: 
Affected Puppet version: 
Keywords: backlog
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-10-19 Thread tickets

Issue #15329 has been updated by Henrik Lindberg.


Could also do something like
pre
file { 'foo': mode = $foo unless undef,  owner = 'root' }

Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-74522

Author: Pieter van de Bruggen
Status: Accepted
Priority: Normal
Assignee: Henrik Lindberg
Category: 
Target version: 
Affected Puppet version: 
Keywords: backlog
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-10-08 Thread tickets

Issue #15329 has been updated by Henrik Lindberg.


Nothingness is a quite complicated topic - here is how nothingness is handled 
in Scala: http://oldfashionedsoftware.com/2008/08/20/a-post-about-nothing/
In Puppet DSL, the semantics are quite `undef` as `undef` serves both as a 
symbolic nil, has no value, and as anti-matter (annihilates the expression).

To keep sanity it is probably also required to modify the auto type conversion 
to boolean. Currently some type of emptiness (string is empty) is true, but not 
other forms. Is nil true or false? (IMO neither). Auto conversion to boolean is 
just a source of WAT.

Without too much exploration, I think the best approach could be to introduce 
nil (or null) as a new Literal with the same semantics as Java or Ruby 
null/nil (i.e. somewhat ambiguous), as the much more sophisticated Nothingness 
definitions available in Scala is not all that useful in a semi-untyped 
language.

Think first step towards doing something about this is to clearly define 
undef and nil and perform a thorough analysis.

Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-72862

Author: Pieter van de Bruggen
Status: Accepted
Priority: High
Assignee: Pieter van de Bruggen
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-08-22 Thread tickets

Issue #15329 has been updated by eric sorenson.


I've extracted all of the use cases and test code from the bugs linked above 
and put them into a 'modulepath' compatible git repository:

https://github.com/ahpook/puppet-undef

Hopefully this will be a useful, concrete starting point as we're trying to 
define what behaviour we want and making sure that things are consistent for 
the various things people want out of the DSL.

Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-69626

Author: Pieter van de Bruggen
Status: Accepted
Priority: High
Assignee: Pieter van de Bruggen
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.



[Puppet - Bug #15329] Puppet lacks a proper undefined value

2012-08-20 Thread tickets

Issue #15329 has been updated by Andrew  Parker.


My biggest concern around changing this is the possible impact on existing 
code. If anyone somehow relied on this insane behavior, then changes that make 
it much more straightforward might end up breaking all of that. We need to 
avoid that situation.

So what is a way that we can get the semantics we want with a minimal (or at 
least very clearly understandable) break of existing code?

Bug #15329: Puppet lacks a proper undefined value
https://projects.puppetlabs.com/issues/15329#change-69468

Author: Pieter van de Bruggen
Status: Accepted
Priority: High
Assignee: Pieter van de Bruggen
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


$y = undef
notice($y == )  # true
notice($x == $y)  # true
notice($x == )  # true

Recent changes in the Puppet DSL made equality commutative (good!), but in 
doing so broke work-arounds for actually testing for the difference between an 
undefined and empty value.  The most logical fix would be to equate Puppet's 
`undef` with Ruby's `nil`.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Bugs group.
To post to this group, send email to puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.