Elixir-Recipes.github.io | Elixir programming language solutions | Functional Programming library
kandi X-RAY | Elixir-Recipes.github.io Summary
kandi X-RAY | Elixir-Recipes.github.io Summary
:bento: A collection of Elixir programming language solutions to common problems.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Elixir-Recipes.github.io
Elixir-Recipes.github.io Key Features
Elixir-Recipes.github.io Examples and Code Snippets
Community Discussions
Trending Discussions on Elixir-Recipes.github.io
QUESTION
Following this example:
...ANSWER
Answered 2018-May-16 at 13:24Well, this is possible. The issue with your code is that you mix the scopes. Macros in Elixir are being expanded during the compilation stage. There is no compiled say_greetings/1
function at this very moment (besides that one cannot invoke defp
from inside defmacro
, but this might be overcame with a proper quoting.)
What you need for this to work, would be to declare say_greetings/1
in the same scope as __before_compile__/1
to make is available for it. You cannot define it as a function (see above,) but the workaround would be to define it as a macro as well. That way it will be expanded during a compilation and everything will work (also, I doubt I understand what is the reason for that.)
The summing up:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Elixir-Recipes.github.io
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page