www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - import("dir/file") does not work

reply Vadim Lopatin <coolreader.org gmail.com> writes:
Hello,

Is it intended that import of file as array does not work if path 
is specified for import file name?

import("dir/file.ext"); // does not work
import("file.ext"); // works if dir is added to -J list

I believe it would be convenient if I could just specify one -J 
path (e.g. -Jviews) and import any file from nested directories 
just by providing relative path from one of -J dirs.

(checked on latest DMD under Windows; replacing / with \\ does 
not help)


Best regards,
      Vadim
May 17 2016
parent reply Atila Neves <atila.neves gmail.com> writes:
On Wednesday, 18 May 2016 at 05:11:51 UTC, Vadim Lopatin wrote:
 Hello,

 Is it intended that import of file as array does not work if 
 path is specified for import file name?

 import("dir/file.ext"); // does not work
 import("file.ext"); // works if dir is added to -J list

 I believe it would be convenient if I could just specify one -J 
 path (e.g. -Jviews) and import any file from nested directories 
 just by providing relative path from one of -J dirs.

 (checked on latest DMD under Windows; replacing / with \\ does 
 not help)


 Best regards,
      Vadim
That was a bug that was recently fixed. Atila
May 17 2016
parent reply Vadim Lopatin <coolreader.org gmail.com> writes:
On Wednesday, 18 May 2016 at 06:47:08 UTC, Atila Neves wrote:
 On Wednesday, 18 May 2016 at 05:11:51 UTC, Vadim Lopatin wrote:
 Hello,

 Is it intended that import of file as array does not work if 
 path is specified for import file name?

 import("dir/file.ext"); // does not work
 import("file.ext"); // works if dir is added to -J list

 I believe it would be convenient if I could just specify one 
 -J path (e.g. -Jviews) and import any file from nested 
 directories just by providing relative path from one of -J 
 dirs.

 (checked on latest DMD under Windows; replacing / with \\ does 
 not help)


 Best regards,
      Vadim
That was a bug that was recently fixed. Atila
Thank you! It looks like it's not yet included into recent DMD beta available for download.
May 18 2016
parent reply Andrew Chamberlain <ChamAn gmx.nz> writes:
On Wednesday, 18 May 2016 at 11:58:46 UTC, Vadim Lopatin wrote:
 On Wednesday, 18 May 2016 at 06:47:08 UTC, Atila Neves wrote:
 On Wednesday, 18 May 2016 at 05:11:51 UTC, Vadim Lopatin wrote:
      [...]
That was a bug that was recently fixed. Atila
Thank you! It looks like it's not yet included into recent DMD beta available for download.
in nightly perhaps ? https://dlang.org/download.html#dmd-nightly
May 18 2016
parent reply Andrew Chamberlain <ChamAn gmx.nz> writes:
On Wednesday, 18 May 2016 at 12:16:47 UTC, Andrew Chamberlain 
wrote:
 On Wednesday, 18 May 2016 at 11:58:46 UTC, Vadim Lopatin wrote:
 On Wednesday, 18 May 2016 at 06:47:08 UTC, Atila Neves wrote:
 On Wednesday, 18 May 2016 at 05:11:51 UTC, Vadim Lopatin 
 wrote:
      [...]
That was a bug that was recently fixed. Atila
Thank you! It looks like it's not yet included into recent DMD beta available for download.
in nightly perhaps ? https://dlang.org/download.html#dmd-nightly
the latest beta is always for a "point" release so it only includes regressions fixed from the previous "discrete" (.0) release, not the bug fixed since the "discrete" release to the "point" release.
May 18 2016
parent Vadim Lopatin <coolreader.org gmail.com> writes:
On Wednesday, 18 May 2016 at 12:20:14 UTC, Andrew Chamberlain 
wrote:
 Thank you!
 It looks like it's not yet included into recent DMD beta 
 available for download.
in nightly perhaps ? https://dlang.org/download.html#dmd-nightly
the latest beta is always for a "point" release so it only includes regressions fixed from the previous "discrete" (.0) release, not the bug fixed since the "discrete" release to the "point" release.
Thank you! Working on nightly build.
May 18 2016