D modules

2021-11-13 Thread pascal111 via Digitalmars-d-learn
When I'm searching for "toUpper" and "toLower" functions that string type uses, I confused when I reached the module "std.string". In the first section of its page "https://dlang.org/phobos/std_string.html"; I didn't found functions I'm searching for, but when I pressed ctrl+f and typed functi

Re: D modules

2021-11-13 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote: When I'm searching for "toUpper" and "toLower" functions that string type uses, I confused when I reached the module "std.string". In the first section of its page "https://dlang.org/phobos/std_string.html"; I didn't found functio

Re: D modules

2021-11-13 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote: When I'm searching for "toUpper" and "toLower" functions that string type uses, I confused when I reached the module "std.string". In the first section of its page "https://dlang.org/phobos/std_string.html"; I didn't found functio

Re: D modules

2021-11-13 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote: When I'm searching for "toUpper" and "toLower" functions that string type uses They are usable though `import std.string;` the docs just don't do a great job showing that. The newest test version of my doc generator does integra

Learning D - modules packages and the package.d

2018-04-03 Thread Ali via Digitalmars-d-learn
I am going through the Learning D book by Michael Parker So every now and then I will make post about the book either critics of the book, book content or questions First critic chapter 2 - the special package module this small section, suggest an idiom to create a package which can have any n

Converting C .h Files to D Modules

2012-03-20 Thread Pedro Lacerda
Hi all, How to convert the following struct to D? typedef struct S { int type; void *obj; } S; I didn't found anything at http://dlang.org/htomodule.html.

Re: Learning D - modules packages and the package.d

2018-04-03 Thread Ali via Digitalmars-d-learn
On Wednesday, 4 April 2018 at 04:54:50 UTC, Ali wrote: at first i though package.d is special name, as in i must call the file package.d or this trick or idiom to work the trick was to have one module that public import all the modules you import as group in other modules so instead of impor

Re: Learning D - modules packages and the package.d

2018-04-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 04, 2018 04:54:50 Ali via Digitalmars-d-learn wrote: > I am going through the Learning D book by Michael Parker > So every now and then I will make post about the book > either critics of the book, book content or questions > > > First critic > chapter 2 - the special package mo

Re: Converting C .h Files to D Modules

2012-03-20 Thread Pedro Lacerda
Ouch, void* is the same in both languages, sorry. I addressed a new problem: typedef struct SomeFunctions { void *(*funcA)(char*, size_t); void *(*funcB)(void); } SomeFunctions; How do I convert that functions references into an D struct? On Tue, Mar 20, 2012 at 3:01 PM, Pedro Lacerda

Re: Converting C .h Files to D Modules

2012-03-20 Thread Andrej Mitrovic
On 3/21/12, Pedro Lacerda wrote: > Ouch, void* is the same in both languages, sorry. I addressed a new problem: > > typedef struct SomeFunctions { > void *(*funcA)(char*, size_t); > void *(*funcB)(void); > } SomeFunctions; > > How do I convert that functions references into an D struct? e

Re: Converting C .h Files to D Modules

2012-03-20 Thread bearophile
Andrej Mitrovic: extern(C) struct SomeFunctions { void function(char*, size_t) funcA; void function() funcB; } Are you sure that works? If that doesn't work then use this and write a bug report: struct SomeFunctions { extern(C) void function(char*, size_t) funcA; extern(C) vo

Re: Converting C .h Files to D Modules

2012-03-20 Thread Andrej Mitrovic
On 3/21/12, bearophile wrote: > Are you sure that works? It's easy to test: extern(C) struct SomeFunctions { void function(char*, size_t) funcA; void function() funcB; } void main() { writeln(typeof(SomeFunctions.funcA).stringof); }

Re: Converting C .h Files to D Modules

2012-03-20 Thread dnewbie
On Wednesday, 21 March 2012 at 01:09:58 UTC, Andrej Mitrovic wrote: On 3/21/12, Pedro Lacerda wrote: Ouch, void* is the same in both languages, sorry. I addressed a new problem: typedef struct SomeFunctions { void *(*funcA)(char*, size_t); void *(*funcB)(void); } SomeFunctions; How d

Re: Converting C .h Files to D Modules

2012-03-20 Thread Pedro Lacerda
On Tue, Mar 20, 2012 at 10:53 PM, dnewbie wrote: > On Wednesday, 21 March 2012 at 01:09:58 UTC, Andrej Mitrovic wrote: > >> On 3/21/12, Pedro Lacerda wrote: >> >>> Ouch, void* is the same in both languages, sorry. I addressed a new >>> problem: >>> >>> typedef struct SomeFunctions { >>>void

Re: Converting C .h Files to D Modules

2012-03-20 Thread Andrej Mitrovic
On 3/21/12, Pedro Lacerda wrote: > dnewbie, you're correct, the return type is void* instead of void. I didn't notice the pointer thanks to the silly C function pointer syntax. :)

Re: Converting C .h Files to D Modules

2012-03-21 Thread Timon Gehr
On 03/20/2012 07:01 PM, Pedro Lacerda wrote: Hi all, How to convert the following struct to D? typedef struct S { int type; void *obj; } S; I didn't found anything at http://dlang.org/htomodule.html. (Assuming your 'int' is 32 bits) struct S{ int type; void* obj; }

Why DUB do not import local D modules dependencies?

2021-04-09 Thread Marcone via Digitalmars-d-learn
How make dub import local D modules (mymodule.d) dependencies?

Re: Why DUB do not import local D modules dependencies?

2021-04-09 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 10 April 2021 at 02:10:48 UTC, Marcone wrote: How make dub import local D modules (mymodule.d) dependencies? Could you please provide more details about your scenario, otherwise it is quite hard to understand your question. Kind regards Andre

Re: Why DUB do not import local D modules dependencies?

2021-04-09 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 10 April 2021 at 02:10:48 UTC, Marcone wrote: How make dub import local D modules (mymodule.d) dependencies? Dub doesn't import modules. That's for the compiler. Dub will send every module in your source directory tree to the compiler and they will be available to im