monodevelop mono-d versions

2014-08-01 Thread sclytrack via Digitalmars-d-learn
I can't seem to install mono-d. It always seems to want a newer version of MonoDevelop. I'm on Ubuntu 14.04 LTS and it has version 4.0.12 of MonoDevelop. Has anybody else got this to work with this version? I have this file called MonoDevelop.D-1.9.6.mpack Tools-Add In Manager-Install

Re: why does isForwardRange work like this?

2014-08-01 Thread via Digitalmars-d-learn
On Friday, 1 August 2014 at 04:52:35 UTC, Jonathan M Davis wrote: On Thursday, 31 July 2014 at 22:21:10 UTC, Vlad Levenfeld wrote: Yes, I see the problem now. I can't think of any reason why I'd want to make save anything but a function (especially since `save` is a verb) but I guess someone

Re: monodevelop mono-d versions

2014-08-01 Thread Colin via Digitalmars-d-learn
On Friday, 1 August 2014 at 09:12:49 UTC, sclytrack wrote: I can't seem to install mono-d. It always seems to want a newer version of MonoDevelop. I'm on Ubuntu 14.04 LTS and it has version 4.0.12 of MonoDevelop. Has anybody else got this to work with this version? I have this file called

Re: monodevelop mono-d versions

2014-08-01 Thread Dicebot via Digitalmars-d-learn
On Friday, 1 August 2014 at 09:12:49 UTC, sclytrack wrote: I can't seem to install mono-d. It always seems to want a newer version of MonoDevelop. I'm on Ubuntu 14.04 LTS and it has version 4.0.12 of MonoDevelop. Has anybody else got this to work with this version? I have this file called

Re: monodevelop mono-d versions

2014-08-01 Thread Dicebot via Digitalmars-d-learn
On Friday, 1 August 2014 at 13:35:52 UTC, Colin wrote: Which is a pity, as it's otherwise a pretty nice IDE. Still, vim with NERDTree + dub on the command line. What more do you need? DCD vim plugin ;) https://github.com/Hackerpilot/DCD

Re: monodevelop mono-d versions

2014-08-01 Thread Colin via Digitalmars-d-learn
On Friday, 1 August 2014 at 13:15:25 UTC, Dicebot wrote: On Friday, 1 August 2014 at 09:12:49 UTC, sclytrack wrote: I can't seem to install mono-d. It always seems to want a newer version of MonoDevelop. I'm on Ubuntu 14.04 LTS and it has version 4.0.12 of MonoDevelop. Has anybody else got

Re: Checking for Callabilty of either f(x) or x.f

2014-08-01 Thread Nordlöw
On Friday, 1 August 2014 at 14:20:55 UTC, Nordlöw wrote: I'm currently developing a pretty printing system in D with backend support for text, html, mathml, latex, etc. See also: https://github.com/nordlow/justd/blob/master/pprint.d

Checking for Callabilty of either f(x) or x.f

2014-08-01 Thread Nordlöw
I'm currently developing a pretty printing system in D with backend support for text, html, mathml, latex, etc. To make it loosely decoupled in compile-time if currently make use __traits in the following way. static if (__traits(hasMember, arg, toHTML)) { if (viz.form ==

Re: Checking for Callabilty of either f(x) or x.f

2014-08-01 Thread Nordlöw
On Friday, 1 August 2014 at 14:20:55 UTC, Nordlöw wrote: A more flexible solution is to not require toX to be a member function of type specific (system) types to printed. My suggestions is something like __traits(compiles, auto x = arg.toMathML()) Is this my best option? The snippet

Re: monodevelop mono-d versions

2014-08-01 Thread michaelc37 via Digitalmars-d-learn
On Friday, 1 August 2014 at 09:12:49 UTC, sclytrack wrote: I'm on Ubuntu 14.04 LTS and it has version 4.0.12 of MonoDevelop. Has anybody else got this to work with this version? I have had no problems using this ppa ppa:ermshiperete/monodevelop it has packages for versions 4 and 5:

Re: Checking for Callabilty of either f(x) or x.f

2014-08-01 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Aug 01, 2014 at 02:20:53PM +, Nordlöw via Digitalmars-d-learn wrote: [...] What is the preffered (fast) way to check at compile-time if an instance x of a type T can be used *either* as f(x) or x.f? if (is(typeof(f(x))) || is(typeof(x.f))) Basically, is(X)

Re: How to detect current executable file name?

2014-08-01 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 18 February 2013 at 03:28:59 UTC, eGust wrote: I need to locate the directory of current executable file, but I can't find how to do that in Phobos. I tried core.runtime.Runtime.args[0], but failed. Is there a standard method of Phobos to do that? I only know the way of Windows

