--Apple-Mail=_1124DF45-97E5-4391-9E0D-1720E5C24DF1
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_D949CBCA-651D-4C0E-9AF6-36FD5161AAB2"


--Apple-Mail=_D949CBCA-651D-4C0E-9AF6-36FD5161AAB2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


On Dec 20, 2013, at 04:48 , Matthew Kerwin <lists / ruby-forum.com> wrote:

> Joel Pearson wrote in post #1131234:
>> I see, so by defining the methods that way, you get a performance =
boost
>> since they don't need to do comparisons.
>=20
> Such as it is, yes, a tiny boost.  A tiny bit more maintenance, =
though,
> so it's a trade-off.

My goal was to show that Ruby=92s built-in idea of =93truthy=94 and =
=93falsey=94 didn=92t actually need to be built into the language =
(theoretically =97 there=92s some nice syntactic sugar that comes from =
them being built in.

So, this gem implements conditionals without using built-in truth value =
at all.  :-)

For what it=92s worth, boolean operations can be implemented the same =
way (and may be in a future version of this gem):

class TrueClass
  def or other
    self
  end
end

class FalseClass
  def or other
    other
  end
end

(etc=85)

--=20
				Jim Wise
				jwise / draga.com





--Apple-Mail=_D949CBCA-651D-4C0E-9AF6-36FD5161AAB2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=windows-1252

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space;"><br><div><div>On Dec 20, 2013, at 04:48 , Matthew =
Kerwin &lt;<a =
href=3D"mailto:lists / ruby-forum.com">lists / ruby-forum.com</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite">Joel Pearson wrote in post #1131234:<br><blockquote =
type=3D"cite">I see, so by defining the methods that way, you get a =
performance boost<br>since they don't need to do =
comparisons.<br></blockquote><br>Such as it is, yes, a tiny boost. =
&nbsp;A tiny bit more maintenance, though,<br>so it's a =
trade-off.</blockquote><br></div><div>My goal was to show that Ruby=92s =
built-in idea of =93truthy=94 and =93falsey=94 didn=92t actually need to =
be built into the language (theoretically =97 there=92s some nice =
syntactic sugar that comes from them being built =
in.</div><div><br></div><div>So, this gem implements conditionals =
without using built-in truth value at all. =
&nbsp;:-)</div><div><br></div><div>For what it=92s worth, boolean =
operations can be implemented the same way (and may be in a future =
version of this gem):</div><div><br></div><blockquote style=3D"margin: 0 =
0 0 40px; border: none; padding: 0px;"><div><font face=3D"Courier =
New">class TrueClass</font></div><div><font face=3D"Courier New">&nbsp; =
def or other</font></div><div><font face=3D"Courier New">&nbsp; &nbsp; =
self</font></div><div><font face=3D"Courier New">&nbsp; =
end</font></div><div><font face=3D"Courier =
New">end</font></div><div><font face=3D"Courier =
New"><br></font></div><div><font face=3D"Courier New">class =
FalseClass</font></div><div><font face=3D"Courier New">&nbsp; def or =
other</font></div><div><font face=3D"Courier New">&nbsp; &nbsp; =
other</font></div><div><font face=3D"Courier New">&nbsp; =
end</font></div><div><font face=3D"Courier =
New">end</font></div></blockquote><div><br></div><div>(etc=85)</div><br><d=
iv apple-content-edited=3D"true">
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; =
color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; =
line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; =
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: =
0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px;  "><span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
Helvetica; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: 2; =
text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px;  "><div style=3D"word-wrap: =
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; "><div><span class=3D"Apple-tab-span" =
style=3D"white-space: pre; ">-</span>-&nbsp;</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space: pre; ">				=
</span>Jim Wise</div><div><span class=3D"Apple-tab-span" =
style=3D"white-space: pre; ">				</span><a =
href=3D"mailto:jwise / draga.com">jwise / draga.com</a></div><div><br></div></=
div></span><br class=3D"Apple-interchange-newline"></span><br =
class=3D"Apple-interchange-newline">
</div>
<br></body></html>=

--Apple-Mail=_D949CBCA-651D-4C0E-9AF6-36FD5161AAB2--

--Apple-Mail=_1124DF45-97E5-4391-9E0D-1720E5C24DF1
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBAgAGBQJStf/WAAoJEIwgZoIS2AGgXFwQAMWDxFSHfTPsplWZr6vte7zD
/aK400Xayz0Gdn9+dW1Wm1dmy2baaa8HncGlJlMdPbSRMH4AWERx64WjlJhkv52H
nrmhlDlBxmervv78GH6R8yBR2Xz6rUdBMo++urZWzHQBSDIZIMq/s3kWXWPRIuTP
Y/5FfQ0LR3f2rT6VQBb8a7bwQhZlOHhHh9G7FUWwoLFspim6XuRIWXWlQfohXdrP
JvnjPDyaRqGgyRJEfANuN0l2ytZprcphyfqgKrelND9rpLhWiMpYxuzC5OWWUXPo
NRnLL/cEBDLYU5WhlO3UMnzOdn29jE9MLLWSYfy0zH5P9N1wYIJ0QOW0OYntzzil
gJC6rQdAPK95m33Pic0qdQXCd5GDB9ydG9GINrMvjis8astAleEitIoyd603izIe
MEfPjs5NdR5cc/yQP4CGBxQLZ/UufZdx3OOuVo+eLRCqMPH45qO8G6isR4njwMVX
pcICpqCw1rqoqinIJuFCIN1Zn1+nKmX5qMWHl9JLk8INsEl4i7JblbjR+/aRv740
rDjV5cuB0i3XArlyHPZ7nQqyo9Cw54f0WrKdBHBHtX7JQvgQYgaaUGZgzXMc7rGZ
4Ek2Vu+S+IrpjCLDeqze2a5MEcIkbC7acJa0kbbbSN5OB5QBe9J5IrKRCNdbT/3M
D+CMSvdtrui6gawXjjgV
=nMb5
-----END PGP SIGNATURE-----

--Apple-Mail=_1124DF45-97E5-4391-9E0D-1720E5C24DF1--