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

Better import syntax #26

Open
foxfriends opened this issue Dec 25, 2023 · 0 comments
Open

Better import syntax #26

foxfriends opened this issue Dec 25, 2023 · 0 comments

Comments

@foxfriends
Copy link
Owner

Would be nice to make imports easier, right now it's very verbose. Can un-conflate the module syntax with the import syntax

  1. Steal JS homework

    import ... from ""
    
  2. Change it a bit

    import "" as X use Y, Z as V
    

Can parameters be applied in the use statement? import "trilogy:str" use joined " " as spaced

Changing the use part to be somehow pattern-matching based will probably be better... more cohesive, considering that arbitrary expressions may be modules and to be able to match out of them would be nice

const a, b, c from import "trilogy:str"

proc main!() {
  let x, y, z from import "./hello.tri"
  let j, k from x param
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant