wu-lang / wu

🐉 A practical game and data language
https://wu-lang.gitbook.io/guide/
MIT License
472 stars 17 forks source link

[feature] Wildcard in imports #27

Open nilq opened 4 years ago

nilq commented 4 years ago

This is something we need to have. While it does have some downsides in introducing bad practice behavior, it's pretty useful.

Given lib.wu with the following content:

bob := "BUILDER"
important_number: float = 100.0

The following otherfile.wu ...

import lib { * }

Should automatically generate the following import code in otherfile.lua:

local lib = require('lib')
local bob = lib['bob']
local important_number = lib['important_number']