README.md in dentaku-2.0.0 vs README.md in dentaku-2.0.1
- old
+ new
@@ -3,10 +3,11 @@
[![Join the chat at https://gitter.im/rubysolo/dentaku](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/rubysolo/dentaku?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Gem Version](https://badge.fury.io/rb/dentaku.png)](http://badge.fury.io/rb/dentaku)
[![Build Status](https://travis-ci.org/rubysolo/dentaku.png?branch=master)](https://travis-ci.org/rubysolo/dentaku)
[![Code Climate](https://codeclimate.com/github/rubysolo/dentaku.png)](https://codeclimate.com/github/rubysolo/dentaku)
+[![Hakiri](https://hakiri.io/github/rubysolo/dentaku/master.svg)](https://hakiri.io/github/rubysolo/dentaku)
DESCRIPTION
-----------
Dentaku is a parser and evaluator for a mathematical and logical formula
@@ -202,29 +203,29 @@
1. You can't be bothered to share
1. You can't wait for me to respond to a pull request, you need it `NOW()`
1. The formula is the secret sauce for your startup
Whatever your reasons, Dentaku supports adding functions at runtime. To add a
-function, you'll need to specify a name and a lambda that accepts all function
-arguments and returns the result value.
+function, you'll need to specify a name, a return type, and a lambda that
+accepts all function arguments and returns the result value.
Here's an example of adding a function named `POW` that implements
exponentiation.
```ruby
> c = Dentaku::Calculator.new
-> c.add_function(:pow, ->(mantissa, exponent) { mantissa ** exponent })
+> c.add_function(:pow, :numeric, ->(mantissa, exponent) { mantissa ** exponent })
> c.evaluate('POW(3,2)')
#=> 9
> c.evaluate('POW(2,3)')
#=> 8
```
Here's an example of adding a variadic function:
```ruby
> c = Dentaku::Calculator.new
-> c.add_function(:max, ->(*args) { args.max })
+> c.add_function(:max, :numeric, ->(*args) { args.max })
> c.evaluate 'MAX(8,6,7,5,3,0,9)'
#=> 9
```
(However both of these are already built-in -- the `^` operator and the `MAX`