Is there any reason there shouldn't be a *(::Symbol, ::Symbol) method to do
this even more concisely, and without string intermediates?
On Tuesday, January 6, 2015 9:02:27 PM UTC-5, Mike Innes wrote:
>
> Cool. $(symbol("gen_$x")) might also be a bit more compact, now I think
> about it.
>
> On 7 January 2015 at 02:00, Chi-wei Wang <[email protected] <javascript:>>
> wrote:
>
>> Exactly what I want! Thanks!
>>
>> Mike Innes於 2015年1月7日星期三UTC+8上午9時34分21秒寫道:
>>>
>>> Is $(symbol(string("gen_", x))) what you're looking for?
>>>
>>> On 7 January 2015 at 01:28, Chi-wei Wang <[email protected]> wrote:
>>>
>>>> Hi, everyone.
>>>>
>>>> I'd like to do something like following C code in Julia.
>>>>
>>>> #define gen_func(x) \
>>>> void f_##x() { \
>>>> }
>>>>
>>>> I tried the following Julia code, but I have no idea how to get 'gen_'
>>>> appended in front of the function name.
>>>>
>>>> macro gen_func(x)
>>>> return esc(quote
>>>> function $x()
>>>> # do something
>>>> end
>>>> end)
>>>> end
>>>>
>>>>
>>>>
>>>>
>>>
>