Skip to content
New issue

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

Add use statements #55

Open
hamzaremmal opened this issue Jan 15, 2023 · 0 comments · May be fixed by #92
Open

Add use statements #55

hamzaremmal opened this issue Jan 15, 2023 · 0 comments · May be fixed by #92
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@hamzaremmal
Copy link
Owner

hamzaremmal commented Jan 15, 2023

This statements can be seen as import statements in other programming languages.

  • To use a module in another module, we will need to add a use statement. To use Std.amy, we will need to add the following statement in our module definition
object Foo
    use Std
   // other definitions and/or expression
end Foo
  • To use a single definition from a given module, you will have to use the given syntax
object Foo
    use printString from Std
   // other definitions and/or expression
end Foo
  • To use a single definition from a given module with an alias, you will have to use the given syntax
object Foo
    use printString as print from Std
   // other definitions and/or expression
end Foo
@hamzaremmal hamzaremmal added enhancement New feature or request wontfix This will not be worked on labels Jan 15, 2023
@hamzaremmal hamzaremmal self-assigned this Jan 15, 2023
@hamzaremmal hamzaremmal linked a pull request Feb 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant