Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Erlang maps in 17.x #38

Open
zkessin opened this issue Aug 1, 2014 · 6 comments
Open

Support Erlang maps in 17.x #38

zkessin opened this issue Aug 1, 2014 · 6 comments

Comments

@zkessin
Copy link
Contributor

zkessin commented Aug 1, 2014

We should support maps as a data structure. SWI Prolog has a syntax for something similar (Dicts) http://www.swi-prolog.org/pldoc/man?section=dicts I think adapting it wholesale might be a good place to start, but lets talk about it

@rvirding

@rvirding
Copy link
Owner

Either that or not add special syntax but go through some procedures like map/3/4:

map(Key, Map, Value)
map(Key, Map, Value, NewMap)

Something like you suggested for records. I don't know but it needs considering as being able to handle maps would be useful (for example for JSON).

@zkessin
Copy link
Contributor Author

zkessin commented Aug 17, 2014

I think in the long term a more expressive syntax is probably better, but in the short run this might be a better way to at least get access to the data

@rvirding
Copy link
Owner

We are still going to need some syntax so we can print them, and in the long run enter them. Unfortunately we can't use a straight {key => val, key => val} as {...} is already taken.

@zkessin
Copy link
Contributor Author

zkessin commented Aug 17, 2014

how we mirror the erlang syntax #{...}

@zkessin
Copy link
Contributor Author

zkessin commented Aug 24, 2014

The other question is that if we add this, can we also continue to support pre 17 versions of Erlang?

@rvirding
Copy link
Owner

You can if you are a bit cunning and first check which version of erlang
you are using. Also depends on how much you want to use the map syntax vs
going through the maps module.

Did this in LFE.

Robert

From my Nexus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants