How to return literals with macros?

Hi…
Ok so @zzq might be right in my wrong usage of the word “literal” since you also thought about “value” literals…

But this is not the case… It’s not even about affectation (or binding).

And just a quick note to @kip and @NobbZ I put an example of what I want to do in that discussion, ie. extracting a call to gettext (among other function calls) combined with the && operator within a simplified call like this:

# Here I'm using the letter l as the name of the macro as a shorthand for live..
l(gettext "Hello World")
# I wanted to be converted into:
@x && (gettext "Hello World")

The reason I’m talking about literal so far is that I want to handle the argument of the function (in this case gettext "Hello World" as well as the @x as is and reproduce them in the same context.

Also I could simply do that:

def l(x, text) do
  x && gettext(text)
end

and use it like so:

l(x, "Hello World")

However gettext doesn’t allow dynamic translation.
So I must leave it with the literals (and I think that here it’s the correct usage of the word :slight_smile:

I hope that does make sense…