Re: Startup files for STM32F4xx

2015-04-24 Thread Jens Bauer via Digitalmars-d-learn
On Saturday, 25 April 2015 at 00:33:26 UTC, Steven Schveighoffer wrote: On 4/24/15 7:42 PM, Jens Bauer wrote: http://www.digikey.com/product-search/en?x=0y=0lang=ensite=uskeywords=stm32f429+discovery This is super tempting @ $24. As someone who is not used to tinkering with raw hardware,

Re: Range of chars (narrow string ranges)

2015-04-24 Thread Walter Bright via Digitalmars-d
On 4/24/2015 4:56 PM, Steven Schveighoffer wrote: This is pretty easy. We just have to create a string type that is backed by, but isn't simply an alias to, an array of char. Just shoot me now!

Re: A valid code that won't run?

2015-04-24 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 24 April 2015 at 21:47:50 UTC, cym13 wrote: Reimplementing sure sounds like the best long-term way to go... Maybe we don't need all libcurl features Actually, I find curl doesn't provide much of what I actually need and I have to build stuff on top of it! But the hard part to

Re: A valid code that won't run?

2015-04-24 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 24 April 2015 at 20:52:16 UTC, Steven Schveighoffer wrote: There is a reason nothing but Windows build of DMD supports it. You are right about not having pragma(lib anywhere but windows, pragma(lib) works on all versions of dmd, including on Linux.

Re: Startup files for STM32F4xx

2015-04-24 Thread tom via Digitalmars-d-learn
On Friday, 24 April 2015 at 13:12:56 UTC, Jens Bauer wrote: On Friday, 24 April 2015 at 07:34:55 UTC, tom wrote: would something like a STM32 NUCLEO-F401RE work? I forgot to give you a proper answer on this one: I think it should work, as it's a STM32F401 microcontroller. ill order a

Re: Startup files for STM32F4xx

2015-04-24 Thread Jens Bauer via Digitalmars-d-learn
On Friday, 24 April 2015 at 22:18:22 UTC, tom wrote: ill order a discover, i have to try this out. http://www.digikey.com/product-detail/en/STM32F4DISCOVERY/497-11455-ND/2711743 this one right? This board will do nicely, but you may want to get a STM32F29 discovery board, because the

Re: Range of chars (narrow string ranges)

2015-04-24 Thread Brad Anderson via Digitalmars-d
On Friday, 24 April 2015 at 20:44:34 UTC, Walter Bright wrote: [snip] I'm afraid we are stuck with autodecoding, as taking it out may be far too disruptive. No! But all is not lost. The Phobos algorithms can all be fixed to not care about autodecoding. The changes I've made to std.string

Re: Degenerate Regex Case

2015-04-24 Thread TheFlyingFiddle via Digitalmars-d-learn
On Friday, 24 April 2015 at 18:28:16 UTC, Guillaume wrote: Hello, I'm trying to make a regex comparison with D, based off of this article: https://swtch.com/~rsc/regexp/regexp1.html I've written my code like so: import std.stdio, std.regex; void main(string argv[]) { string m =

Re: Range of chars (narrow string ranges)

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 4:44 PM, Walter Bright wrote: I'm afraid we are stuck with autodecoding, as taking it out may be far too disruptive. This is pretty easy. We just have to create a string type that is backed by, but isn't simply an alias to, an array of char. -Steve

Re: GC.malloc is pure - wat

2015-04-24 Thread weaselcat via Digitalmars-d
On Friday, 24 April 2015 at 23:27:36 UTC, Steven Schveighoffer wrote: All I'm saying is that GC.malloc alters global state. I agree that it's OK to pretend that it doesn't because as long as you agree not to base things on this knowledge, you are fine calling pure functions that use GC. A

Re: Startup files for STM32F4xx

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/24/15 7:42 PM, Jens Bauer wrote: On Friday, 24 April 2015 at 22:18:22 UTC, tom wrote: ill order a discover, i have to try this out. http://www.digikey.com/product-detail/en/STM32F4DISCOVERY/497-11455-ND/2711743 this one right? This board will do nicely, but you may want to get a

Re: A valid code that won't run?

2015-04-24 Thread Wyatt via Digitalmars-d
On Friday, 24 April 2015 at 21:06:59 UTC, Dicebot wrote: Typical example is when in specific distro library name includes major version number in the static library name, i.e. libcurl4.a Isn't this very problem why pkg-config exists? Another case is multilib paths, those are not uniform

Re: Range of chars (narrow string ranges)

2015-04-24 Thread Walter Bright via Digitalmars-d
On 4/24/2015 3:29 PM, Brad Anderson wrote: I haven't really followed the autodecoding conversations. The problem is that front on char ranges decode, right? Nope. Only front on narrow string arrays. Ranges aren't autodecoded. Is there quick way to tell which functions are auto decoding so

Re: A valid code that won't run?

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 6:03 PM, Adam D. Ruppe wrote: On Friday, 24 April 2015 at 20:52:16 UTC, Steven Schveighoffer wrote: There is a reason nothing but Windows build of DMD supports it. You are right about not having pragma(lib anywhere but windows, pragma(lib) works on all versions of dmd, including

Re: Startup files for STM32F4xx

2015-04-24 Thread Jens Bauer via Digitalmars-d-learn
On Friday, 24 April 2015 at 12:55:46 UTC, Steven Schveighoffer wrote: I was hoping that github access would be possible now with a more modern browser, no? Actually I was getting sleepy and had to do something else the next day, so I couldn't start right away. But I'll have to learn using

[Issue 14488] Deprecate Imaginary and complex types

2015-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14488 Iain Buclaw ibuc...@gdcproject.org changed: What|Removed |Added CC||ibuc...@gdcproject.org

[Issue 14495] New: executeInNewThread should return Thread

2015-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14495 Issue ID: 14495 Summary: executeInNewThread should return Thread Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

[Issue 14492] Deprecate scope for allocating classes on the stack

2015-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14492 --- Comment #6 from yebblies yebbl...@gmail.com --- (In reply to Jonathan M Davis from comment #4) (In reply to yebblies from comment #3) As Jonathan said, it's used in DDMD. What we really need is a way to make it @safe, not deprecating it.

Re: GC.malloc is pure - wat

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 11:05 AM, anonymous wrote: GC.malloc is marked pure. But it isn't, is it? This should hold for a pure function: assert(f(x) == f(x)); All functional make this concession -- allocating is pure as long as you don't look at the address. You a language that doesn't allow

Re: Fibers and async io stuff for beginners

2015-04-24 Thread Chris via Digitalmars-d-learn
On Friday, 24 April 2015 at 12:38:39 UTC, Jens Bauer wrote: On Friday, 24 April 2015 at 09:15:21 UTC, Chris wrote: I was more thinking of the audio thread. But the audio is probably better off in a separate thread. I think you could do this too. In fact, this is very similar to how the

Re: GC.malloc is pure - wat

2015-04-24 Thread Adam D. Ruppe via Digitalmars-d
string toLower(string s); Should that be pure? Repeated calls to it, given the same input, will return the same output, but they will also most likely be separately allocated. GC.malloc might be cheating to be pure, but it does enable a lot of more logically pure stuff on top of it...

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 15:21:43 UTC, Steven Schveighoffer wrote: This is OK as long as f is *strong* pure. D pure is not the same as the traditional definition. And GC.malloc is not strong pure, as it returns mutable data. Ah, this is the piece I was missing. I was aware of weak/strong

Re: [OT] compiler optimisations

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 07:33:42 UTC, weaselcat wrote: I'm biased because I do essentially zero webdev though, so when I see a lot of changes for std.json or text processing, I don't get too excited. D has a lot of sugar but missing many essential things you'd expect if you want to compete

[Issue 14492] Deprecate scope for allocating classes on the stack

2015-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14492 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added CC|

GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
GC.malloc is marked pure. But it isn't, is it? This should hold for a pure function: assert(f(x) == f(x)); This fails with GC.malloc, of course. Or consider this: auto v = f(x); auto w = f(x); When f is pure, a compiler should be free to reuse the value of v for w. That's no good

Re: How to output ascii character using terminal.d

2015-04-24 Thread Adam D. Ruppe via Digitalmars-d-learn
Try terminal.writef(%s, cast(char) your_ascii_character); it should work.

Re: [OT] compiler optimisations

2015-04-24 Thread bachmeier via Digitalmars-d
On Friday, 24 April 2015 at 07:04:10 UTC, Ola Fosheim Grøstad wrote: the market for programming languages is a Winner Takes It All market. /*Scratching my head*/ I don't see how anyone could possibly describe the current landscape as winner takes it all. Scala, Clojure, D, Go, Haskell, C#,

How to output ascii character using terminal.d

2015-04-24 Thread Paul via Digitalmars-d-learn
How do I output a single ascii character specified numerically, via terminal.d's writef() function which expects a string? Bound to be something obvious but I just can't see it atm! Paul

Re: GC.malloc is pure - wat

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 11:21 AM, Steven Schveighoffer wrote: All functional make this concession -- allocating is pure as long as you don't look at the address. You a language that doesn't allow allocating memory is quite useless. All functional *languages* make this concession... -Steve

Re: GC.malloc is pure - wat

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 15:21:43 UTC, Steven Schveighoffer wrote: Any call to foo could be cached and avoided. This is allowed by the compiler (but I'm not sure if the optimization is implemented). It does, but only in the same expression, i.e. auto a = sin(x) * sin(x);// sin() is

Re: Range of chars (narrow string ranges)

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 9:02 PM, Walter Bright wrote: On 4/24/2015 4:56 PM, Steven Schveighoffer wrote: This is pretty easy. We just have to create a string type that is backed by, but isn't simply an alias to, an array of char. Just shoot me now! Yeah, that's the reaction I figured I'd get ;) But it

Re: Coding for solid state drives

2015-04-24 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 24 April 2015 at 08:27:06 UTC, Walter Bright wrote: http://codecapsule.com/2014/02/12/coding-for-ssds-part-6-a-summary-what-every-programmer-should-know-about-solid-state-drives/ An interesting article. Anyone want to see if there are any modifications we should make to std.stdio to

Re: Startup files for STM32F4xx

2015-04-24 Thread Jens Bauer via Digitalmars-d-learn
On Saturday, 25 April 2015 at 01:06:16 UTC, Mike wrote: On Saturday, 25 April 2015 at 00:33:26 UTC, Steven Schveighoffer wrote: Due to its large number of pins, and the way they are arranged, they don't plug into breadboards, but you can easily use jumper wires for that:

Re: Startup files for STM32F4xx

2015-04-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/04/2015 12:54 p.m., Jens Bauer wrote: ... I now succeeded in making a mirror on GitHub: https://github.com/jens-gpio/STM32F4xx (It was absolutely tedious, because the tutorial on GitHub didn't work for me; I haven't yet added automatic mirroring; hopefully I'll be able to figure it out).

Re: How to output ascii character using terminal.d

2015-04-24 Thread Cassio Butrico via Digitalmars-d-learn
On Friday, 24 April 2015 at 22:21:16 UTC, Adam D. Ruppe wrote: Also try cast(dchar) instead of cast(char), that might do what you need. a look at this https://github.com/cassio2014/DIC

Re: dsource.org moved

2015-04-24 Thread Jonathan M Davis via Digitalmars-d-announce
On Friday, 24 April 2015 at 21:48:30 UTC, Stewart Gordon wrote: On 22/04/2015 08:20, Jacob Carlborg wrote: snip If you're forking a project on Github you get your own copy of the project. The projects are linked but the repositories are not. What I mean by that is on your fork you'll see that

ReQL: pluses and minuses of pipeline-style queries

2015-04-24 Thread Andrei Alexandrescu via Digitalmars-d
Found this on reddit a few days ago: http://rob.conery.io/2015/04/17/rethinkdb-2-0-is-amazing/ A good discussion of the pros and cons of pipeline-style queries (the ReQL query language reminiscent of D's algorithms/ranges) vs. classic SQL. Andrei

Re: dsource.org moved

2015-04-24 Thread Rikki Cattermole via Digitalmars-d-announce
On 25/04/2015 3:33 p.m., Jonathan M Davis wrote: On Friday, 24 April 2015 at 21:48:30 UTC, Stewart Gordon wrote: On 22/04/2015 08:20, Jacob Carlborg wrote: snip If you're forking a project on Github you get your own copy of the project. The projects are linked but the repositories are not.

Re: Startup files for STM32F4xx

2015-04-24 Thread Jens Bauer via Digitalmars-d-learn
On Saturday, 25 April 2015 at 02:02:35 UTC, Rikki Cattermole wrote: Congrats! Thank you. :) Also I found this, https://github.com/defunkt/github-gem Looks interesting. Maybe this can make things easier. I created a repository for people who work with LPC17xx:

Re: Startup files for STM32F4xx

2015-04-24 Thread Jens Bauer via Digitalmars-d-learn
On Saturday, 25 April 2015 at 04:21:06 UTC, Martin Nowak wrote: The STM peripheral library really sux, verbose boilerplate for the simplest stuff and no type safety for the enums (find the difference of GPIO_PIN4 and GPIO_PinSource4 via debugging). I couldn't agree more. I especially hate the

Re: Coding for solid state drives

2015-04-24 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 24 April 2015 at 19:35:08 UTC, Walter Bright wrote: Things are configurable in std.stdio. But most people will just use the default settings. The default settings should be optimized for SSDs, not spinning drives. That would be unwise - as HDDs are much slower (and still much more

Re: Range of chars (narrow string ranges)

2015-04-24 Thread Jonathan M Davis via Digitalmars-d
On Saturday, 25 April 2015 at 02:04:02 UTC, Steven Schveighoffer wrote: On 4/24/15 9:02 PM, Walter Bright wrote: On 4/24/2015 4:56 PM, Steven Schveighoffer wrote: This is pretty easy. We just have to create a string type that is backed by, but isn't simply an alias to, an array of char.

Re: Startup files for STM32F4xx

2015-04-24 Thread Martin Nowak via Digitalmars-d-learn
On Saturday, 25 April 2015 at 01:32:16 UTC, Jens Bauer wrote: This is most likely where the egg cracks open. i'm pretty sure we willl see people migrating to using D (at first a mixture between D and C, because of the libraries from the vendors), but later, there'll surely be projects which

Re: Startup files for STM32F4xx

2015-04-24 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/04/2015 5:07 p.m., Jens Bauer wrote: On Saturday, 25 April 2015 at 04:21:06 UTC, Martin Nowak wrote: The STM peripheral library really sux, verbose boilerplate for the simplest stuff and no type safety for the enums (find the difference of GPIO_PIN4 and GPIO_PinSource4 via debugging). I

Re: [OT] compiler optimisations

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 14:41:13 UTC, bachmeier wrote: On Friday, 24 April 2015 at 07:04:10 UTC, Ola Fosheim Grøstad wrote: the market for programming languages is a Winner Takes It All market. /*Scratching my head*/ I don't see how anyone could possibly describe the current landscape

Re: GC.malloc is pure - wat

2015-04-24 Thread deadalnix via Digitalmars-d
On Friday, 24 April 2015 at 15:43:17 UTC, anonymous wrote: On Friday, 24 April 2015 at 15:21:43 UTC, Steven Schveighoffer wrote: This is OK as long as f is *strong* pure. D pure is not the same as the traditional definition. And GC.malloc is not strong pure, as it returns mutable data. Ah,

[Issue 14496] New: void initialization of member with indirections must not be @safe

2015-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14496 Issue ID: 14496 Summary: void initialization of member with indirections must not be @safe Product: D Version: D2 Hardware: x86_64 OS: Linux Status:

Re: GC.malloc is pure - wat

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 11:43 AM, anonymous wrote: On Friday, 24 April 2015 at 15:21:43 UTC, Steven Schveighoffer wrote: This is OK as long as f is *strong* pure. D pure is not the same as the traditional definition. And GC.malloc is not strong pure, as it returns mutable data. Ah, this is the piece I

Re: A valid code that won't run?

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 17:14:53 UTC, Steven Schveighoffer wrote: On 4/24/15 1:05 PM, cym13 wrote: $ dmd test.d /usr/lib/libphobos2.a(curl.o): In function `_D3std3net4curl4HTTP21_sharedStaticCtor1500FZv': (.text._D3std3net4curl4HTTP21_sharedStaticCtor1500FZv+0xf): undefined reference to

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 15:29:59 UTC, Marc Schütz wrote: auto a = sin(x) * sin(x);// sin() is called only once Could you give a complete example of when this is done? Two calls here (ldc2 -c -O): real grepme(real x) pure { import std.math; auto a = sin(x) * sin(x); return

A valid code that won't run?

2015-04-24 Thread cym13 via Digitalmars-d
I have here a little snippet that just won't run (many issues in here): void main(string[] args) { import std.stdio, std.net.curl, std.algorithm; http://rosettacode.org/wiki/Web_scraping; .byLine .filter!(q{ a.canFind(D) }) .each!writeln; } Let's start with

Re: A valid code that won't run?

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 1:05 PM, cym13 wrote: I don't remember if std.algorithm.each existed in v2.066 but I find it hard to believe that it is that recent an addition to phobos. It is: https://issues.dlang.org/show_bug.cgi?id=12409 Well, let's try DMD: $ dmd --version DMD64 D Compiler v2.067 $

No line numbers in compiler error messages

2015-04-24 Thread John Nixon via Digitalmars-d-learn
I am using dmd v2.067.0 on Mac OSX with Terminal and I found the lack of line numbers surprising. Is there something simple I am doing wrong? Do any of the switches on the command line do this? BTW I only found out about D a couple of weeks back. It seems to be very impressive! John Nixon

__gshared static

2015-04-24 Thread via Digitalmars-d-learn
Hi! I just stumbled across what seems like a misunderstanding on my side about these keywords. Can someone help clarify these for me? ``` __gshared static int foo; __gshared int foo; ``` What are the storage and semantic differences between those two, if any? Cheers, -M

Re: GC.malloc is pure - wat

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 16:34:09 UTC, anonymous wrote: On Friday, 24 April 2015 at 15:29:59 UTC, Marc Schütz wrote: auto a = sin(x) * sin(x);// sin() is called only once Could you give a complete example of when this is done? Two calls here (ldc2 -c -O): real grepme(real x) pure {

Re: A valid code that won't run?

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 1:26 PM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: On Friday, 24 April 2015 at 17:14:53 UTC, Steven Schveighoffer wrote: On 4/24/15 1:05 PM, cym13 wrote: $ dmd test.d /usr/lib/libphobos2.a(curl.o): In function `_D3std3net4curl4HTTP21_sharedStaticCtor1500FZv':

Re: A valid code that won't run?

2015-04-24 Thread cym13 via Digitalmars-d
On Friday, 24 April 2015 at 17:26:03 UTC, Marc Schütz wrote: On Friday, 24 April 2015 at 17:14:53 UTC, Steven Schveighoffer wrote: On 4/24/15 1:05 PM, cym13 wrote: $ dmd test.d /usr/lib/libphobos2.a(curl.o): In function `_D3std3net4curl4HTTP21_sharedStaticCtor1500FZv':

Re: No line numbers in compiler error messages

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/24/15 1:20 PM, John Nixon wrote: I am using dmd v2.067.0 on Mac OSX with Terminal and I found the lack of line numbers surprising. Is there something simple I am doing wrong? Do any of the switches on the command line do this? It does post line numbers. Please post source and compile line

Re: A valid code that won't run?

2015-04-24 Thread Meta via Digitalmars-d
On Friday, 24 April 2015 at 17:44:32 UTC, Steven Schveighoffer wrote: You shouldn't need to explicitly link anything that comes out of phobos IMO. -Steve +1, getting pages of linker errors is extremely confusing and intimidating for newcomers to D.

Re: GC.malloc is pure - wat

2015-04-24 Thread deadalnix via Digitalmars-d
On Friday, 24 April 2015 at 17:45:57 UTC, anonymous wrote: On Friday, 24 April 2015 at 17:07:20 UTC, deadalnix wrote: On Friday, 24 April 2015 at 15:43:17 UTC, anonymous wrote: [...] Could core.stdc.stdlib.malloc and friends also be marked pure then? No. Allocating on the GC is stateless

Re: Convert hex to binary

2015-04-24 Thread nrgyzer via Digitalmars-d-learn
On Friday, 24 April 2015 at 18:45:55 UTC, Jesse Phillips wrote: On Friday, 24 April 2015 at 18:14:07 UTC, nrgyzer wrote: Hi, I'm looking for a function that converts my hex-string to a binary representation. In Python I write the following: myHex = 123456789ABCDEF myBin =

Re: __gshared static

2015-04-24 Thread via Digitalmars-d-learn
On Friday, 24 April 2015 at 18:05:22 UTC, Steven Schveighoffer wrote: On 4/24/15 1:22 PM, =?UTF-8?B?Ik3DoXJjaW8=?= Martins\ marcio...@gmail.com\ wrote: Hi! I just stumbled across what seems like a misunderstanding on my side about these keywords. Can someone help clarify these for me? ```

Re: Range of chars (narrow string ranges)

2015-04-24 Thread H. S. Teoh via Digitalmars-d
On Fri, Apr 24, 2015 at 08:39:36PM +0200, Martin Nowak via Digitalmars-d wrote: Just want to make this a bit more visible. https://github.com/D-Programming-Language/phobos/pull/3206#issuecomment-95681812 We just added entabber to std.phobos, and AFAIK, it's the first range algorithm that

Re: __gshared static

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/24/15 2:47 PM, bearophile wrote: Steven Schveighoffer: These are the same, __gshared overrides static. Isn't forbidding __gshared static a good idea then, to avoid user confusion? Surely, prohibiting non-functioning attributes is good when it's obvious that they do nothing. BUT...

Re: GC.malloc is pure - wat

2015-04-24 Thread anonymous via Digitalmars-d
On Friday, 24 April 2015 at 17:57:12 UTC, deadalnix wrote: On Friday, 24 April 2015 at 17:45:57 UTC, anonymous wrote: [...] I can't see how GC.malloc followed by GC.free is more pure than stdlib malloc followed by stdlib free. GC.free should probably not be pure, Ok, fair enough. Right

Re: GC.malloc is pure - wat

2015-04-24 Thread deadalnix via Digitalmars-d
On Friday, 24 April 2015 at 18:48:43 UTC, Steven Schveighoffer wrote: I think you are thinking of @safe-ty. malloc and free can be pure, but must be contained properly. purity when it comes to mutable data is a tricky thing. -Steve No, it should not be pure because it alter global state in

Re: Convert hex to binary

2015-04-24 Thread Ivan Kazmenko via Digitalmars-d-learn
On Friday, 24 April 2015 at 18:55:07 UTC, Steven Schveighoffer wrote: Thanks to all of you for the solutions, but what if the hex-string exceeds the limit of ulong, for instance 123456789ABCDEF0123456789ABCDEF1234. How to convert them to a ulong-array? Well, technically, a hex string can be

Re: Convert hex to binary

2015-04-24 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 24 April 2015 at 19:15:04 UTC, Ivan Kazmenko wrote: On Friday, 24 April 2015 at 18:55:07 UTC, Steven Schveighoffer wrote: Thanks to all of you for the solutions, but what if the hex-string exceeds the limit of ulong, for instance 123456789ABCDEF0123456789ABCDEF1234. How to convert

Re: Convert hex to binary

2015-04-24 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 24 April 2015 at 18:55:07 UTC, Steven Schveighoffer wrote: On 4/24/15 2:50 PM, nrgyzer wrote: On Friday, 24 April 2015 at 18:45:55 UTC, Jesse Phillips wrote: On Friday, 24 April 2015 at 18:14:07 UTC, nrgyzer wrote: Hi, I'm looking for a function that converts my hex-string to a

Re: No line numbers in compiler error messages

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/24/15 2:24 PM, Jesse Phillips wrote: On Friday, 24 April 2015 at 17:20:12 UTC, John Nixon wrote: I am using dmd v2.067.0 on Mac OSX with Terminal and I found the lack of line numbers surprising. Is there something simple I am doing wrong? Do any of the switches on the command line do this?

Re: Convert hex to binary

2015-04-24 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 24 April 2015 at 18:14:07 UTC, nrgyzer wrote: Hi, I'm looking for a function that converts my hex-string to a binary representation. In Python I write the following: myHex = 123456789ABCDEF myBin = myHex.decode('hex') But how to do the same in D? Is there any function? Thanks

Re: GC.malloc is pure - wat

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 1:57 PM, deadalnix wrote: On Friday, 24 April 2015 at 17:45:57 UTC, anonymous wrote: On Friday, 24 April 2015 at 17:07:20 UTC, deadalnix wrote: On Friday, 24 April 2015 at 15:43:17 UTC, anonymous wrote: [...] Could core.stdc.stdlib.malloc and friends also be marked pure then?

Re: Convert hex to binary

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/24/15 2:50 PM, nrgyzer wrote: On Friday, 24 April 2015 at 18:45:55 UTC, Jesse Phillips wrote: On Friday, 24 April 2015 at 18:14:07 UTC, nrgyzer wrote: Hi, I'm looking for a function that converts my hex-string to a binary representation. In Python I write the following: myHex =

Re: Weird OSX issue

2015-04-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-24 20:37, Steven Schveighoffer wrote: So am I going crazy? Or is dmd doing things differently depending on where its environment is? Any compiler gurus out there understand why the symbol is different? I don't want to file a bug with this, because it seems dependent on installation

Re: How to output ascii character using terminal.d

2015-04-24 Thread Paul via Digitalmars-d-learn
On Friday, 24 April 2015 at 15:46:15 UTC, Adam D. Ruppe wrote: Try terminal.writef(%s, cast(char) your_ascii_character); it should work. Thank you, it works for the standard ascii characters but not the extended set - maybe that has something to do with my terminal settings...? (not that I

Re: [OT] compiler optimisations

2015-04-24 Thread via Digitalmars-d
On Friday, 24 April 2015 at 02:33:19 UTC, ketmar wrote: On Thu, 23 Apr 2015 19:05:06 -0700, Walter Bright wrote: On 4/23/2015 5:37 AM, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= ola.fosheim.grostad+dl...@gmail.com wrote: Yes, it is because of modular artithmetics which is a D design flaw. Out of

Re: Cleaned up C++

2015-04-24 Thread John Colvin via Digitalmars-d
On Friday, 24 April 2015 at 01:54:11 UTC, Walter Bright wrote: On 4/23/2015 3:11 PM, deadalnix wrote: For arbitrary large, you can always do something like : Item* itemPtr = (arbitrarylarge thresold) ? alloca(arbitrarylarge) : GC.alloc(arbitrarylarge); One extra check compared to a heap

Re: WTF: dmd 2.066 vs. dmd 2.067 really dangerous code breakage

2015-04-24 Thread Martin Nowak via Digitalmars-d
On Friday, 24 April 2015 at 02:09:06 UTC, Walter Bright wrote: On 4/23/2015 6:26 AM, Steven Schveighoffer wrote: I agree it should have been done, not saying it's OK to break the process in some cases. I'm just explaining why it probably happened the way it did. Yes, it should have been

Re: [OT] compiler optimisations

2015-04-24 Thread weaselcat via Digitalmars-d
On Friday, 24 April 2015 at 07:04:10 UTC, Ola Fosheim Grøstad wrote: I find it worrying that so many people attracted to D system level programming are into games, yet game development needs are ignored. That can't win. D is lucky that Rust is annoying, Go is marginal, and Nim is unknown, so

Re: Startup files for STM32F4xx

2015-04-24 Thread tom via Digitalmars-d-learn
On Thursday, 23 April 2015 at 15:30:18 UTC, Jens Bauer wrote: The most important thing, though, is that D-programmers now have a starting point for the STM32F4xx. It should be easy to adapt the same sources to other MCUs. I'm planning on adding support for some of the LPC microcontrollers

Re: GC.malloc is pure - wat

2015-04-24 Thread deadalnix via Digitalmars-d
On Friday, 24 April 2015 at 19:41:21 UTC, Steven Schveighoffer wrote: On 4/24/15 3:12 PM, deadalnix wrote: On Friday, 24 April 2015 at 18:48:43 UTC, Steven Schveighoffer wrote: I think you are thinking of @safe-ty. malloc and free can be pure, but must be contained properly. purity when it

[Issue 14497] New: Disassembly view

2015-04-24 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14497 Issue ID: 14497 Summary: Disassembly view Product: D Version: unspecified Hardware: All OS: Windows Status: NEW Severity: enhancement Priority: P1

Re: Range of chars (narrow string ranges)

2015-04-24 Thread Walter Bright via Digitalmars-d
On 4/24/2015 11:52 AM, H. S. Teoh via Digitalmars-d wrote: I really wish we would just *make the darn decision* already, whether to kill off autodecoding or not, and MAKE IT CONSISTENT ACROSS PHOBOS, instead of introducing this schizophrenic dichotomy where some functions give you a range of

Re: A valid code that won't run?

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 4:36 PM, Dicebot wrote: On Friday, 24 April 2015 at 20:27:28 UTC, Steven Schveighoffer wrote: If pragma(lib, libcurl); doesn't work normally, then we should remove std.net.curl, and put it in dub. It was a historical mistake, discussed many time over and over. Yes, it shouldn't be

Re: [OT] compiler optimisations

2015-04-24 Thread bachmeier via Digitalmars-d
On Friday, 24 April 2015 at 16:40:03 UTC, Ola Fosheim Grøstad wrote: There are _lots_ of languages, most are close to dead, some are lingering, some are clinging to a niche... but only a few ones gain momentum. Well, I don't want to get into a big debate about how you define those things.

Re: GC.malloc is pure - wat

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 4:42 PM, deadalnix wrote: On Friday, 24 April 2015 at 19:41:21 UTC, Steven Schveighoffer wrote: On 4/24/15 3:12 PM, deadalnix wrote: On Friday, 24 April 2015 at 18:48:43 UTC, Steven Schveighoffer wrote: I think you are thinking of @safe-ty. malloc and free can be pure, but must be

Re: A valid code that won't run?

2015-04-24 Thread Dicebot via Digitalmars-d
On Friday, 24 April 2015 at 20:52:16 UTC, Steven Schveighoffer wrote: On 4/24/15 4:36 PM, Dicebot wrote: On Friday, 24 April 2015 at 20:27:28 UTC, Steven Schveighoffer wrote: If pragma(lib, libcurl); doesn't work normally, then we should remove std.net.curl, and put it in dub. It was a

Re: extern(C++) infer linkage from interface?

2015-04-24 Thread bitwise via Digitalmars-d
On Thursday, 23 April 2015 at 00:47:30 UTC, bitwise wrote: I have a class with callbacks that can be overridden, which are inherited from an extern(C++) interface. The callbacks are called from C++ code. Is there any chance that the linkage will be inferred in the future? To be clear,

Re: GC.malloc is pure - wat

2015-04-24 Thread deadalnix via Digitalmars-d
On Friday, 24 April 2015 at 20:55:02 UTC, Steven Schveighoffer wrote: But I can check memory usage size and see global state has been altered. OK, if you want to play that game, don't access memory ever, that is global state. I mean, even if the memory is read only you may end up affecting

Re: Coding for solid state drives

2015-04-24 Thread Walter Bright via Digitalmars-d
On 4/24/2015 2:18 AM, tcak wrote: On Friday, 24 April 2015 at 08:27:06 UTC, Walter Bright wrote: http://codecapsule.com/2014/02/12/coding-for-ssds-part-6-a-summary-what-every-programmer-should-know-about-solid-state-drives/ An interesting article. Anyone want to see if there are any

Re: A valid code that won't run?

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 4:06 PM, Dicebot wrote: On Friday, 24 April 2015 at 17:44:32 UTC, Steven Schveighoffer wrote: On 4/24/15 1:37 PM, Iain Buclaw via Digitalmars-d wrote: You need to explicitly link third party libraries. You shouldn't need to explicitly link anything that comes out of phobos

Re: A valid code that won't run?

2015-04-24 Thread Dicebot via Digitalmars-d
On Friday, 24 April 2015 at 20:27:28 UTC, Steven Schveighoffer wrote: If pragma(lib, libcurl); doesn't work normally, then we should remove std.net.curl, and put it in dub. It was a historical mistake, discussed many time over and over. Yes, it shouldn't be in Phobos. No, we can't remove it

Re: md5 return toHexString

2015-04-24 Thread Johannes Pfau via Digitalmars-d-learn
Am Fri, 24 Apr 2015 18:02:57 + schrieb AndyC a...@squeakycode.net: On Friday, 24 April 2015 at 17:56:59 UTC, tcak wrote: On Friday, 24 April 2015 at 17:50:03 UTC, AndyC wrote: Hi All, I cannot seem to understand whats wrong with this: // main.d import std.stdio; import

Re: GC.malloc is pure - wat

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 3:12 PM, deadalnix wrote: On Friday, 24 April 2015 at 18:48:43 UTC, Steven Schveighoffer wrote: I think you are thinking of @safe-ty. malloc and free can be pure, but must be contained properly. purity when it comes to mutable data is a tricky thing. No, it should not be pure

Re: A valid code that won't run?

2015-04-24 Thread Steven Schveighoffer via Digitalmars-d
On 4/24/15 1:44 PM, Steven Schveighoffer wrote: On 4/24/15 1:37 PM, Iain Buclaw via Digitalmars-d wrote: You need to explicitly link third party libraries. You shouldn't need to explicitly link anything that comes out of phobos IMO. Did some digging. This issue isn't as simple as I

Re: A valid code that won't run?

2015-04-24 Thread Dicebot via Digitalmars-d
On Friday, 24 April 2015 at 17:44:32 UTC, Steven Schveighoffer wrote: On 4/24/15 1:37 PM, Iain Buclaw via Digitalmars-d wrote: You need to explicitly link third party libraries. You shouldn't need to explicitly link anything that comes out of phobos IMO. -Steve It doesn't come with

Re: A valid code that won't run?

2015-04-24 Thread Daniel Kozak via Digitalmars-d
On Fri, 24 Apr 2015 16:52:16 -0400 Steven Schveighoffer via Digitalmars-d digitalmars-d@puremagic.com wrote: On 4/24/15 4:36 PM, Dicebot wrote: On Friday, 24 April 2015 at 20:27:28 UTC, Steven Schveighoffer wrote: If pragma(lib, libcurl); doesn't work normally, then we should remove

Re: A valid code that won't run?

2015-04-24 Thread cym13 via Digitalmars-d
On Friday, 24 April 2015 at 21:06:59 UTC, Dicebot wrote: On Friday, 24 April 2015 at 20:52:16 UTC, Steven Schveighoffer wrote: On 4/24/15 4:36 PM, Dicebot wrote: On Friday, 24 April 2015 at 20:27:28 UTC, Steven Schveighoffer wrote: If pragma(lib, libcurl); doesn't work normally, then we

Re: Trial migration of Dsource bindings project to Github

2015-04-24 Thread Stewart Gordon via Digitalmars-d-announce
On 24/04/2015 11:58, Kagamin wrote: On Tuesday, 21 April 2015 at 21:31:39 UTC, Stewart Gordon wrote: How does using SVN lead to fragmentation? I don't understand. See http://forum.dlang.org/post/mailman.3160.1418550079.9932.digitalmar...@puremagic.com ?? I've had a quick look, and can't

Re: dsource.org moved

2015-04-24 Thread Stewart Gordon via Digitalmars-d-announce
On 22/04/2015 08:20, Jacob Carlborg wrote: snip If you're forking a project on Github you get your own copy of the project. The projects are linked but the repositories are not. What I mean by that is on your fork you'll see that it is a fork with a link back to the original project. From the

<    1   2   3   >