sway icon indicating copy to clipboard operation
sway copied to clipboard

Namespace separation in files similar to `mod` in Rust

Open Braqzen opened this issue 3 years ago • 0 comments

It would be nice to do

use interface::{abi::ConnectFour, events::{DrawEvent, MoveEvent, WinnerEvent}};

instead of

use interface::{ConnectFour, DrawEvent, MoveEvent, WinnerEvent};

and the file would look like

library interface;

// can't use abi because it's a keyword but this is an example
pub mod abi {
    pub abi ConnectFour {
         // Code
    }
}

pub mod events {
    pub struct DrawEvent { ... }
    pub struct MoveEvent { ... }
}

Braqzen avatar Sep 12 '22 12:09 Braqzen