Commit Graph

18 Commits

Author SHA1 Message Date
Manuel Mendez
b178367ca7 eval: Fix godocs with wrong function name 2022-12-28 12:27:17 +00:00
Manuel Mendez
1ada9a5e22 ns: Add Ns.clone method
Does what it says on the tin.
2022-12-28 12:27:17 +00:00
Qi Xiao
51e4d97568 interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
Qi Xiao
d71e52cbd7 Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
Qi Xiao
b570b2f0b5 pkg/eval: Clean up the Ns type a bit. 2021-10-23 18:18:31 +01:00
Qi Xiao
b12c29fb53 pkg/eval: Remove unnecessary methods of *Ns and *staticNs. 2021-10-16 12:50:45 +01:00
Qi Xiao
6a92571a23 Check assignments to read-only variable during compilation. 2021-10-13 23:57:14 +01:00
Qi Xiao
91b6f6dd72 Use the integrated persistent package. 2021-05-03 22:17:46 +01:00
Kurtis Rader
12980c2719 Some golint cleanups 2021-04-05 15:31:53 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Qi Xiao
56ceeedd21 pkg/eval: Store variable deletion information in *Ns.
This fixes #1213.
2021-01-10 00:54:02 +00:00
Qi Xiao
066b48cfd2 Make all builtin functions and subnamespaces read-only.
This fixes #1211.
2021-01-09 00:41:42 +00:00
Qi Xiao
9af4c83bf6 pkg/eval: Minor cleanups. 2021-01-05 16:05:34 +00:00
Qi Xiao
af0c22c47a Move pkg/eval/resolve.go to pkg/edit, and add more introspection methods on *Ns. 2021-01-05 15:43:26 +00:00
Qi Xiao
75baa0b5a2 pkg/eval: Remove (*Ns).Append.
This change makes Ns immutable from the exposed API. Internally there is exactly
one place that still mutates Ns, in scopeOp; this will be addressed later.
2021-01-05 01:09:04 +00:00
Qi Xiao
6419f4524a Implement namespaces using slices instead of maps.
More related improvements and cleanups will be done in followup commits.

This fixes #1139.
2020-12-25 17:46:46 +00:00
Kurtis Rader
d802ed3a70 Replace NewNs() with Ns{} to improve consistency
There are just a handful of NewNs() uses and more than twenty Ns{} uses.
NewNS() doesn't, and probably never will, do anything that can't done by
the Ns{} syntax so we can simplify the code and improve consistency by
removing it.
2020-04-05 14:49:59 +01:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00