elvish/pkg/eval
Qi Xiao 96752afa4d Make struct maps indistinguishable from maps to Elvish code.
Struct map is a mechanism to let Go code expose simple structs to Elvish code.
The difference between struct maps and maps is convenience for Go code; they
also have different performance characteristics, but since struct maps are
always quite small, the difference is not meaningful for Elvish's use cases.

As a result, there is no good reason that Elvish code needs to be aware of the
difference between struct maps and normal maps. Making them indistinguishable to
Elvish code simplifies the language.

This commit does the following:

- Change Equal, Hash, Kind and Repr to treat struct maps like maps.

- Change Assoc and Dissoc to "promote" struct maps to maps.

- Remove the custom Repr method of parse.Source.

- Update documentation to reflect this change.
2023-07-14 23:57:38 +01:00
..
errs pkg/eval/errs: Fix misleading message in OutOfRange.Error. 2022-11-20 15:11:57 +00:00
evaltest pkg/eval: Make the peach test cases print $best-run on failure. 2023-05-08 23:34:04 +01:00
testdata/fuzz/FuzzCheck pkg/eval: Don't use panics for propagating compilation errors. 2022-11-29 21:17:13 +00:00
vals Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
vars Standardize spelling: UNIX -> Unix. 2023-01-04 18:09:11 +00:00
benchmarks_test.go pkg/eval: When compiling, emit autofixes for using unimported builtin modules. 2022-12-11 14:21:09 +00:00
builtin_fn_cmd_test.go pkg/eval: Test the exit command by faking os.Exit. 2022-06-23 20:25:01 +01:00
builtin_fn_cmd_unix_test.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
builtin_fn_cmd_unix.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
builtin_fn_cmd_windows.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_cmd.d.elv website/cmd/md2html: Support implicit link targets to elvdoc sections. 2023-01-02 02:36:58 +00:00
builtin_fn_cmd.go Move all elvdocs into .d.elv files. 2022-11-20 21:59:45 +00:00
builtin_fn_container_test.go pkg/eval: Fix the equality test in "has-value". 2023-05-19 17:25:36 +01:00
builtin_fn_container.d.elv Various has-key fixes (#1647) 2023-02-26 20:49:31 +00:00
builtin_fn_container.go pkg/eval: Fix the equality test in "has-value". 2023-05-19 17:25:36 +01:00
builtin_fn_debug.d.elv Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
builtin_fn_debug.go Move all elvdocs into .d.elv files. 2022-11-20 21:59:45 +00:00
builtin_fn_env_test.go Remove most uses of the legacy assignment syntax. 2022-01-03 00:47:41 +00:00
builtin_fn_env.d.elv website/cmd/md2html: Support implicit link targets to elvdoc sections. 2023-01-02 02:36:58 +00:00
builtin_fn_env.go Move all elvdocs into .d.elv files. 2022-11-20 21:59:45 +00:00
builtin_fn_flow_test.go pkg/eval: Bump the sleep time in the test for peach more. 2023-05-20 11:55:31 +01:00
builtin_fn_flow.d.elv Fixup for #1691. 2023-05-06 23:55:34 +01:00
builtin_fn_flow.go pkg/eval: Use a Context inside Frame to pass interrupts. 2023-05-07 21:44:28 +01:00
builtin_fn_fs_test.go Move pkg/testutil/must.go to a new pkg/must. 2022-06-20 20:29:14 +01:00
builtin_fn_fs.d.elv website/cmd/md2html: Support implicit link targets to elvdoc sections. 2023-01-02 02:36:58 +00:00
builtin_fn_fs.go Move all elvdocs into .d.elv files. 2022-11-20 21:59:45 +00:00
builtin_fn_io_test.go pkg/eval: Use json.Number in from-json. 2023-05-22 07:35:17 +01:00
builtin_fn_io.d.elv pkg/eval: Use json.Number in from-json. 2023-05-22 07:35:17 +01:00
builtin_fn_io.go pkg/eval: Use json.Number in from-json. 2023-05-22 07:35:17 +01:00
builtin_fn_misc_test.go Generalize parse.Errors and move it to diag. 2022-11-30 01:05:16 +00:00
builtin_fn_misc.d.elv Remove superfluous content from example for the deprecate builtin. 2023-01-13 00:21:33 +00:00
builtin_fn_misc.go pkg/eval: Remove leftover registration of time commands. 2022-11-26 15:22:18 +00:00
builtin_fn_num_test.go pkg/eval/evaltests: Make APIs of special matchers functions. 2023-05-08 23:27:53 +01:00
builtin_fn_num.d.elv website/cmd/md2html: Support implicit link targets to elvdoc sections. 2023-01-02 02:36:58 +00:00
builtin_fn_num.go Move all elvdocs into .d.elv files. 2022-11-20 21:59:45 +00:00
builtin_fn_pred_test.go pkg/eval: Add option for total order to the order and compare commands. 2023-05-18 23:21:18 +01:00
builtin_fn_pred.d.elv pkg/eval: Add option for total order to the order and compare commands. 2023-05-18 23:21:18 +01:00
builtin_fn_pred.go pkg/eval: Add option for total order to the order and compare commands. 2023-05-18 23:21:18 +01:00
builtin_fn_str_test.go Replace AnyError in tests with a specific error 2021-12-13 01:08:24 +00:00
builtin_fn_str.d.elv Parse comment blocks preceding var and fn declarations as doc comments. 2022-11-22 22:59:31 +00:00
builtin_fn_str.go Move all elvdocs into .d.elv files. 2022-11-20 21:59:45 +00:00
builtin_fn_stream_test.go pkg/eval: Add tests for "order &total". 2023-05-19 17:27:37 +01:00
builtin_fn_stream.d.elv pkg/eval: Add option for total order to the order and compare commands. 2023-05-18 23:21:18 +01:00
builtin_fn_stream.go pkg/eval: Add option for total order to the order and compare commands. 2023-05-18 23:21:18 +01:00
builtin_fn_styled_test.go Bump prog.DeprecationLevel to 19. 2023-02-27 00:00:12 +00:00
builtin_fn_styled.d.elv website/cmd/md2html: Support implicit link targets to elvdoc sections. 2023-01-02 02:36:58 +00:00
builtin_fn_styled.go pkg/eval: Construct ui.Text using the functions from the ui package. 2023-03-14 21:47:38 +00:00
builtin_fn_time_test.go pkg/eval: Move time-related builtins to separate file. 2022-11-26 10:41:58 +00:00
builtin_fn_time_unix_test.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
builtin_fn_time.d.elv website/cmd/md2html: Support implicit link targets to elvdoc sections. 2023-01-02 02:36:58 +00:00
builtin_fn_time.go pkg/eval: Don't use the new context.Cause API. 2023-05-07 22:37:08 +01:00
builtin_ns_test.go Fix use of the builtin module via explicit "builtin". 2021-10-28 22:28:13 +01:00
builtin_ns.d.elv Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
builtin_ns.go Add a doc: module for accessing documentation of Elvish modules. 2022-12-26 21:36:07 +00:00
builtin_special_test.go Remove support for the "except" keyword. 2023-02-26 23:55:48 +00:00
builtin_special.go Remove support for the "except" keyword. 2023-02-26 23:55:48 +00:00
callable.go pkg/eval/vals: Avoid the .Name hack for allowing using $nil for callable. 2022-11-20 19:31:07 +00:00
chdir_test.go Move pkg/testutil/must.go to a new pkg/must. 2022-06-20 20:29:14 +01:00
closure_test.go Remove most uses of the legacy assignment syntax. 2022-01-03 00:47:41 +00:00
closure.go pkg/eval/vals: Replace MakeListFromStrings with a generic MakeListSlice. 2022-06-17 16:50:38 +01:00
compile_effect_test.go Standardize spelling: UNIX -> Unix. 2023-01-04 18:09:11 +00:00
compile_effect_unix_test.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
compile_effect.go pkg/eval: Don't use the new context.Cause API. 2023-05-07 22:37:08 +01:00
compile_lvalue.go pkg/eval: When compiling, emit autofixes for using unimported builtin modules. 2022-12-11 14:21:09 +00:00
compile_value_test.go Fixup for #1618. 2022-11-20 16:39:01 +00:00
compile_value.go pkg/eval: Use a Context inside Frame to pass interrupts. 2023-05-07 21:44:28 +01:00
compiler_test.go pkg/eval: When compiling, emit autofixes for using unimported builtin modules. 2022-12-11 14:21:09 +00:00
compiler.go pkg/eval: When compiling, emit autofixes for using unimported builtin modules. 2022-12-11 14:21:09 +00:00
deprecation.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
eval_test.go pkg/eval: When compiling, emit autofixes for using unimported builtin modules. 2022-12-11 14:21:09 +00:00
eval.d.elv website/cmd/md2html: Support implicit link targets to elvdoc sections. 2023-01-02 02:36:58 +00:00
eval.go pkg/eval: Use a Context inside Frame to pass interrupts. 2023-05-07 21:44:28 +01:00
exception_test.go Expose stack traces in exceptions as opaque values. 2023-02-26 23:52:26 +00:00
exception_unix_test.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
exception.go Expose stack traces in exceptions as opaque values. 2023-02-26 23:52:26 +00:00
external_cmd_test.go evaltest: Check that stderr is empty if PrintsStderrWith is not called. 2022-03-20 09:50:05 +00:00
external_cmd_unix_internal_test.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
external_cmd_unix_test.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
external_cmd_unix.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
external_cmd_windows_test.go pkg/eval: Support slashes in relative command paths on Windows. 2023-02-27 22:57:02 +00:00
external_cmd_windows.go Detect and suppress SIGPIPE caused by the next command in a pipeline exiting early. 2021-05-20 00:10:17 +01:00
external_cmd.go pkg/eval: Support slashes in relative command paths on Windows. 2023-02-27 22:57:02 +00:00
frame.go pkg/eval: Don't use the new context.Cause API. 2023-05-07 22:37:08 +01:00
fuzz_test.go Remove go1.18 build tags as 1.18 is required. 2022-08-08 12:29:33 +01:00
generic_utils.go pkg/eval: When compiling, emit autofixes for using unimported builtin modules. 2022-12-11 14:21:09 +00:00
glob_test.go Move pkg/testutil/must.go to a new pkg/must. 2022-06-20 20:29:14 +01:00
glob.go pkg/eval: Don't use the new context.Cause API. 2023-05-07 22:37:08 +01:00
go_fn_internal_test.go pkg/eval: Convert elements of slice return value from a GoFn to individual outputs. 2021-10-03 16:34:52 +01:00
go_fn_test.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
go_fn.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
interrupts.go pkg/eval: Don't use the new context.Cause API. 2023-05-07 22:37:08 +01:00
node_utils.go pkg/eval: Refactor index tracking out of argsWalker. 2022-11-29 21:17:07 +00:00
ns_test.go Make testing compilation errors more deterministic 2022-11-20 16:33:29 +00:00
ns.go eval: Fix godocs with wrong function name 2022-12-28 12:27:17 +00:00
options_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
options.go Remove use of "e.g.," and "i.e.,". 2022-11-20 15:44:29 +00:00
plugin_gccgo.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
plugin.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
port_helper_test.go Remove most uses of the ioutil package. 2021-08-23 00:36:26 +01:00
port_unix.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
port_windows.go pkg/eval: Fix EPIPE on Windows. 2021-06-18 00:45:25 +01:00
port.go evaltest.capturePort -> eval.CapturePort. 2023-01-15 16:44:25 +00:00
process_unix.go Use the unix build tag. 2023-03-03 00:01:26 +00:00
process_windows.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
purely_eval_test.go Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
purely_eval.go pkg/eval: Add tests for errors in tilde expansion. 2022-06-19 23:34:36 +01:00
pwd_test.go Move pkg/testutil/must.go to a new pkg/must. 2022-06-20 20:29:14 +01:00
pwd.go Use consistent pattern for mutating variables in tests. 2022-06-19 23:56:18 +01:00
testexport_test.go pkg/eval: Move time-related builtins to separate file. 2022-11-26 10:41:58 +00:00
value_test.go Fixup for #1531. 2022-06-11 21:26:32 +01:00
var_parse_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
var_parse.go A couple of TODO cleanups 2021-05-30 00:40:42 +01:00
var_ref.go Remove support for the "local:", "up:" and ":" special namespaces. 2022-01-03 00:47:41 +00:00