Re: is function pointer least significant bit always zero ?

2018-10-27 Thread Ali Çehreli via Digitalmars-d-learn
On 10/27/2018 09:16 PM, learnfirst1 wrote: I plan to use function pointer least significant bit to store some information. If there is no GC on my system,  I think it will help the memory is well aligned. The question is all the function least significant bit is zero ? Most definitely.

Re: link errors when using extern (C) structs

2018-10-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 28 October 2018 at 04:23:27 UTC, DanielG wrote: On Sunday, 28 October 2018 at 03:39:41 UTC, Nicholas Wilson wrote: write struct Foo { double bar = 0.0; // The bitpattern of 0.0 is 0 } Thank you for your response. Can you elaborate on 'write struct...'? Is that special syntax?

Re: link errors when using extern (C) structs

2018-10-27 Thread DanielG via Digitalmars-d-learn
On Sunday, 28 October 2018 at 03:39:41 UTC, Nicholas Wilson wrote: write struct Foo { double bar = 0.0; // The bitpattern of 0.0 is 0 } Thank you for your response. Can you elaborate on 'write struct...'? Is that special syntax? I assumed so, but dmd doesn't like it. I also checked to

is function pointer least significant bit always zero ?

2018-10-27 Thread learnfirst1 via Digitalmars-d-learn
I plan to use function pointer least significant bit to store some information. If there is no GC on my system, I think it will help the memory is well aligned. The question is all the function least significant bit is zero ?

Re: Dub Renaming source/app.d makes project a library

2018-10-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 28 October 2018 at 03:34:57 UTC, Neia Neutuladh wrote: targetType "executable" does it for me (dub 1.11.0). Can you post your full dub.sdl? I'm an idiot, I was in the wrong directory that does seem to work.

Re: link errors when using extern (C) structs

2018-10-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 28 October 2018 at 03:28:20 UTC, DanielG wrote: I'm wrapping a C library which has a lot of structs defined, and I keep running into issues where dmd complains that .init isn't defined ("Symbol Undefined __xxx__initZ" etc). I'm struggling to narrow it down to a simple example

Re: Dub Renaming source/app.d makes project a library

2018-10-27 Thread Neia Neutuladh via Digitalmars-d-learn
targetType "executable" does it for me (dub 1.11.0). Can you post your full dub.sdl?

link errors when using extern (C) structs

2018-10-27 Thread DanielG via Digitalmars-d-learn
I'm wrapping a C library which has a lot of structs defined, and I keep running into issues where dmd complains that .init isn't defined ("Symbol Undefined __xxx__initZ" etc). I'm struggling to narrow it down to a simple example that demonstrates it - I actually made something that's kind

Dub Renaming source/app.d makes project a library

2018-10-27 Thread Nicholas Wilson via Digitalmars-d-learn
So I have a project that is a simple dub app with source/ app.d $dub Performing "debug" build using /Library/D/dmd/bin/dmd for x86_64. foo ~master: building configuration "application"... Linking... Running ./foo Edit source/app.d to start your project. $mv source/app.d source/foo.d $dub

Re: Variant of chunkBy that can lazily split a string on case-changes

2018-10-27 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 27 October 2018 at 16:54:59 UTC, Per Nordlöw wrote: that can group elements using a binary predicate being able to do to the following. Oops, turns out I already had this at https://github.com/nordlow/phobos-next/blob/721374f3815db41cc213b108f81ca13ea7b93721/src/slicing.d#L12

Variant of chunkBy that can lazily split a string on case-changes

2018-10-27 Thread Per Nordlöw via Digitalmars-d-learn
Have anybody implemented a lazy iteration algorithm similar to https://dlang.org/phobos/std_algorithm_iteration.html#chunkBy that can group elements using a binary predicate being able to do to the following. This example import std.ascii : isUpper, isLower; foreach (e;

Re: Pegged: spaces

2018-10-27 Thread Mark Fisher via Digitalmars-d-learn
On Saturday, 27 October 2018 at 14:21:51 UTC, Michelle Long wrote: What would be really cool if one could have an autogrammar generator! Somehow it looks at text and figures out the grammar. Might require some human interaction but can figure out the rules that will generate the specific

Re: Pegged: spaces

2018-10-27 Thread Michelle Long via Digitalmars-d-learn
On Friday, 26 October 2018 at 07:36:50 UTC, drug wrote: 25.10.2018 23:34, Michelle Long пишет: Ignores spaces: <- Doesn't: < Concatenates results: <~ Thank you for sharing your results! I got it backwards when posting: /* < (space arrow) consume spaces before, between and after