Re: Problem with environ variable (Mac OS X)

2012-09-21 Thread Jacob Carlborg
On 2012-09-20 21:34, Chris wrote: Thanks a million, Jacob! I have just tested it with the latest version of dmd and it works. No problem. You can use DVM if you need the to keep the old version of the compiler. https://bitbucket.org/doob/dvm -- /Jacob Carlborg

how to get version identifiers set during compilation?

2012-09-21 Thread timotheecour
how to get version identifiers set during compilation? ideally would be something like: enum versions=VersionFlags;//returns [OSX,debug] for example one use case is to have arbitrary logic on versions without requiring new syntax. eg: static if(VersionFlags.canFind(OSX)

Re: Problem with environ variable (Mac OS X)

2012-09-21 Thread Chris
On Friday, 21 September 2012 at 06:16:33 UTC, Jacob Carlborg wrote: On 2012-09-20 21:34, Chris wrote: Thanks a million, Jacob! I have just tested it with the latest version of dmd and it works. No problem. You can use DVM if you need the to keep the old version of the compiler.

Re: About std.ascii.toLower

2012-09-21 Thread monarch_dodra
On Thursday, 20 September 2012 at 17:32:52 UTC, bearophile wrote: Jonathan M Davis: Functions which operate on ASCII characters. All of the functions in std.ascii accept unicode characters but effectively ignore them. All isX functions return false for unicode characters, and all toX

Re: Problem with environ variable (Mac OS X)

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 10:56, Chris wrote: Thanks, that's cool. I really need something like that, because I still use a lot of features that are deprecated by now and are all over the place. The reason for this is that my project developed so fast and grew so big in a short period of time (D speeds up

Re: About std.ascii.toLower

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 11:00:31 monarch_dodra wrote: What do you (you two) think of my proposition for a std.strictascii module? I don't think that it's at all worth it. It's just duplicate functionality in order to avoid a cast. - Jonathan M Davis

Re: About std.ascii.toLower

2012-09-21 Thread monarch_dodra
On Friday, 21 September 2012 at 10:23:39 UTC, Jonathan M Davis wrote: On Friday, September 21, 2012 11:00:31 monarch_dodra wrote: What do you (you two) think of my proposition for a std.strictascii module? I don't think that it's at all worth it. It's just duplicate functionality in order

Re: About std.ascii.toLower

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 12:38:07 monarch_dodra wrote: On Friday, 21 September 2012 at 10:23:39 UTC, Jonathan M Davis wrote: On Friday, September 21, 2012 11:00:31 monarch_dodra wrote: What do you (you two) think of my proposition for a std.strictascii module? I don't think

Re: About std.ascii.toLower

2012-09-21 Thread monarch_dodra
On Friday, 21 September 2012 at 10:45:42 UTC, Jonathan M Davis wrote: On Friday, September 21, 2012 12:38:07 monarch_dodra wrote: On Friday, 21 September 2012 at 10:23:39 UTC, Jonathan M Davis wrote: On Friday, September 21, 2012 11:00:31 monarch_dodra wrote: What do you (you two) think of

Re: About std.ascii.toLower

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 13:18:01 monarch_dodra wrote: Related, could toChar be considered for inclusion? I think it would be a convenient tool for validation. I certainly would be against adding it. I think that it's a relatively uncommon use case and considering how easy it is to just

Re: About std.ascii.toLower

2012-09-21 Thread monarch_dodra
On Friday, 21 September 2012 at 11:25:54 UTC, Jonathan M Davis wrote: On Friday, September 21, 2012 13:18:01 monarch_dodra wrote: Related, could toChar be considered for inclusion? I think it would be a convenient tool for validation. I certainly would be against adding it. I think that it's

Re: About std.ascii.toLower

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 14:10:25 monarch_dodra wrote: I did not know conv's to did cast validation. For conversions which can be done with both casting and std.conv.to, std.conv.to does runtime checks wherever a narrowing conversion would take place and throws if the conversion would

Passing associative array to another thread

