Comments (6)
from luban.
理想是应该这种map的格式。当然这里还可以优化,value的引用
from luban.
这是已知问题,很多语言并没有内置的多key索引的支持,因此由开发者自己选择合适的实现。写一个make_index2函数就能较好达到效果。
from luban.
那是需要自己修改代码生成的源码咯?如果是这样那我自己定制一个生成器吧。
from luban.
我觉得没必要改源码。 你实现一个make_index函数将列表转换为你想要的索引方式即可 ,代码类似这样
function make_index(t, key1, key2)
local nt = {}
for _, v in ipairs(t) do
nt[v[key1]] = v
nt[v[key2]] = v
end
return nt
end
from luban.
了解,谢谢!
from luban.
Related Issues (20)
- 对于Unity中导出JsonC#类,如果需要code_target支持newtonsoft-json或者JsonUtility对应的数据模型,请问有扩展的可能吗? HOT 2
- JavaDeclaringTypeNameVisitor.Accept(TEnum type)实现错了 HOT 3
- 空列表读取错误 HOT 1
- 没有设置导出的组也会检查ref, 导致报错:ref 引用的表 xxx 没有导出 HOT 3
- 是否能考虑添加typescript_bin的支持 HOT 2
- type=int?! 校验器无效果 HOT 2
- 能否为生成类型添加克隆函数 HOT 1
- 输出的json文件,可以不要格式化吗? HOT 5
- 导出表数据时如何额外生成一个存储常量值的C#类 HOT 1
- 2.6.2 go generate failed error HOT 1
- 嵌套容器类型的 ref 校验失效 HOT 1
- go-json无法导出嵌套容器 HOT 1
- 表格中的TIME函数不支持datetime类型解析吗? HOT 1
- java怎么生成到指定包名下 HOT 3
- rust bitflags error. HOT 2
- codeTarget为go-json时不支持嵌套容器 HOT 2
- 有没有办法让Bean类型用一个特殊占位符作为默认值 HOT 2
- next版本在解析纵表时,表中有空行会导致复杂结构类型数据解析报错 HOT 1
- 在 jenkins 上使用时 path 会包含 .jenkins,会触发 IsIgnoreFile 的规则 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luban.