--Apple-Mail=_842C4033-A8D6-4AA7-8EEB-A2A666240CC1
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

ifelse version 0.6.0 has been released!

* <https://github.com/jimwise/ifelse>
* <Author::    Jim Wise  (mailto:jwise / draga.com)>
* <Copyright:: Copyright (c) 2013 Jim Wise>
* <License::   2-clause BSD-Style (see LICENSE.txt)>

IfElse is an implementation of the pure object-oriented conditional syntax
found in languages of the SmallTalk family, including Self.  Those languages
distinguish themselves by taking the "everything is an object / everything
is a method" approach to a further extreme than Ruby, and getting rid of
almost all cases of special syntax other than object definition and method
call.

Ruby, of course, already works this way for some purposes -- thus most Ruby
developers prefer to write

  [1, 17, 39].each {|x| puts x}

rather than

  for x in [1, 17, 39]
    puts x
  end

and

  3.times {|n| puts n}

instead of

  i = 1
  while i <= 3
    puts i
    i += 1
  end

This module extends that same preference to conditional statements,
providing replacements for the Ruby keywords +if+, and +unless+:

  x = 1
  (x >= 0).if {puts 'positive'}
  (x < 0).unless {puts 'positive'}

Note that as with the built-in special forms these methods replace, these
methods are available on any Ruby Object, and obey the usual rules of which
values are considered "Truthy" and "Falsey".


Note that the primary purpose of this gem is to demonstrate that the
built-in (special form) versions of conditionals provided with Ruby are
mostly syntactic sugar -- as with the +for+ keyword, there is no real need
for these to be built into the language.  With that said, the gem is
fully tested, has no particular performance penalty (beyond the usual cost
of method dispatch), and should be fully useable in general purpose
code.

Note also that while Smalltalk-family languages also provide an
equivalent to the Ruby +else+ keyword, this depends on the more general
block/lambda capability of those languages, which allow a method to take
multiple blocks as arguments.  This could be imitated with a syntax like:

  # NOT A REAL EXAMPLE
  (x > 42).if then: lambda {|x| :big }, else: lambda {|x| :small}

which is true to the SmallTalk original, but feels less Ruby-ish to me, so I
didn't implement this -- perhaps in a later version.

Changes:

### 0.6.0 / 2013-12-17

* Initial release

-- 
				Jim Wise
				jwise / draga.com





--Apple-Mail=_842C4033-A8D6-4AA7-8EEB-A2A666240CC1
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

iQIcBAEBAgAGBQJSsJnqAAoJEIwgZoIS2AGge3AQALocygntdHYKKlEWmM7gX9Yk
72dDRXfriR2d5PbyaGRL4KXe2RF/G64UCUW9qCAtDB+QpiVyBdgF2HsWqupy1OVV
7MEP76EdBxReQS26IIj/JRhVSBknWYLngs8S7WujHhA/jcvrar9U+ABwyJdHha1O
WxS/B8FfkkJi/Oz/7d/3V7f+wdBRWZUMHrmVvoxfzlrtHOemKJBYUJsklegr+ypU
k4336RiM9rBoJQYvu8lSjvXh1OXvz/98Df90jlb9V+S6RnfCLRMXJm8X1PX48ZFt
ILPLP5B788zNA60pFZiGAFop6wvE6cOZM4g3B3NjjfK+ak3bk2KXhj9VbMyhqOAQ
6QXiMoAn0UvX+H02E+4UW/kXFWEOboF8p8pi8afjG708+G11LJ27DMVljJE6YgJq
6iM3Xi7neW4jCCYXr31X/PrALd7I1tnVTyGDk3YHMXJFtv5D7wxuU/7416fg2Z0K
ikysu+3UGIk2bEOg42XoXC7MBdSc/0pJJeiwrpETMZhkP83/wIMYZp8MSaAA/ITi
HU+fxszkqq6pbZE7dqrYnjOAQtXDgQ1C8Js7dDaHAHZYta+U1y/xr5D0ruXpuk8M
T4nN/Wy4PoQQJaRXzozhMNkCupaLK3yQzsvWpu9I+lvpd0TGiqoXURKz9j+EpTa0
fpCtBqEAeaFQ/j6TC44r
=IrW6
-----END PGP SIGNATURE-----

--Apple-Mail=_842C4033-A8D6-4AA7-8EEB-A2A666240CC1--