Previously Go's == was used to test for equality when the container is not a
map, which is more strict when Elvish's normal equality test. For example,
"has-value [[foo]] [foo]" used to output false, rather than the expected true.
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.
- 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.
* docs(effective-elvish): follow same style as other docs
e.g., https://elv.sh/ref/language.html
* docs(builtin): ref from take to drop
* docs(language): remove mention of :up and :down ns
* docs(fundamentals): update to new lambda format
* docs(tour): update to new lambda syntax
* docs(builtin): update to new lambda syntax
* docs(language): update to new lambda syntax
* docs(unique-semantics): update to new lambda syntax
* docs(tour): fix typo
* Revert "docs(effective-elvish): follow same style as other docs"
This reverts commit db4306a400c61f5f7b6acec7a1e1f39feb9b1ba0.
https://github.com/elves/elvish/pull/1457#discussion_r775102178
The `AnyError` placeholder error can cause tests to succeed for errors
other than what was expected. That is, the use of `AnyError` can mask
bugs in a unit test. So replace it with the specific error, or error type,
the test expects to be raised.
This does not remove the anyError structure because it is used in
the TestCase.DoesNotCompile() method. To keep the size of this change
as small as possible I want to defer updating that use to a separate
change. However, remove the public AnyError var so future test writers
don't attempt to use it.
* Fix the case when start is near the overflow point and add regression tests.
* Rewrite the implementation in a less abstract way.
* Rewrite the elvdoc.
I was surprised to see so many legacy lambda syntax examples in the
documentation. This replaces all of them with the new syntax -- excluding
the handful of cases meant to explicitly verify the legacy form is still
valid. This also adds a link to the issue in the release notes which
documents the change in syntax.
Related #664
Expose the default comparison function used by the `builtin:order`
command as a command in its own right. This command is useful when
writing, in Elvish, something like `builtin:order`. Such as a semantic
version comparison command.
Resolves#1347
Also replace (*Frame).OutputChan with (*Frame).ValueOutput, which returns a
small interface for writing to the value output that is also aware when the
reader is gone.
This also replaces the slightly awkward "arguments here" reason with
"argument count" as the "what" for a typical errs.ArityMismatch
exception. It also reformats most of the constructors so that the "what"
is on the same line. This makes `grep errs.ArityMismatch **.go` more
useful as a result.
Add some comments that clarify why the `count` implmentation does not
use the `Inputs` API. Change the mismatched arg count exception to match
that of the `Inputs` API. Add a couple more unit tests.
Resolves#966