#How to directly use functions from another zig file?

1 messages · Page 1 of 1 (latest)

flat gyro
#

For suppose i have function add in addition.zig and i have imported it in main.zig as
const a=@import.....
now if i need to call the add method i need to a.add but i dont want that i want directly add

frozen cape
#

You can use usingnamespace, but this will be removed.

GitHub

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. - Issues · ziglang/zig

#

you can also just do const add = a.add and then you can use add

flat gyro
#

why it will be removed ?

flat gyro
frozen cape
#

I am also not 100% certain that it will be remove, but zig aims to do it in the future