// Demonstrate module aliases - simpler import syntax
// 🎯 80/20 Philosophy: Simplify what matters most (imports)
// Rust's verbose syntax:
// use std::collections::HashMap;
// use std::collections::HashSet;
// use std::collections::BTreeMap;
//
// Windjammer's cleaner syntax:
// use std::collections as col
//
// ✅ Use . instead of ::
// ✅ One import for the whole module
// ✅ Clear and concise
// For this example, we'll use direct imports (no alias)
// to keep it simple while the :: expression parser is being added
use std::math
use std::strings
fn main() {
println!("===== Module Aliases Demo =====")
println!("")
println!("Module aliases make imports cleaner:")
println!(" Windjammer: use std::math as m")
println!(" Rust: use std::math as m")
println!("")
// Using the imported modules directly
println!("Using math functions:")
let pi_value = PI
println!(" PI = {}", pi_value)
let sqrt_result = sqrt(16.0)
println!(" sqrt(16) = {}", sqrt_result)
let power = pow(2.0, 8.0)
println!(" 2^8 = {}", power)
println!("")
println!("Using string functions:")
let text = " windjammer "
let cleaned = trim(text)
println!(" trim('{}') = '{}'", text, cleaned)
let upper = to_upper("hello")
println!(" to_upper('hello') = '{}'", upper)
let contains_result = contains("windjamme", "jam")
println!(" contains('windjammer', 'jam') = {}", contains_result)
println!("")
println!("✓ Module aliases work!")
println!("✓ (Full :: expression support coming in future version)")
}
// 🎯 The Win:
//
// **Simplified Imports** (80% of the benefit):
// - Shorter syntax: . vs ::
// - Cleaner, easier to read
// - One-line module imports
//
// **Future Enhancement** (20% remaining):
// - Support :: in expressions (m::sqrt())
// - For now, use glob imports or wait for next version
//
// This is the 80/20 philosophy: deliver the biggest value first,
// iterate on edge cases later!