We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the following project structure
SlothCreator ├── .editorconfig ├── lib │ ├── Generators │ │ └── sloth_generator.onyx │ └── Sloth │ ├── activity.onyx │ ├── color.onyx │ ├── food.onyx │ ├── habitat.onyx │ ├── power.onyx │ ├── schedule.onyx │ └── sloth.onyx ├── onyx-pkg.kdl └── project.onyx
onyx-pkg.kdl
package { name "Sloth Creator" author "clsource" url "" description "A package for your Sloth needs" version "1.0.0" } config { dependency_source_path "./deps" dependency_binary_path "./bin" }
project.onyx
package main #load_all "lib/Sloth" #load_all "lib/Generators" use Sloth use Generators use core main :: () { habitat := Sloth.init_habitat(is_humid = true, is_warm = true) sloth := Generators.generate_sloth(habitat) sloth.energy_level = Sloth.sloth_eat(sloth, Sloth.DefaultFoodType.Large_Leaf) core.printf("sloth: {} | energy: {} | power: {} ¡ color: {}", sloth.name, sloth.energy_level, sloth.power, sloth.color) }
It would be awesome if we could have an import/require keyword that can simplify the code.
import/require
import
Will load the package from the path and use it.
use
import "lib/Sloth"
Would be the same as
#load_all "lib/Sloth" use Sloth
And an alias can be done like
import MySloth "lib/Sloth"
would be the same as
#load_all "lib/Sloth" use Sloth { MySloth :: package }
require
Will load the package from the path and use all the procedures.
require "lib/Sloth"
#load_all "lib/Sloth" use Sloth {package, * }
Maybe can also call a macro procedure like Elixir's __using__
__using__
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using the following project structure
onyx-pkg.kdl
project.onyx
It would be awesome if we could have an
import/require
keyword that can simplify the code.import
Will load the package from the path and
use
it.Would be the same as
And an alias can be done like
would be the same as
require
Will load the package from the path and use all the procedures.
require "lib/Sloth"
would be the same as
Maybe can also call a macro procedure like Elixir's
__using__
The text was updated successfully, but these errors were encountered: