Re: core file

2017-11-12 Thread Ali Çehreli via Digitalmars-d-learn
On 11/12/2017 10:25 PM, Tony wrote: >>> "Segmentation fault (core dumped)" I've been assuming that if it says "dumped", the core is dumped. > I am on Ubuntu 16.04. Thanks, I didn't know that "producing a core file" > was configurable, and it appears that it isn't. It is. If you search for

Re: core file

2017-11-12 Thread Tony via Digitalmars-d-learn
On Monday, 13 November 2017 at 05:37:12 UTC, codephantom wrote: On Monday, 13 November 2017 at 05:01:18 UTC, Tony wrote: I am getting the message from my program execution: "Segmentation fault (core dumped)" But I don't see a core file in the current directory or in my home directory. Is

Re: core file

2017-11-12 Thread codephantom via Digitalmars-d-learn
On Monday, 13 November 2017 at 05:01:18 UTC, Tony wrote: I am getting the message from my program execution: "Segmentation fault (core dumped)" But I don't see a core file in the current directory or in my home directory. Is there one somewhere? Would I be able to do anything meaningful with

core file

2017-11-12 Thread Tony via Digitalmars-d-learn
I am getting the message from my program execution: "Segmentation fault (core dumped)" But I don't see a core file in the current directory or in my home directory. Is there one somewhere? Would I be able to do anything meaningful with it if it exists?

Re: How do I create a fileWatcher with an onFileChange event using spawn?

2017-11-12 Thread shuji via Digitalmars-d-learn
On Friday, 25 August 2017 at 21:25:37 UTC, Enjoys Math wrote: Something like this: module file_watcher; import std.concurrency; import std.file; import std.signals; import std.datetime; void fileWatcher(Tid tid, string filename, int loopSleep) { auto modified0 =

Re: How do I use Socket.select?

2017-11-12 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 12 November 2017 at 21:45:56 UTC, Anonymouse wrote: But a "status change" for a reading Socket is "stuff can now connect", for a writing one "connection established", and not sure about the error ones. It doesn't seem to be "there's data waiting to be read" which I'd hoped for,

Re: opCast'ing strings

2017-11-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 13 November 2017 at 01:03:17 UTC, helxi wrote: In this program, casting using to does not work as intended (returning 23/11) on the struct. However, calling opCast directly seems to do the job. Why is that? to!string calls a function called `string toString() {}` on the struct,

opCast'ing strings

2017-11-12 Thread helxi via Digitalmars-d-learn
struct Fraction { private: int numerator = 1, denominator = 1; public: string opCast(T : string)() const { import std.conv : to; return numerator.to!string() ~ "/" ~ denominator.to!string(); } } void main() { import

Re: Inline assembly question

2017-11-12 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Sunday, 12 November 2017 at 22:24:08 UTC, Basile B. wrote: On Sunday, 12 November 2017 at 22:20:46 UTC, Dibyendu Majumdar wrote: On Sunday, 12 November 2017 at 22:00:58 UTC, Basile B. wrote: On Sunday, 12 November 2017 at 21:27:28 UTC, Dibyendu Majumdar I am not sure I have understood

Re: Inline assembly question

2017-11-12 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Sunday, 12 November 2017 at 22:00:58 UTC, Basile B. wrote: On Sunday, 12 November 2017 at 21:27:28 UTC, Dibyendu Majumdar Does the compiler generate appropriate unwind information on Win64? Prsumably if a function is marked 'naked' then it doesn't? yeah about stack frame..., also don't

Re: Inline assembly question

2017-11-12 Thread Basile B. via Digitalmars-d-learn
On Sunday, 12 November 2017 at 22:20:46 UTC, Dibyendu Majumdar wrote: On Sunday, 12 November 2017 at 22:00:58 UTC, Basile B. wrote: On Sunday, 12 November 2017 at 21:27:28 UTC, Dibyendu Majumdar I am not sure I have understood above; will DMD generate the right Win64 unwind info for this

Re: Inline assembly question

2017-11-12 Thread Basile B. via Digitalmars-d-learn
On Sunday, 12 November 2017 at 21:27:28 UTC, Dibyendu Majumdar wrote: On Sunday, 12 November 2017 at 18:48:02 UTC, Eugene Wissner wrote: https://dlang.org/spec/iasm.html#agregate_member_offsets aggregate.member.offsetof[someregister] Sorry I didn't phrase my question accurately. Presumably

How do I use Socket.select?

2017-11-12 Thread Anonymouse via Digitalmars-d-learn
I've been using blocking Sockets with timeouts for a while now, but wherever I look the word is "do consider using a non-blocking socket". Even the docs for std.socket.setOption; In a typical application, you might also want to consider using a non-blocking socket instead of setting a timeout

Re: Inline assembly question

2017-11-12 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Sunday, 12 November 2017 at 18:48:02 UTC, Eugene Wissner wrote: https://dlang.org/spec/iasm.html#agregate_member_offsets aggregate.member.offsetof[someregister] Sorry I didn't phrase my question accurately. Presumably to use above with the mnemonics I would need additional mixin

Re: Class allocators

2017-11-12 Thread Nordlöw via Digitalmars-d-learn
On Sunday, 12 November 2017 at 20:41:03 UTC, Basile B. wrote: No, the classes and structs of the examples are simply declared as 'static' because they are located in a 'unittest' block. You can ignore the keyword...it just means that they are declared as if they would stand at the global

Re: Class allocators

2017-11-12 Thread Basile B. via Digitalmars-d-learn
On Sunday, 12 November 2017 at 18:46:54 UTC, Per Nordlöw wrote: On Sunday, 12 November 2017 at 18:34:42 UTC, Eduard Staniloiu wrote: On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? I might be wrong, but I think you are

Re: Inline assembly question

2017-11-12 Thread Eugene Wissner via Digitalmars-d-learn
On Sunday, 12 November 2017 at 15:25:43 UTC, Dibyendu Majumdar wrote: On Sunday, 12 November 2017 at 12:32:09 UTC, Basile B. wrote: On Sunday, 12 November 2017 at 12:17:51 UTC, Dibyendu Majumdar wrote: On Sunday, 12 November 2017 at 11:55:23 UTC, Eugene Wissner wrote: [...] Thank you - I

Re: Class allocators

2017-11-12 Thread Per Nordlöw via Digitalmars-d-learn
On Sunday, 12 November 2017 at 18:34:42 UTC, Eduard Staniloiu wrote: On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? I might be wrong, but I think you are looking for std.experimental.allocator.make [0] [0] -

Re: Class allocators

2017-11-12 Thread Eduard Staniloiu via Digitalmars-d-learn
On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote: Have anybody used allocators to construct class instances? I might be wrong, but I think you are looking for std.experimental.allocator.make [0] [0] - https://dlang.org/phobos/std_experimental_allocator.html#make

Re: Inline assembly question

2017-11-12 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Sunday, 12 November 2017 at 12:32:09 UTC, Basile B. wrote: On Sunday, 12 November 2017 at 12:17:51 UTC, Dibyendu Majumdar wrote: On Sunday, 12 November 2017 at 11:55:23 UTC, Eugene Wissner wrote: [...] Thank you - I probably could use something like this. It is uglier than the simpler

Re: Automatic insertion of D-style multiline-comments in Emacs

2017-11-12 Thread Basile B. via Digitalmars-d-learn
On Sunday, 12 November 2017 at 12:52:48 UTC, Nordlöw wrote: Have anybody added logic to Emacs' `comment-dwim` that automagically inserts a (Ddoc-style) multi-line comment like /** ... */ void foo { } if the cursor is currently in front of a (function) definition (or declaration)? I

Re: Automatic insertion of D-style multiline-comments in Emacs

2017-11-12 Thread Nordlöw via Digitalmars-d-learn
On Sunday, 12 November 2017 at 12:52:48 UTC, Nordlöw wrote: Have anybody added logic to Emacs' `comment-dwim` that automagically inserts a (Ddoc-style) multi-line comment like Posted also here: https://stackoverflow.com/questions/47249052/automatic-insertion-of-multiline-declaration-comments

Automatic insertion of D-style multiline-comments in Emacs

2017-11-12 Thread Nordlöw via Digitalmars-d-learn
Have anybody added logic to Emacs' `comment-dwim` that automagically inserts a (Ddoc-style) multi-line comment like /** ... */ void foo { } if the cursor is currently in front of a (function) definition (or declaration)? I realize that the challenge here is context detection; perhaps

Re: Inline assembly question

2017-11-12 Thread Basile B. via Digitalmars-d-learn
On Sunday, 12 November 2017 at 12:17:51 UTC, Dibyendu Majumdar wrote: On Sunday, 12 November 2017 at 11:55:23 UTC, Eugene Wissner wrote: [...] Thank you - I probably could use something like this. It is uglier than the simpler approach in dynasm of course. How about when I need to combine

Re: Inline assembly question

2017-11-12 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Sunday, 12 November 2017 at 11:55:23 UTC, Eugene Wissner wrote: On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar wrote: I have recently started work on building a VM for Lua (actually a derivative of Lua) in X86-64 assembly. I am using the dynasm tool that is part of LuaJIT. I

Re: Inline assembly question

2017-11-12 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Sunday, 12 November 2017 at 12:00:00 UTC, Basile B. wrote: On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar wrote: [...] The assembly code uses static allocation of registers, but because of the differences in how registers are used in Win64 versus Unix X64 - different

Re: Inline assembly question

2017-11-12 Thread Eugene Wissner via Digitalmars-d-learn
On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar wrote: Hi, I have recently started work on building a VM for Lua (actually a derivative of Lua) in X86-64 assembly. I am using the dynasm tool that is part of LuaJIT. I was wondering whether I could also write this in D's inline

Re: Inline assembly question

2017-11-12 Thread Basile B. via Digitalmars-d-learn
On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar wrote: Hi, [...] The assembly code uses static allocation of registers, but because of the differences in how registers are used in Win64 versus Unix X64 - different registers are assigned depending on the architecture. dynasm

Re: Inline assembly question

2017-11-12 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar wrote: Hi, I have recently started work on building a VM for Lua (actually a derivative of Lua) in X86-64 assembly. I am using the dynasm tool that is part of LuaJIT. I was wondering whether I could also write this in D's inline

Inline assembly question

2017-11-12 Thread Dibyendu Majumdar via Digitalmars-d-learn
Hi, I have recently started work on building a VM for Lua (actually a derivative of Lua) in X86-64 assembly. I am using the dynasm tool that is part of LuaJIT. I was wondering whether I could also write this in D's inline assembly perhaps, but there is one aspect that I am not sure how to