Open iffyio opened 4 years ago
It seems to me that it would be a good idea to store the map type into the original object, maybe not by changing native structure, which would require too much changes to JSweet (what you proposed with { x: { object info }, y: { actual map } }
), I would rather go for something like { original map, __special_key_for_extraInfos: {} }
:)
Also, it should only reside in the RemoveJavaDependencyAdapter.
Are you still willing to contribute to make JSweet a greater tool? :)
FYI, chances are we (maintainers) will be working more on this project in the near future
Hi!
Creating this issue as a result of the discussion here - about having knowledge of an expression's implementation type at least during methodInvocation substitution.
I bring it up since I think it's a requirement in order to generate any implementation specific code - e.g in the
TreeMap
example compared to aHashmap
. Maybe this isn't the case to begin with and there are other ways that involve a less invasive path?@lgrignon do you mean having something similar to this done for declared classes?
Would this require that e.g a map be transpiled to a an indirect JS object that nests the actual dictionary similar to m.entries? e.g
Map<String,..> m = new HashMap()
=>let m = { x: { object info }, y: { actual map } }
as opposed to currently which islet m = { actual map }
. One disadvantage with this approach is that it adds an extra layer of logic/memory for all operations on maps and this won't be necessary in almost all cases (SortedMaps are used a lot less frequently than HashMaps for example)Let me know what you think!