From: "Jürgen Strobel" Date: 2006-08-23T09:33:01+09:00 Subject: Re: Enumerable#all? and empty arrays --/04w6evG8XlLl3ft Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 10, 2006 at 08:55:12AM +0900, Just Another Victim of the Ambien= t Morality wrote: >=20 > "Andre Nathan" wrote in message=20 > news:1155141696.24603.43.camel@andre.mz.digirati.com.br... > > Hello > > > > I found this to be somewhat amusing: > > > >>> a =3D [] > > =3D> [] > >>> a.all? > > =3D> true > >>> a.all? { |i| i =3D=3D 10 } > > =3D> true > > > > Is there any reasoning for Enumerable#all? to always return true for > > empty arrays? >=20 > It's mathematically consistent. >=20 > You may be surprised to hear this but mathematicians are generally=20 > optimists. Thus, if a condition is "vacuously satisfied," then we genera= lly=20 > say the condition is true... unless mathematician.is_an :intuitionist # (pretty rare) Sorry I couldn't resist=20 -J=FCrgen --=20 The box said it requires Windows 95 or better so I installed Linux --/04w6evG8XlLl3ft Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iQEVAwUBROuiO/y64gyiEfXtAQLhowgA6VfJ1htmLPiG5fSGQXyZULVjZm9E+UwS 7SwI4VUmrHKV8xLI0dMYkVVkcVrmBk9Vjl3A95n4Nm1ePc1fyqBtxlnM95SGM8Nr R9fDbNxGiJ9CdKUcIBKUONAiCHNyIZAAT3cmsakD4jnTV9l+66SbOOjQxy3098Wj lgrfhbXiRKUIOp8R/91EAM7f1MGiTWdvkUtUx1T5Bi/znXKhGGtk9kuVr8vkSnuW exx0meTghj9CmAg6fwp5v7fQjsH3Bei2bSNinTwvMKqMi/8SFd9lB4+BNkW3Eo44 QFsUh3v/b1q5AUG8Mu1UGxyE8xzGR9CfdmKU5GcdLY4zkcmRBmyS0g== =Kva8 -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft--