On Friday, 26 July 2019 at 14:56:37 UTC, Andrey Zherikov wrote:
Even without static if I get the same result:
mixin template my_import(alias modName)
{
mixin("import " ~ modName ~ ";");
}
mixin my_import!"mymod";
pragma(msg,fullyQualifiedName!(myfunc)); // Error:
undefined identifier
On Friday, 26 July 2019 at 03:42:58 UTC, Andrey Zherikov wrote:
Is there a way to check whether some module, say "foo", is
available for import before doing "import foo"?
static if (is(typeof((){import that.module.here;}))) {
// it is available
}
On Friday, 26 July 2019 at 14:19:05 UTC, Paul Backus wrote:
version(HasStdio)
import std.stdio;
else
pragma(msg, "std.stdio is not available");
Then configure your build system to pass `-version=HasStdio` to
dmd (or the equivalent flag to ldc or gdc) when std.stdio is
available.
I wa
On Friday, 26 July 2019 at 14:14:11 UTC, Anonymouse wrote:
I use __traits(compiles, __traits(identifier, moduleName)) now
instead and it seems to work.
I couldn't find "identifier" docs on
https://dlang.org/phobos/std_traits.html. But I tried and it
doesn't work - I think because is unknown
On Friday, 26 July 2019 at 06:24:18 UTC, evilrat wrote:
On Friday, 26 July 2019 at 03:42:58 UTC, Andrey Zherikov wrote:
Is there a way to check whether some module, say "foo", is
available for import before doing "import foo"?
I did some really retarded utility like this in the past,
worked f
On Friday, 26 July 2019 at 03:42:58 UTC, Andrey Zherikov wrote:
Is there a way to check whether some module, say "foo", is
available for import before doing "import foo"?
I want to create a function that imports module if it's
available or does something else otherwise. So I think the code
shou
On Friday, 26 July 2019 at 06:24:18 UTC, evilrat wrote:
On Friday, 26 July 2019 at 03:42:58 UTC, Andrey Zherikov wrote:
bool isModuleAvailable(alias modName)() {
mixin("import " ~ modName ~ ";");
static if (__traits(compiles, mixin(modName).stringof))
return true;
On Friday, 26 July 2019 at 03:42:58 UTC, Andrey Zherikov wrote:
Is there a way to check whether some module, say "foo", is
available for import before doing "import foo"?
I did some really retarded utility like this in the past, worked
for me, but I can't say it is that well tested and there m
Is there a way to check whether some module, say "foo", is
available for import before doing "import foo"?
I want to create a function that imports module if it's available
or does something else otherwise. So I think the code should look
something like this:
mixin template my_import(alias mod
On Wednesday, 19 June 2019 at 21:21:53 UTC, XavierAP wrote:
On Wednesday, 19 June 2019 at 18:56:57 UTC, BoQsc wrote:
I would like to make sure that my modules do not interfere
with d lang. Is there any way to escape reserved words?
The only reason C# allows this is for interop or code
genera
On Wednesday, 19 June 2019 at 18:56:57 UTC, BoQsc wrote:
I would like to make sure that my modules do not interfere with
d lang. Is there any way to escape reserved words?
The only reason C# allows this is for interop or code generation
for other languages that use the same keyword. For examp
On Wednesday, 19 June 2019 at 19:07:30 UTC, Jonathan M Davis
wrote:
On Wednesday, June 19, 2019 12:56:57 PM MDT BoQsc via
Digitalmars-d-learn wrote:
I would like to make sure that my modules do not interfere
with d lang. Is there any way to escape reserved words?
https://dlang.org/spec/lex.htm
On Wednesday, June 19, 2019 12:56:57 PM MDT BoQsc via Digitalmars-d-learn
wrote:
> I would like to make sure that my modules do not interfere with d
> lang. Is there any way to escape reserved words?
> https://dlang.org/spec/lex.html#keywords
>
> > import alias;
>
> C:\Users\Juozas\Desktop\om.d(2
I would like to make sure that my modules do not interfere with d
lang. Is there any way to escape reserved words?
https://dlang.org/spec/lex.html#keywords
import alias;
C:\Users\Juozas\Desktop\om.d(2): Error: identifier expected
following import
C:\Users\Juozas\Desktop\om.d(2): Error: ;
On Friday, 10 July 2015 at 10:22:39 UTC, anonymous wrote:
On Friday, 10 July 2015 at 00:53:38 UTC, codenstuff wrote:
On Friday, 10 July 2015 at 00:24:44 UTC, anonymous wrote:
[...]
[...]
The path is ${HOME}/d_apps/steering/steering/game_object.d
Compile command is
dmd map/map.d main_visual
On Friday, 10 July 2015 at 00:53:38 UTC, codenstuff wrote:
On Friday, 10 July 2015 at 00:24:44 UTC, anonymous wrote:
On Thursday, 9 July 2015 at 22:05:23 UTC, codenstuff wrote:
I am trying to import module and compile.
The compiler produces message
map/map.d(9): Error: module game_object is
On Friday, 10 July 2015 at 03:11:25 UTC, Mike Parker wrote:
On Friday, 10 July 2015 at 00:53:38 UTC, codenstuff wrote:
The path is ${HOME}/d_apps/steering/steering/game_object.d
[...]
First, because you are importing sterring.game_object, then you
can't pass -I/home/real/d_apps/steering to
On Friday, 10 July 2015 at 00:53:38 UTC, codenstuff wrote:
The path is ${HOME}/d_apps/steering/steering/game_object.d
Compile command is
dmd map/map.d main_visual.d -ofmain_visual -H -gc -unittest
-L-lDgame -L-lDerelictUtil -L-lDerelictGL3 -L-lDerelictSDL2
-L-ldl -I/home/real/d_apps/dgame/so
On Friday, 10 July 2015 at 00:24:44 UTC, anonymous wrote:
On Thursday, 9 July 2015 at 22:05:23 UTC, codenstuff wrote:
I am trying to import module and compile.
The compiler produces message
map/map.d(9): Error: module game_object is in file
'steering/game_object.d' which cann
On Thursday, 9 July 2015 at 22:05:23 UTC, codenstuff wrote:
I am trying to import module and compile.
The compiler produces message
map/map.d(9): Error: module game_object is in file
'steering/game_object.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path
On Thursday, 9 July 2015 at 22:10:53 UTC, Adam D. Ruppe wrote:
The best thing to do is to pass all the modules in the project
to the compiler at once, so like:
dmd map/map.d steering/game_object.d
The import path could be changed to not include the steering/
folder - give it the folder that c
The best thing to do is to pass all the modules in the project to
the compiler at once, so like:
dmd map/map.d steering/game_object.d
The import path could be changed to not include the steering/
folder - give it the folder that contains steering - but that
still won't actually link without a
I am trying to import module and compile.
The compiler produces message
map/map.d(9): Error: module game_object is in file
'steering/game_object.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import
make: *** [main] Error
bearophile wrote:
Don:
Bug 314 is the root cause of every module bug that I know of. Basically
the compiler isn't keeping track of how symbols got imported. So it gets
everything wrong.
Bug 314 is among my voted bugs since a lot of time.
Actually it was the most voted bug in D, long befor
Don:
> Bug 314 is the root cause of every module bug that I know of. Basically
> the compiler isn't keeping track of how symbols got imported. So it gets
> everything wrong.
Bug 314 is among my voted bugs since a lot of time. Even if bug 314 isn't the
only module system bug present, solving it
bearophile wrote:
Don:
There's only really one. But it's huge.
Really? :-) I didn't know this. (You are very often right, but I have a hard
time believing this).
Bye,
bearophile
Bug 314 is the root cause of every module bug that I know of. Basically
the compiler isn't keeping track of ho
Don:
> There's only really one. But it's huge.
Really? :-) I didn't know this. (You are very often right, but I have a hard
time believing this).
Bye,
bearophile
%u wrote:
Yay, free access to a!
I searched for this bug in the bug-reports..
Why are there so many basic import bugs?
There's only really one. But it's huge.
%u:
> Why are there so many basic import bugs?
Module system bugs are among the most voted in Bugzilla. True modules are
absent in C/C++, so maybe Walter thinks assuring their semantics is correct is
not so important compared to other kinds of bugs, or maybe such bugs are hard
to fix, I don't
Yay, free access to a!
I searched for this bug in the bug-reports..
Why are there so many basic import bugs?
--
module main;
import b;
void main(){
a.write();
}
--
module a;
import std.stdio;
void write(){
writefln("a");
}
--
module b;
import a; //also with static
--
30 matches
Mail list logo