Fix typo in README.

This commit is contained in:
Qi Xiao 2016-02-23 01:07:28 +01:00
parent 9c5f6ac9ab
commit 98f02a01b5
2 changed files with 8 additions and 1 deletions

View File

@ -52,7 +52,7 @@ Elvish mimics bash and zsh in a lot of places. The following shows some key diff
/opt/bin:/bin:/sbin:/usr/bin /opt/bin:/bin:/sbin:/usr/bin
``` ```
* You can manipulate the keybinding through the map `$le:binding`. For example, this binds Ctrl-L to clearing the terminal: `le:binding[insert][Ctrl-L]={ clear > /dev/tty }` The first indexed is the mode and the same is the key. (Yes, the braces enclose a lambda.) * You can manipulate the keybinding through the map `$le:binding`. For example, this binds Ctrl-L to clearing the terminal: `le:binding[insert][Ctrl-L]={ clear > /dev/tty }`. The first index is the mode and the second is the key. (Yes, the braces enclose a lambda.)
Use `put $le:binding` to get a nice (albeit long) view of the current keybinding. Use `put $le:binding` to get a nice (albeit long) view of the current keybinding.

View File

@ -8,6 +8,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"math"
"os" "os"
"reflect" "reflect"
"runtime" "runtime"
@ -80,6 +81,7 @@ func init() {
&BuiltinFn{"-", wrapFn(minus)}, &BuiltinFn{"-", wrapFn(minus)},
&BuiltinFn{"mul", wrapFn(times)}, &BuiltinFn{"mul", wrapFn(times)},
&BuiltinFn{"div", wrapFn(divide)}, &BuiltinFn{"div", wrapFn(divide)},
&BuiltinFn{"pow", wrapFn(pow)},
&BuiltinFn{"lt", wrapFn(lt)}, &BuiltinFn{"lt", wrapFn(lt)},
&BuiltinFn{"gt", wrapFn(gt)}, &BuiltinFn{"gt", wrapFn(gt)},
@ -492,6 +494,11 @@ func divide(ec *EvalCtx, prod float64, nums ...float64) {
out <- String(fmt.Sprintf("%g", prod)) out <- String(fmt.Sprintf("%g", prod))
} }
func pow(ec *EvalCtx, b, p float64) {
out := ec.ports[1].Chan
out <- String(fmt.Sprintf("%g", math.Pow(b, p)))
}
var ErrFalse = errors.New("false") var ErrFalse = errors.New("false")
func lt(ec *EvalCtx, nums ...float64) { func lt(ec *EvalCtx, nums ...float64) {