www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20172] New: using functions with full path and without

https://issues.dlang.org/show_bug.cgi?id=20172

          Issue ID: 20172
           Summary: using functions with full path and without preliminary
                    import
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: black80 bk.ru

sometimes imported functions used in simple context

suggestion: 
add possibility to use imported function in-situ with full path

struct S {
  void freeItem( void* pelem ) 
  {
    // now: u should import before call
    //import core.stdc.stdlib : free; // no needed

    // suggestion: just call
    core.stdc.stdlib.free( pelem );
  }
}

full path modules.func( .. ) tells exactly function that needed with less LOC,
key press and without blurring eyes by 2 separate items: import and invoke

--
Aug 27 2019