Re: setjmp / longjmp

2015-04-26 Thread Cassio Butrico via Digitalmars-d-learn
On Sunday, 26 April 2015 at 05:56:46 UTC, ketmar wrote: On Sat, 25 Apr 2015 23:25:13 +, Cassio Butrico wrote: Hello everyone , first congratulations for the wonderful forum , I wish someone could help me , I am writing a small basic interpreter in D and I am with some difficulties.

Re: Startup files for STM32F4xx

2015-04-26 Thread Johannes Pfau via Digitalmars-d-learn
Am Sun, 26 Apr 2015 00:14:42 + schrieb Mike n...@none.com: Usage: auto b = PORTB.load(); PORTB.toggle!PIN0; PORTB.PIN0 = Level.low; writeln(PORTB.PIN0); PORTB.TEST = 0b000; That's some nice code! and really leveraging D to great effect. I know that

Re: setjmp / longjmp

2015-04-26 Thread ketmar via Digitalmars-d-learn
On Sat, 25 Apr 2015 23:25:13 +, Cassio Butrico wrote: Hello everyone , first congratulations for the wonderful forum , I wish someone could help me , I am writing a small basic interpreter in D and I am with some difficulties. estoutentando manupular the setjmp / longjmp buffers , but

Re: std.json questions

2015-04-26 Thread tired_eyes via Digitalmars-d-learn
Thank everybody for you help. For now, yajl-d seems to be an optimal for my task, however will keep an eye for stdx.data.json too.

C++ interface problem

2015-04-26 Thread extrawurst via Digitalmars-d-learn
I hope someone can tell me where my bug is. I am linking to a dynamic library with C++ interfaces: ``` //alias S = ulong; struct S { ulong data; } extern(C) I getI(); extern(C++) interface I { void foo(); S bar(); } ``` now the question is why does it crash to access bar() in both

Re: Degenerate Regex Case

2015-04-26 Thread Guillaume via Digitalmars-d-learn
On Saturday, 25 April 2015 at 09:30:55 UTC, Dmitry Olshansky wrote: A quick investigation shows that it gets stuck at the end of pattern compilation stage. The problem is that as a last pass D's regex goes to optimize the pattern to construct simple bit-scanning engine as approximation for

Re: Microcontroller startup file - supported devices wish-list

2015-04-26 Thread Jens Bauer via Digitalmars-d-learn
On Sunday, 26 April 2015 at 01:08:03 UTC, Rikki Cattermole wrote: On 26/04/2015 5:53 a.m., Jens Bauer wrote: I'm planning on adding more STM32 devices. including Cortex-M0, Cortex-M0+ and Cortex-M3 devices ... Move this over to e.g. D's wiki (or Github repo's) and post a link into d.D news

Re: BigInt to binary

2015-04-26 Thread Dennis Ritchie via Digitalmars-d-learn
On Saturday, 25 April 2015 at 21:13:29 UTC, Ali Çehreli wrote: On 04/25/2015 01:23 PM, Dennis Ritchie wrote: which section should apply similar requests? https://issues.dlang.org/ After clicking File and Issue: Component: Phobos Severity: Enhancement Ali Thanks. I reported this: -

Re: setjmp / longjmp

2015-04-26 Thread Stewart Gordon via Digitalmars-d-learn
On 26/04/2015 06:56, ketmar wrote: snip you shouldn't use setjmp/longjmp in D. use exceptions instead. something like this: snip True in the general case. Still, there must be some reason that trying it in D causes an AV (even if I disable the GC). I remain curious about what that reason

Re: std.json questions

2015-04-26 Thread extrawurst via Digitalmars-d-learn
On Saturday, 25 April 2015 at 18:30:33 UTC, Baz wrote: On Saturday, 25 April 2015 at 09:56:25 UTC, tired_eyes wrote: I think this is ugly and clunky approach, what is the beautiful one? What you clearly need is a serializer: look at these:

Re: std.json questions

2015-04-26 Thread weaselcat via Digitalmars-d-learn
On Sunday, 26 April 2015 at 17:14:22 UTC, extrawurst wrote: On Saturday, 25 April 2015 at 18:30:33 UTC, Baz wrote: On Saturday, 25 April 2015 at 09:56:25 UTC, tired_eyes wrote: I think this is ugly and clunky approach, what is the beautiful one? What you clearly need is a serializer: look

How to change text while running in console?

2015-04-26 Thread Israel via Digitalmars-d-learn
I remember doing this in C++ and it worked but is this possible in D? Its basically updating information in the console window without constantly printing new lines. http://stackoverflow.com/questions/14043148/how-to-change-text-while-running-the-console

Re: How to change text while running in console?

2015-04-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 27 April 2015 at 02:30:36 UTC, Vladimir Panteleev wrote: writef(%d%%\r, current * 100 / total); stdout.flush(); I'd prolly put a width specifier on it like %3d because otherwise if it was 100 percent then went to 99, the third digit wouldn't be erased.

Re: How to change text while running in console?

2015-04-26 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 27 April 2015 at 02:32:17 UTC, Adam D. Ruppe wrote: On Monday, 27 April 2015 at 02:26:01 UTC, Israel wrote: I remember doing this in C++ and it worked but is this possible in D? Have you tried it yet? The solution is basically the same, you just write out the carriage return

Re: How to change text while running in console?

2015-04-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 27 April 2015 at 02:26:01 UTC, Israel wrote: I remember doing this in C++ and it worked but is this possible in D? Have you tried it yet? The solution is basically the same, you just write out the carriage return character to the device.

Re: How to change text while running in console?

2015-04-26 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 27 April 2015 at 02:26:01 UTC, Israel wrote: I remember doing this in C++ and it worked but is this possible in D? Its basically updating information in the console window without constantly printing new lines.

Re: How to change text while running in console?

2015-04-26 Thread Israel via Digitalmars-d-learn
On Monday, 27 April 2015 at 02:30:36 UTC, Vladimir Panteleev wrote: On Monday, 27 April 2015 at 02:26:01 UTC, Israel wrote: I remember doing this in C++ and it worked but is this possible in D? Its basically updating information in the console window without constantly printing new lines.

Re: setjmp / longjmp

2015-04-26 Thread Cassio Butrico via Digitalmars-d-learn
I'm just building a small interpreter with a script and wanted to handle errors diverting the flow and returning . I am grateful for having responded my question , thank you.