#How do I obtain the name of a function and or variable/arg at comptime?

1 messages · Page 1 of 1 (latest)

stiff mica
#

Currently trying to learn more about zigs metaprogramming abilities and wanted to see if something like this is possible and to what extent.

sonic hull
#

for variables and arguments, it is not possible

#

for functions, it is possible to obtain it within the function itself via @src().fn_name

#

if you need the name of a variable or argument to accomplish something, you may be better served using a struct where you actually can get the names of fields