On Tue, Aug 18, 2015 at 6:49 AM, Sisyphuss <[email protected]> wrote:
> I'm reading the documentation Metaprogramming chapter.
> To me, the `$` operator is different from the one in the string
> interpolation.
> In the string, `$` is a runtime interpolation.
> In the expression, `$` is a compile-time interpolation.

No. Both of them happens at whenever the expression is evaluated. It
happens for `@eval` at "compile time" because that's when the macro
expansion happens.

>
> In one example provided, `ex = :(a in $:((1,2,3)) )`,
> I find that it's equal to `ex = :(a in (1,2,3) )`.
> So I do not see the intention of `$`.

The examples are meant to show you the basic rules not necessarily the
best/only way to do it.

>
> In the next example, there is `:a + :b` in the expression,
> but the sum of `Symbols` is not defined. Is it wrong?

It just construct an expression and to show you that the result is
quoted symbol rather than the symbol themselves.

Reply via email to