JuliaLang/julia — pull request #5572 by mauro3 (2014-01-27 15:20:48+00:00)
Title: WIP/RFC: metadata implemented, REPL-help ported, user-made doc now possible (issue #3988)

I added basic support to associate metadata with most objects using @stevengj's suggested global dict as backend. It is quite trivial but seems to work fine (except below issues). I use a function interface to the `META` dict so the backend could be changed. I ported the existing REPL-help system over into this system and it works as before (except for string-keys). User-made help is now possible, albeit without any convenience functions/macros implemented yet. I'll post a usage-demo to #3988, also have a look at test/metadata.jl.

There are a few issue left:
- how can macros be referred to, other than a string?
- should some functions take the metadata into account? Examples are:
- `copy`, `deepcopy`, `sizeof`
- some oddness with `ObjectIdDict` and strings:
- `a = 5; od[a] = -1; od[5]`
--> `-1` (works)
- `a = "st"; od[a] = -1; od["st"]`
--> `ERROR: key not found`
- I could use a separate dict for string-keys, but maybe there is a better way?