Qi Xiao
82b9bddb15
Test almost all commands correctly bubble output errors.
...
Also make the helper thatOutputErrorIsBubbled more precise by matching for the
exact error that is thrown.
2021-06-24 23:24:43 +01:00
Kurtis Rader
9a576529a3
Replace ErrArgs with more specific errors
...
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.
2021-06-13 22:42:04 +01:00
Qi Xiao
c39d03e973
Support all number types in the order command.
...
This fixes #1309 .
2021-05-31 21:25:08 +01:00
Qi Xiao
e2c4030728
pkg/eval: Handle non-positive step and overflow in the range builtin.
2021-04-06 22:33:02 +01:00
Qi Xiao
5c643181a4
Cleanup, docs and tests.
2021-04-05 20:48:22 +01:00
Qi Xiao
da67ba8a4a
Use machine word (int) instead of int64 for fixnum.
2021-04-04 13:37:38 +01:00
Qi Xiao
4612b58759
Support exact integer and rational numbers.
2021-04-04 00:58:53 +01:00
Qi Xiao
196eea21d4
Change module import path to src.elv.sh
2021-01-27 01:30:25 +00:00
Qi Xiao
50c971e5dd
pkg/eval: Split test functions.
2021-01-10 16:43:21 +00:00
Qi Xiao
90a99c1792
pkg/eval/evaltest: Consolidate all the Throws* methods into one.
2020-09-04 20:31:47 +01:00
Qi Xiao
bb122024dd
pkg/eval: Move test framework into new evaltest package.
2020-09-03 06:51:21 +01:00
Qi Xiao
dca782d573
pkg/eval: Document and test the ns builtin.
...
Also return a structured error with errs.BadValue.
2020-08-16 22:01:03 +01:00
Qi Xiao
bb24b63356
Remove builtin commands deprecated in v0.14.0.
2020-08-16 16:10:58 +01:00
Qi Xiao
270c7f230e
pkg/eval: Support passing any value to "fail".
2020-05-31 13:56:59 +01:00
Qi Xiao
ff292d43ce
pkg/eval: Make the sorting of "order" always stable.
2020-05-25 21:50:09 +01:00
Qi Xiao
1cd192daaf
pkg/eval: Implement "order".
...
This fixes #651 .
2020-05-25 17:45:08 +01:00
Qi Xiao
05156ea239
Add make-map command.
...
This fixes #943 .
2020-05-05 23:23:23 +01:00
Kurtis Rader
094a03ac5b
Normalize count
implementation arity exception
...
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
2020-04-16 15:56:20 +01:00
Qi Xiao
feadbc2330
Introduce a new "one" builtin.
2020-01-17 09:00:23 -05:00
Qi Xiao
8a8db45230
pkg/eval: Make all
take an optional argument.
...
Also make `all` no longer preserve byte inputs but turn them into values.
2020-01-17 08:45:34 -05:00
Qi Xiao
ca945dcb7f
pkg/eval: TestCase.Errors{With,} -> Throws{,Any}.
...
This is in preparation for supporting compilation errors. Also did some
cleanups.
2020-01-08 23:09:19 +00:00
Qi Xiao
e45fdf7228
Move all libraries to new pkg/.
2019-12-23 20:00:59 +00:00