Re: why does isForwardRange work like this?

2014-08-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, 1 August 2014 at 11:51:55 UTC, Marc Schütz wrote: On Friday, 1 August 2014 at 04:52:35 UTC, Jonathan M Davis wrote: On Thursday, 31 July 2014 at 22:21:10 UTC, Vlad Levenfeld wrote: Yes, I see the problem now. I can't think of any reason why I'd want to make save anything but a

Re: why does isForwardRange work like this?

2014-08-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, 1 August 2014 at 19:59:16 UTC, Jonathan M Davis wrote: But since dup and idup aren't being implemented by lots of different people like the range API is, changing those doesn't risk breaking code where folks made it a variable. Well, I probably shouldn't put it quite that way,

Re: monodevelop mono-d versions

2014-08-01 Thread simendsjo via Digitalmars-d-learn
On 08/01/2014 03:15 PM, Dicebot wrote: (...) or use /opt/ bundle by simendsjo By Alexander Bothe. The files are just hosted at my domain.

Re: Emacs d-mode cannot handle backquoted backslashe

2014-08-01 Thread Nordlöw
On Thursday, 31 July 2014 at 10:04:57 UTC, Nordlöw wrote: Great! See also: https://stackoverflow.com/questions/25089090/emacs-d-mode-cannot-handle-backquoted-backslashes

Re: Checking for Callabilty of either f(x) or x.f

2014-08-01 Thread Nordlöw
On Friday, 1 August 2014 at 17:17:57 UTC, H. S. Teoh via Digitalmars-d-learn wrote: if (is(typeof(f(x))) || is(typeof(x.f))) Here's my try: template isCallableWith(alias fun, T) { enum bool isCallable = is(typeof(fun(T.init))) || is(typeof(T.init.fun)); } unittest { auto

unittest affects next unittest

2014-08-01 Thread sigod via Digitalmars-d-learn
Code: http://dpaste.dzfl.pl/51bd62138854 (It was reduced by DustMite.) Have I missed something about structs? Or this simply a bug?

Re: unittest affects next unittest

2014-08-01 Thread safety0ff via Digitalmars-d-learn
On Friday, 1 August 2014 at 23:09:39 UTC, sigod wrote: Code: http://dpaste.dzfl.pl/51bd62138854 (It was reduced by DustMite.) Have I missed something about structs? Or this simply a bug? Isn't this the same mistake as:

Is there a way to map associative arrays

2014-08-01 Thread Freddy via Digitalmars-d-learn
#!/usr/bin/rdmd import std.algorithm; import std.stdio; uint[uint] test; void main(){ test=[0:2 ,1:3 ,2:4]; writeln(test.map!(a=a-2)); } $ ./test.d ./test.d(8): Error: template std.algorithm.map cannot deduce function from argument types !((a) = a - 2)(uint[uint]), candidates

Re: Is there a way to map associative arrays

2014-08-01 Thread bearophile via Digitalmars-d-learn
Freddy: uint[uint] test; void main(){ test=[0:2 ,1:3 ,2:4]; writeln(test.map!(a=a-2)); } If you need keys or values you have .keys .values, .byKey, .byValue (the first two are eager). If you need both you are out of luck, and if you want to write safe code it's better to

Re: Is there a way to map associative arrays

2014-08-01 Thread Freddy via Digitalmars-d-learn
On Friday, 1 August 2014 at 23:22:06 UTC, bearophile wrote: Freddy: uint[uint] test; void main(){ test=[0:2 ,1:3 ,2:4]; writeln(test.map!(a=a-2)); } If you need keys or values you have .keys .values, .byKey, .byValue (the first two are eager). If you need both you are out

Re: Is there a way to map associative arrays

2014-08-01 Thread Brian Schott via Digitalmars-d-learn
On Friday, 1 August 2014 at 23:33:22 UTC, Freddy wrote: On Friday, 1 August 2014 at 23:22:06 UTC, bearophile wrote: Freddy: uint[uint] test; void main(){ test=[0:2 ,1:3 ,2:4]; writeln(test.map!(a=a-2)); } If you need keys or values you have .keys .values, .byKey, .byValue

Trouble linking to static library with Visual D

2014-08-01 Thread quakkels via Digitalmars-d-learn
Hello D'ers, I've been really impressed with Visual D and I've decided to undertake my first D project using Visual D in Visual Studio 2012. However, I've had trouble trying to figure out how to link a static library. I've outlined my situation in this Stack Overflow question.