# What the argument type is when invoke a macro with a bare literal form args get passed?

**URL:** <https://forum.crystal-lang.org/t/what-the-argument-type-is-when-invoke-a-macro-with-a-bare-literal-form-args-get-passed/4838>\
**Category:** Help & Support\
**Created:** [August 8, 2022, 4:42am UTC](https://forum.crystal-lang.org/t/what-the-argument-type-is-when-invoke-a-macro-with-a-bare-literal-form-args-get-passed/4838 "2022-08-08T04:42:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [August 8, 2022, 4:42am UTC](https://forum.crystal-lang.org/t/what-the-argument-type-is-when-invoke-a-macro-with-a-bare-literal-form-args-get-passed/4838/1 "2022-08-08T04:42:39Z")

</div>

Following is a example, i want to know what the type of `name` is when run the macro `getter`.

```auto
macro getter(name)
  p! {{name.class_name}}
end

getter unicorns # => "Call"
getter :unicorns # => "SymbolLiteral"
getter "unicorns" # => "StringLiteral"

```

Following is my questions about `getter unicorns`.

when `unicorns` is passed to getter macro as a `literal form`(i don’t know how to call it), what this `unicorns` is? why class\_name return `Call`, what is this `Call` stand for? is a `Crystal::Macros::Call` ? why we call that name?

thank you.

---

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [August 8, 2022, 5:09am UTC](https://forum.crystal-lang.org/t/what-the-argument-type-is-when-invoke-a-macro-with-a-bare-literal-form-args-get-passed/4838/2 "2022-08-08T05:09:55Z")

</div>

I guess i know the reason.(probably wrong anyway)

```crystal
macro getter(name)
  p! {{name}}
end

getter unicorns

```

will result in:

```auto
In 1.cr:5:8

 5 | getter unicorns
            ^-------
Error: undefined local variable or method 'unicorns' for top-level

```

unlike a method invoke, when a macro is invoking, the arguments for the macro not be context syntactic analysis until the macro is expanded, `name` replaced by `unicorns`, then because `unicorns` method not exists there, so, fallback to report `unicorns` method not exists on line 5.

But, if change to this, no error happen.

```crystal
macro getter(name)
  p! "{{name}}"
  {% debug %}
end

getter unicorns

```

because `"unicorns"` is a valid crystal syntax unit, so, no error.

Maybe my describe not correct anyway, please add new answer for clarify.

Thank you.

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [August 8, 2022, 9:43am UTC](https://forum.crystal-lang.org/t/what-the-argument-type-is-when-invoke-a-macro-with-a-bare-literal-form-args-get-passed/4838/3 "2022-08-08T09:43:53Z")

</div>

Your description is correct. The parser reads `getter unicorn` as two calls - with parenthesis that’s more visible: `getter(unicorn())`.
