Commit Graph

39 Commits

Author SHA1 Message Date
Qi Xiao
7d793e698b eval/vals: StructMap, an easy way to use Go structs as Elvish values.
Also add a lot of unit tests.
2019-04-19 17:41:07 +01:00
Qi Xiao
c8e767b2fd eval: Fix lint errors. 2019-04-18 22:15:34 +01:00
Qi Xiao
6a0267a6b6 eval/vars: Always guard variable access with mutexes. 2018-11-18 15:13:50 +01:00
Qi Xiao
187980ebbf Migrate all users of RawOptions.Scan to declaring options as parameter. 2018-09-27 18:08:35 +01:00
Qi Xiao
cf5ac2c660 Fix keys and has-keys for struct types.
This fixes #757.
2018-09-24 22:20:50 +01:00
fehnomenal
5579b82515 Expand has-key functionality (#635)
Fixes #631
2018-03-14 22:46:55 +00:00
Qi Xiao
b387d5afcb Make key iteration generic. 2018-03-01 11:59:50 -05:00
Qi Xiao
7969c6650f eval: Remove more throws.
This addresses #570.
2018-03-01 10:13:00 -05:00
Qi Xiao
802f5ab31e eval: ec *Frame -> fm *Frame
This batch rename was done with an Elvish script:
https://gist.github.com/xiaq/d8601c822c814f8bd8819a2ae96d2b7b
2018-02-28 21:17:56 -05:00
Qi Xiao
0511841707 edit: Clean option scanning code, and add test. 2018-02-15 13:25:17 +00:00
Qi Xiao
011408d541 eval: Remove ScanOpt.
Options are now always scanned into structs.
2018-02-15 12:57:22 +00:00
Qi Xiao
f3501bbeba eval/types -> eval/vals. 2018-02-15 09:14:05 +00:00
Qi Xiao
394a3431cc eval: Move conversion.go to eval/types. 2018-02-15 09:09:12 +00:00
Qi Xiao
0223970d73 eval/vartypes -> eval/vars. 2018-02-15 08:59:49 +00:00
Qi Xiao
78bd1beadc eval: Rehaul helper methods of Ns. 2018-02-06 11:39:40 -08:00
Qi Xiao
b7c853151f eval: ReflectBuiltinFn -> BuiltinFn. 2018-02-06 00:02:27 -08:00
Qi Xiao
34d6626740 eval/vartypes: Slight reorganization. 2018-02-05 21:52:23 -08:00
Qi Xiao
708d9bea64 eval: Use ReflectBuiltinIn more. 2018-02-04 23:35:49 -08:00
Qi Xiao
2e6c2044e2 eval: Reorganizing conversion functions. 2018-02-04 22:49:03 -08:00
Qi Xiao
41762977cb eval: Convert more builtins to use ReflectBuiltinFn. 2018-02-03 21:51:20 -08:00
Qi Xiao
cc861528de eval: The "ns" builtin now takes a map argument. 2018-02-02 22:10:10 -08:00
Qi Xiao
596816f8cf eval/types: Remove the Value type.
Just use the good old interface{} type...
2018-01-29 17:39:41 +00:00
Qi Xiao
009f10dd0c Remove the Map type; just use hashmap.Map.
This fixes #573.
2018-01-29 14:38:25 +00:00
Qi Xiao
1fd2ff3d92 eval/types: Remove the List type.
Vector from github.com/xiaq/persistent/vector can now be used as an
Elvish value. This addresses #573.
2018-01-27 17:26:22 +00:00
Qi Xiao
99921ea222 Get rid of types.String.
Elvish strings are now simply Go strings. \o/ This addresses #573.
2018-01-25 22:50:42 +00:00
Qi Xiao
bcf46bde5e eval/types: Add functional interface Iterate.
This addresses #573.
2018-01-25 22:50:42 +00:00
Qi Xiao
333fd69386 eval/types: Provide function interfaces Len, Assoc and Index.
This addresses #573.
2018-01-25 22:50:41 +00:00
Qi Xiao
68bc4d925d Make Value an empty interface.
This addresses #573. The implementations of Value are not yet changed.
2018-01-25 22:50:41 +00:00
Qi Xiao
46c986f385 Change definition of Assocer to return an error.
This addresses #570.
2018-01-20 23:47:53 +00:00
Qi Xiao
f0e66e1f1f Change IndexOne interface to return an error.
This addresses #570.
2018-01-20 21:20:30 +00:00
Qi Xiao
8c1f9d9c27 eval: Move String to eval/types. 2018-01-02 01:34:09 +00:00
Qi Xiao
3efc92b00c eval: Move Bool to eval/types. 2018-01-01 15:21:15 +00:00
Qi Xiao
ebb12b7eb8 eval: Move Map to eval/types. 2017-12-31 21:08:37 +00:00
Qi Xiao
00d126b0e1 eval: Move List to eval/types. 2017-12-31 21:01:21 +00:00
Qi Xiao
29b13a917c eval: Move Value interfaces to eval/types. 2017-12-31 20:31:45 +00:00
Qi Xiao
d43bfcc984 eval: EvalCtx -> Frame. 2017-12-27 19:59:42 +00:00
Qi Xiao
86534000d8 Merge module imports into the main namespace.
A module called x is now the same as a variable called $x:, much like
how a function called f is the same as a variable called $f~.

Such module variables are not accessible yet though, due to limitations
of the current variable name resolution rules. However, those will be
fixed later.
2017-12-23 23:51:32 +00:00
Qi Xiao
ca8307f414 Deadcode removal. 2017-12-18 01:46:06 +00:00
Qi Xiao
cbe45b815d Break builtin_fn.go into many files. 2017-12-17 05:21:41 +00:00