Skip to content

Commit

Permalink
Merge pull request #42 from SpinGo/master
Browse files Browse the repository at this point in the history
documentation fixes
  • Loading branch information
chrhicks committed Jun 23, 2014
2 parents 64ad230 + 2eeb999 commit 9cc5b7d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ Provide the implicit BindingFactory which uses your new binding. If you need an
+ `def asCollection: Iterable[Binding[T]]` - Returns List of bindings if isCollection; else empty List
+ `def asDictionaryCollection: Iterable[(String, Binding[T])]` - returns List of key-value tuples if isDictionary; else empty list

### `Unit` vs `null` vs `None` vs `VoidContext`
### `Unit` vs `null` vs `None` vs `VoidBinding`

In order to preserve the signal of "a value was defined in your model", vs., "you traversed outside the space covered by your model", bindings are monadic and capture whether they've a value from your model or not: a FullBinding if bound against a value from your model, a VoidBinding is you traversed outside the space of your model.
In order to preserve the signal of "a value was defined in your model", vs., "you traversed outside the space covered by your model", bindings are monadic and capture whether they've a value from your model or not: a `FullBinding` if bound against a value from your model, a `VoidBinding` is you traversed outside the space of your model.

### isDefined vs VoidContext
If the model contained a `null`, `Unit`, or `None`

isDefined is true if the bound value is within the space of the model, and it evaluates to some value other than null, Unit, or None. VoidContext is, naturally, never defined, and always returns isDefined as false.
`isDefined` is `true` if the bound value is within the space of the model, and it evaluates to some value other than . `VoidBinding` is, naturally, never defined, and always returns `isDefined` as `false`.

### Pattern matching value extraction

You can extract the bound value by matching FullBinding, like so:
You can extract the bound value by matching `FullBinding`, like so:

```scala
DynamicBinding(1) match {
Expand Down

0 comments on commit 9cc5b7d

Please sign in to comment.