Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not a function but when a module has a struct that you want to use inside the module you need to use the full module name or alias itself.


You can write __MODULE__ to reference the current module. Or if the current module is a struct you can write %__MODULE__{}


That's not very pretty though ;)

IIRC you can also write:

alias __MODULE__




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: