Commit Graph

11 Commits

Author SHA1 Message Date
Qi Xiao
3f4bbff9c5 pkg/eval: Add option for total order to the order and compare commands.
The same code will be used to sort map keys when printing maps.

This addresses #1495.
2023-05-18 23:21:18 +01:00
Qi Xiao
1e249ed7fb pkg/eval.cmp -> pkg/eval/vals.Cmp. 2023-05-18 10:31:31 +01:00
Qi Xiao
a3f4384495 Move all elvdocs into .d.elv files.
The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.

Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
2022-11-20 21:59:45 +00:00
Qi Xiao
08b7c91402 Fixup for #1616.
- Allow using &key and &less-than together.

- Simplify the implementation with a custom implementation of sort.Interface.
2022-11-20 21:48:23 +00:00
Kurtis Rader
306e2d7b8d
Issue 1570 order key option (#1616)
* Allow $nil for Callable options

Related #1570

* Add a `&key` option to the `order` command.

Resolves #1570

Co-authored-by: Qi Xiao <xiaq@users.noreply.github.com>
2022-11-20 19:10:19 +00:00
Qi Xiao
629cc9c85e Fix elvdoc for compact. 2022-08-29 11:08:19 +01:00
Qi Xiao
acf470f104 New "compact" command.
This fixes #1453.
2022-08-28 22:58:37 +01:00
Qi Xiao
f8f60953ad Properly deprecate float64.
- Replace its use with "num" in documentation and test code.

- Add a new "inexact-num" for explicitly converting a number to inexact.

This fixes #1513.
2022-04-09 11:45:15 +01:00
Qi Xiao
51e4d97568 interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
Qi Xiao
7da4b58f2f Revise doc for the builtin module.
- Revise the introduction section.

- Link to the notes on commands taking value inputs from all such commands.

- Revise the doc on the "all" command.

- Revise references to the builtin module from the language reference.
2021-12-28 12:01:35 +00:00
Qi Xiao
560bd17c17 pkg/eval: Break up builtin_fn_container.go.
- range -> builtin_fn_num.go

- all, one, take, drop, count, order -> new builtin_fn_stream.go

- repeat -> builtin_fn_io.go

- compare -> builtin_fn_pred.go
2021-12-26 12:22:14 +00:00