elvish/pkg/eval/vals
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
..
aliased_types_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
aliased_types.go pkg/eval/vals: Replace MakeListFromStrings with a generic MakeListSlice. 2022-06-17 16:50:38 +01:00
assoc_test.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
assoc.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
bool_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
bool.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
cmp_test.go pkg/eval.cmp -> pkg/eval/vals.Cmp. 2023-05-18 10:31:31 +01:00
cmp.go pkg/eval/vals: Correct the godoc of Cmp. 2023-05-20 10:20:48 +01:00
concat_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
concat.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
conversion_test.go pkg/eval/vals: Avoid the .Name hack for allowing using $nil for callable. 2022-11-20 19:31:07 +00:00
conversion.go pkg/eval/vals: Avoid the .Name hack for allowing using $nil for callable. 2022-11-20 19:31:07 +00:00
dissoc_test.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
dissoc.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
doc.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
equal_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
equal.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
errors_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
feed_test.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
feed.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
has_key_test.go Various has-key fixes (#1647) 2023-02-26 20:49:31 +00:00
has_key.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
hash_test.go Fix the hash code of maps. 2023-07-14 22:01:32 +01:00
hash.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
index_list.go Various has-key fixes (#1647) 2023-02-26 20:49:31 +00:00
index_string.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
index_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
index.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
iterate_keys_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
iterate_keys.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
iterate_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
iterate.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
kind_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
kind.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
len_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
len.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
num_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
num.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
pipe_test.go Move pkg/testutil/must.go to a new pkg/must. 2022-06-20 20:29:14 +01:00
pipe.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
reflect_wrappers.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
repr_helpers.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
repr_test.go pkg/eval/vals: Make Repr sort map keys before printing. 2023-05-20 10:52:52 +01:00
repr.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
string_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
string.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
struct_map_test.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
struct_map.go Make struct maps indistinguishable from maps to Elvish code. 2023-07-14 23:57:38 +01:00
tester.go Get coverage on IsStructMap methods with a hack. 2022-06-20 22:08:19 +01:00
testutils_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00