2012-09-21 Thread Martin Drasar
Hi, I am using the std.concurrency module and I would like to send an associative array to another thread. If I try this: string[string] aa; someThread.send(aa); I get: Aliases to mutable thread-local data not allowed. And if I try to use this: immutable(string[string]) aa;

Re: Problem with environ variable (Mac OS X)

2012-09-21 Thread Chris
On Friday, 21 September 2012 at 09:50:06 UTC, Jacob Carlborg wrote: On 2012-09-21 10:56, Chris wrote: Thanks, that's cool. I really need something like that, because I still use a lot of features that are deprecated by now and are all over the place. The reason for this is that my project

Re: Passing associative array to another thread

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 16:33, Martin Drasar wrote: Hi, I am using the std.concurrency module and I would like to send an associative array to another thread. If I try this: string[string] aa; someThread.send(aa); I get: Aliases to mutable thread-local data not allowed. And if I try to use this:

Re: Problem with environ variable (Mac OS X)

2012-09-21 Thread Jacob Carlborg
On 2012-09-21 16:42, Chris wrote: The only drawback is the lack of a fully-fledged cross-platform GUI, but that's a different story ... Have a look at DWT, it's a port of the Java library SWT: https://github.com/d-widget-toolkit/dwt http://dsource.org/projects/dwt I'm currently working on

Re: Problem with environ variable (Mac OS X)

2012-09-21 Thread Chris
On Friday, 21 September 2012 at 17:02:50 UTC, Jacob Carlborg wrote: On 2012-09-21 16:42, Chris wrote: The only drawback is the lack of a fully-fledged cross-platform GUI, but that's a different story ... Have a look at DWT, it's a port of the Java library SWT:

function is not function

2012-09-21 Thread Ellery Newcomer
solution is to use std.traits, but can someone explain this to me? import std.stdio; void main() { auto a = { writeln(hi); }; pragma(msg, typeof(a)); // void function() pragma(msg, is(typeof(a) == delegate)); // nope! pragma(msg, is(typeof(a) == function)); // nope!

Re: function is not function

2012-09-21 Thread Ali Çehreli
On 09/21/2012 12:59 PM, Ellery Newcomer wrote: solution is to use std.traits, but can someone explain this to me? import std.stdio; void main() { auto a = { writeln(hi); }; pragma(msg, typeof(a)); // void function() pragma(msg, is(typeof(a) == delegate)); // nope! pragma(msg, is(typeof(a) ==

Re: function is not function

2012-09-21 Thread bearophile
Ellery Newcomer: import std.stdio; void main() { auto a = { writeln(hi); }; pragma(msg, typeof(a)); // void function() pragma(msg, is(typeof(a) == delegate)); // nope! pragma(msg, is(typeof(a) == function)); // nope! } There is a subtle difference between function

Re: function is not function

2012-09-21 Thread Ellery Newcomer
On 09/21/2012 01:10 PM, Ali Çehreli wrote: You have probably tried the following already: pragma(msg, is(typeof(a) == void function())); No, but that's also not very generic. void main() { auto a = { return 1; }; pragma(msg, is(typeof(a) == void function())); //

Re: function is not function

2012-09-21 Thread Ellery Newcomer
On 09/21/2012 01:17 PM, bearophile wrote: pragma(msg, is(typeof(a) == function)); // nope! code in pyd suggests this evaluated to true once upon a time.

Re: function is not function

2012-09-21 Thread Timon Gehr
On 09/21/2012 10:41 PM, Ellery Newcomer wrote: On 09/21/2012 01:17 PM, bearophile wrote: pragma(msg, is(typeof(a) == function)); // nope! code in pyd suggests this evaluated to true once upon a time. I don't think it ever did. It is just very easy to get wrong.

Re: function is not function

2012-09-21 Thread Jonathan M Davis
On Friday, September 21, 2012 12:59:31 Ellery Newcomer wrote: solution is to use std.traits, but can someone explain this to me? import std.stdio; void main() { auto a = { writeln(hi); }; pragma(msg, typeof(a)); // void function() pragma(msg, is(typeof(a) == delegate)); // nope!