Ddoc and struct members

2017-12-13 Thread n00nb via Digitalmars-d-learn
Hi all! How do I generate documentation for struct members using ddoc? I don't understand if there is a way to generate documentation for all the members without putting a '///' over every member

Re: Ddoc and struct members

2017-12-13 Thread rikki cattermole via Digitalmars-d-learn
On 14/12/2017 3:16 AM, n00nb wrote: Hi all! How do I generate documentation for struct members using ddoc? I don't understand if there is a way to generate documentation for all the members without putting a '///' over every member There isn't.

Re: How to catch line number of exception without catching it ?

2017-12-13 Thread codephantom via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 18:24:09 UTC, Thomas wrote: Or is there a better solution for tracing the error position from root till the branch ? Speaking of tracing exceptions, here's my favourite one .. so far ;-) (I mean come on.. debugging is great fun!) btw. If you compile/run

Re: `Socket.receive` providing arbitrary packet sizes and hanging without sending EOF

2017-12-13 Thread Ali Çehreli via Digitalmars-d-learn
On 12/13/2017 11:39 AM, Unazed Spectaculum wrote: > ubyte[] receiveBytes(T)(T socket, size_t receiveCount) > { > ubyte[] buffer = new ubyte[receiveCount]; > size_t count = socket.receive(buffer); Don't trust code you find on newsgroups. :o) You have to check the returned value first.

Re: Global variable type does not match previous declaration

2017-12-13 Thread Satoshi via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote: What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D

Global variable type does not match previous declaration

2017-12-13 Thread Satoshi via Digitalmars-d-learn
What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D runtime and I'm unable to compile object.d source code:

How to statically link Derelict SDL2 satellite libs

2017-12-13 Thread eskaypee via Digitalmars-d-learn
I'm on Linux 64 bit, all SDL libraries (-dev versions) are installed, dub is set up with: "dependencies": { "derelict-sdl2": "~>3.0.0-beta" }, "subConfigurations": { "derelict-sdl2": "derelict-sdl2-static" }, "libs": ["sdl2"] All the SDL core library functions

Re: Understanding how dub works

2017-12-13 Thread datboi via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 00:43:31 UTC, rikki cattermole wrote: 1. Does dub compile dependencies as separate binaries? And if yes how to specify where should be they placed? Object/static files, but yes. Where they go: Windows: %APPDATA%/roaming/dub Posix: ~/.dub You don't need to

Re: How to catch line number of exception without catching it ?

2017-12-13 Thread Nathan S. via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 18:24:09 UTC, Thomas wrote: So my question is: Is there a way to catch that line where the exception has happened without a catch ? Yes: use a debugger.

Re: How to catch line number of exception without catching it ?

2017-12-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, December 13, 2017 18:24:09 Thomas via Digitalmars-d-learn wrote: > Hi forks! > > I wanted to ask if there is a way to catch the line position on > an exception without setting a try + catch block ? > What I want is something like this: > > > module main; > > import std.stdio; >

`Socket.receive` providing arbitrary packet sizes and hanging without sending EOF

2017-12-13 Thread Unazed Spectaculum via Digitalmars-d-learn
ubyte[] receiveBytes(T)(T socket, size_t receiveCount) { ubyte[] buffer = new ubyte[receiveCount]; size_t count = socket.receive(buffer); return buffer[0 .. count]; } string receiveAll(T)(T socket, size_t segmentSize = 1024) { ubyte[][] data; size_t count

How to catch line number of exception without catching it ?

2017-12-13 Thread Thomas via Digitalmars-d-learn
Hi forks! I wanted to ask if there is a way to catch the line position on an exception without setting a try + catch block ? What I want is something like this: module main; import std.stdio; import std.conv; void foo() { scope(failure) { writeln("Got a

Re: Tuple Array Sorting

2017-12-13 Thread Vino via Digitalmars-d-learn
On Tuesday, 12 December 2017 at 19:00:01 UTC, Biotronic wrote: On Tuesday, 12 December 2017 at 15:19:35 UTC, Vino wrote: import std.algorithm: filter, map, sort; import std.container.array; import std.file: SpanMode, dirEntries, isDir ; import std.stdio: writefln; import std.typecons: Tuple,

Re: Container Array or tuples Sorting

2017-12-13 Thread Vino via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 15:58:40 UTC, Vino wrote: On Wednesday, 13 December 2017 at 15:16:50 UTC, Vino wrote: Hi All, Request your help, on how to sort a tuple container array, I have raised the same topic in one of the other thread "Tuple Array Sorting" and was addressed to use

Re: Date Formating

2017-12-13 Thread Vino via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 17:16:46 UTC, Vino wrote: On Wednesday, 13 December 2017 at 08:32:34 UTC, codephantom wrote: [...] Hi All, [...] Hi All, Thank you very much , was able to resolve the issue by changing the writefln line as below. Sorted[].sort!((a,b) =>

Re: Date Formating

2017-12-13 Thread Vino via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 08:32:34 UTC, codephantom wrote: On Wednesday, 13 December 2017 at 07:35:40 UTC, Jonathan M Davis wrote: In general, you probably want to cast the SysTime to a DateTime if you're going to do something like that. yes, I would agree ;-) Of course the intention

Re: GUI program on Mac OS in D?

2017-12-13 Thread mrphobby via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 15:17:59 UTC, Jacob Carlborg wrote: I forgot to mention that there have been several discussions around adding support for reference counted classes. Several of the mentioning interfacing with Objective-C is important/a requirement. Ok, good to know! I have

Re: Container Array or tuples Sorting

2017-12-13 Thread Vino via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 15:16:50 UTC, Vino wrote: Hi All, Request your help, on how to sort a tuple container array, I have raised the same topic in one of the other thread "Tuple Array Sorting" and was addressed to use standard array rather than container array, and i am not able

Re: GUI program on Mac OS in D?

2017-12-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-12-13 16:07, Jacob Carlborg wrote: On 2017-12-13 13:18, mrphobby wrote: Would it be possible to somehow hook this up automatically to the D destructor perhaps? Interested in hearing your thoughts on this! As far as I know, the destructor is only called (automatically by the GC).

Container Array or tuples Sorting

2017-12-13 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, on how to sort a tuple container array, I have raised the same topic in one of the other thread "Tuple Array Sorting" and was addressed to use standard array rather than container array, and i am not able to find any document or example in the library for the

Re: GUI program on Mac OS in D?

2017-12-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-12-13 13:18, mrphobby wrote: I have been taking a look at your example. Looks pretty neat! Some advanced mixin stuff there that looks pretty useful. They're pretty basic ;) However, as far as I can tell there is no handling of retain/release. No, that's correct. How would you

Re: GUI program on Mac OS in D?

2017-12-13 Thread mrphobby via Digitalmars-d-learn
On Thursday, 23 November 2017 at 17:28:43 UTC, Jacob Carlborg wrote: I have a simple example [2] of an application that shows a window with a WebKit view, i.e. and embedded browser. This works with the upstream DMD and LDC compilers. It basically only contains bindings for what I needed for

Re: AssocArray to string is ok,but how to get the AssocArray from string? Thanks

2017-12-13 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 12 December 2017 at 17:32:15 UTC, Frank Like wrote: Hi,everyone, who can help me,about the "AssocArray to string is ok,but how to get the AssocArray from string? ". For example: SysTime[][string] AATimes; AATimes["a1"] =[SysTime(DateTime(2017, 1, 1, 12, 33,

Re: What's the proper way to use std.getopt?

2017-12-13 Thread bauss via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 07:37:17 UTC, Jonathan M Davis wrote: On Wednesday, December 13, 2017 06:55:46 bauss via Digitalmars-d-learn wrote: [...] If it works, it's a bug related to code lowering (since scope statements are always lowered to try-catch-finally blocks). You're not

Re: Date Formating

2017-12-13 Thread codephantom via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 07:35:40 UTC, Jonathan M Davis wrote: In general, you probably want to cast the SysTime to a DateTime if you're going to do something like that. yes, I would agree ;-) Of course the intention was not really to just format it the same way as Clock.currTime()