On Tuesday, 9 October 2018 at 09:15:09 UTC, Gorker wrote:
Hi all,
I'm on macOS 10.11.6 with dmd 2.081.2 and I've a problem with
std.process.
---
gork ():foo gorker$ gcc -c -Iinclude -o foo.cpp.o src/foo.cpp
In file included from src/foo.cpp:2:
include/foo/foo.hpp:22:10: warning: scoped enumer
On Monday, 20 August 2018 at 17:52:17 UTC, QueenSvetlana wrote:
Great!
So I can't declare class level variables with auto, correct?
only local method variables?
You can use auto if you're setting the class level variable to a
default.
class X {
auto i = 42; // i will be an int
}
On Monday, 25 June 2018 at 17:45:01 UTC, zbr wrote:
Hi, this question is not specifically D related but I'll just
ask anyway. Consider the following snippet:
[...]
Your mistake is in your visualization :-)
But... more like:
0 < 4 ? true : mergeSort(0,2) && mergeSort(3, 4)
And so on.
I.e, t
On Thursday, 4 January 2018 at 17:45:35 UTC, Stijn wrote:
Why is it not allowed for a variable name to match a type name?
The following example fails with "Error: variable foo conflicts
with struct foo"
struct foo {}
foo foo;
How can the compiler know which symbol is which symbol if
On Sunday, 31 December 2017 at 13:32:03 UTC, aliak wrote:
Alo! I'm making a recursive concat function that is similar to
chain. The following code works:
[...]
I suspect it's because you've no 'else static if'.
D'oh!
Thanks Adam and Ali :)
Am I doing something wrong here?
real.max evaluates to: 1.18973e+4932
So, I'd expect to be able to store any value up to that... however
```
void main()
{
writeln("Real max: ", real.max);
foreach(i; 0..10){
writefln!("1024 ^^ %s = %s")(i, real(1024 ^^ i));
}
}
```
Output:
``
When running a small D program through rdmd, it seems the file
needs a .d extension to work.
```
$ ./testscript2
Error: module testscript2 is in file './testscript2.d' which
cannot be read
$ cat testscript2
#!/usr/bin/env rdmd
void main(string[] args){
import std.stdio;
writeln(args
On Saturday, 31 January 2015 at 14:26:45 UTC, RuZzz wrote:
The next version, which does not work:
https://bpaste.net/show/b9c85de68d07
I really dont understand what your trying to achieve here.
Maybe you can articulate it in one post what this class is trying
to achieve?
On Saturday, 31 January 2015 at 12:07:23 UTC, RuZzz wrote:
How to get amount of digit after point in a double for to get
integer from a double?
assert(amountAfterPoint(1.456) == 3);
assert(amountAfterPoint(0.6) == 5);
How about a loop like
import std.stdio;
void main(){
w
On Thursday, 15 January 2015 at 12:50:59 UTC, Rikki Cattermole
wrote:
On 16/01/2015 1:37 a.m., anonymous wrote:
On Thursday, 15 January 2015 at 12:10:09 UTC, Rikki Cattermole
wrote:
On 16/01/2015 12:16 a.m., anonymous wrote:
what's the right syntax for building a JSON tree ? I try to
do like i
On Tuesday, 13 January 2015 at 09:22:04 UTC, Colin wrote:
Have the following directory structure?
~/testModule$ find . -print
.
./net
./net/http_.d# **
./net/http
./net/http/Mod1.d
./net/http/Mod2.d
./main.d
** I put the _ here to make it seperate from the net/http
directory. Probably, a be
Have the following directory structure?
~/testModule$ find . -print
.
./net
./net/http_.d# **
./net/http
./net/http/Mod1.d
./net/http/Mod2.d
./main.d
** I put the _ here to make it seperate from the net/http
directory. Probably, a better solution exists, this was hacked
together quickly :)
On Monday, 5 January 2015 at 15:00:05 UTC, Bauss wrote:
On Monday, 5 January 2015 at 12:54:00 UTC, Gary Willoughby
wrote:
On Monday, 5 January 2015 at 11:49:32 UTC, Bauss wrote:
Is it possible to compile for other OS's on Windows using dmd?
This is what's known as cross compiling and is not c
On Thursday, 18 December 2014 at 22:29:30 UTC, Ali Çehreli wrote:
On 12/18/2014 02:51 AM, Colin wrote:
> > vi, and it does indeed have a '\n' at the end of file.
>
> Ah, I see. That's a little annoying.
It looks like there are ways of dealing with it:
http://stackoverflow.com/questions/105064
On Thursday, 18 December 2014 at 10:43:32 UTC, yazd wrote:
On Thursday, 18 December 2014 at 10:16:38 UTC, Colin wrote:
On Thursday, 18 December 2014 at 09:25:47 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 18 Dec 2014 09:18:35 +
Colin via Digitalmars-d-learn
wrote:
Why does
On Thursday, 18 December 2014 at 09:25:47 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 18 Dec 2014 09:18:35 +
Colin via Digitalmars-d-learn
wrote:
Why does std.file.readText() append a Line Feed char onto the
end of the string?
I have a file with the following contents in it
Why does std.file.readText() append a Line Feed char onto the end
of the string?
I have a file with the following contents in it:
Name = Int
Other=Float
One More = String(Random;)
I then have the code:
void main(string[] args){
const text = "Name = Int
Other
On Thursday, 23 October 2014 at 21:17:23 UTC, Jonathan M Davis
wrote:
On Thursday, 23 October 2014 at 11:13:26 UTC, Colin wrote:
Hi,
I'm looking for an easy way to parse a dates into a datetime
object.
Most of my dates will be of the form:
mmm dd, HH:MM AM|PM
So like: "May 30, 2014 12:
Hi,
I'm looking for an easy way to parse a dates into a datetime
object.
Most of my dates will be of the form:
mmm dd, HH:MM AM|PM
So like: "May 30, 2014 12:12 PM"
I can easily write a regex or whatever to pull these out of that
one format, but it's not guaranteed they'll all be in the
On Thursday, 11 September 2014 at 14:49:03 UTC, bearophile wrote:
Daniel Kozak:
You can just use min:
import std.stdio, std.algorithm;
struct Thing {
uint x;
alias x this;
}
alias minimum = reduce!min;
void main() {
immutable ar1 = [10, 20, 30, 40, 50];
ar1.minimum.wr
On Thursday, 11 September 2014 at 13:27:39 UTC, Daniel Kozak
wrote:
On Thursday, 11 September 2014 at 13:06:05 UTC, Colin wrote:
I have this test code:
struct Thing {
uint x;
}
void main(){
uint[] ar1 = [1, 2, 3, 4, 5];
auto min1 = ar1.reduce!((a,b) => a < b);
writefln("%s", min1);
I have this test code:
struct Thing {
uint x;
}
void main(){
uint[] ar1 = [1, 2, 3, 4, 5];
auto min1 = ar1.reduce!((a,b) => a < b);
writefln("%s", min1); // prints 1 as expected
Thing[] ar2 = [Thing(1), Thing(2), Thing(4)];
auto min2 = ar2.reduce!((a,b) => a.x < b.x);
On Monday, 25 August 2014 at 17:57:54 UTC, Ryan wrote:
Anyone know MonoDevelop?
Why is the "Edit References" context menu item missing. I have
it at the top (Project->Edit References...) but when I click it
nothing happens. Grrr.
I couldnt figure it out either tbh (creating dub projects usi
On Wednesday, 20 August 2014 at 20:18:15 UTC, Dicebot wrote:
On Wednesday, 20 August 2014 at 20:01:05 UTC, Colin wrote:
I see 3 distinct parts playing a role in my confusion:
A) The 'is' keyword. What does it do when you have
is(expression);
http://dlang.org/expression.html#IsExpression
It i
Hi,
I'm implementing some template checks on some types I'm using in
a project, and went to phobos for some indications on how to use
them.
In std.range, I see this construct quite a bit:
template isInputRange(R)
{
enum bool isInputRange = is(typeof(
(inout int = 0)
{
R r
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 th
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
On Wednesday, 11 June 2014 at 15:14:19 UTC, Colin wrote:
On Wednesday, 11 June 2014 at 14:28:49 UTC, belkin wrote:
On Wednesday, 11 June 2014 at 14:02:08 UTC, John Colvin wrote:
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Example: I have this C function that is compiled into a
li
On Wednesday, 11 June 2014 at 14:28:49 UTC, belkin wrote:
On Wednesday, 11 June 2014 at 14:02:08 UTC, John Colvin wrote:
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Example: I have this C function that is compiled into a
library
//File: factorial.h
int factorial(int n);
//File
30 matches
Mail list logo