Re: Error: no property "someFont" for type int

2015-11-10 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 06:37:44 UTC, Marco de Wild wrote: In directory.d: using style; This is not D. It should be giving you a compiler error. How are you compiling? Or did you type 'using' in the post by mistake? Anyway, what you want is: import style; In style.d: module

Re: Error: no property "someFont" for type int

2015-11-10 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 07:46:31 UTC, Mike Parker wrote: Text is from the module dsfml.text.graphics, it has an enum And of course, I meant dsfml.graphics.text.

Error: no property "someFont" for type int

2015-11-10 Thread Marco de Wild via Digitalmars-d-learn
I'm trying to build a small manga reader application (because why search the internet if you can build it yourself), using DSFML. However, I'm getting a weird compilation error that I can't decrypt. In directory.d: using style; (...) _text = new Text; with(_text) { setFont(Style.DirectoryF

OSX Foundation framework D binding

2015-11-10 Thread Vadim Lopatin via Digitalmars-d-learn
Hello, I'm working on native Cocoa backend for DlangUI GUI library under OSX. Is there any ready to use bindings for easy accessing Cocoa API? Probably, there is some HelloWorld program which creates window and draws something? Best regards, Vadim

DUB library prefix - rules ?

2015-11-10 Thread BBaz via Digitalmars-d-learn
quoted from the website: Sets the base name of the output file; type and platform specific pre- and suffixes are added automatically - this setting does not support platform suffixes I must be blind but I can't find the code that adds the 'lib' prefix on GitHub. I need to check something:

Re: std.experimental.allocator optlink error

2015-11-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/11/15 5:17 PM, Dustin Walker wrote: On Monday, 9 November 2015 at 14:42:01 UTC, ref2401 wrote: Hello I wrote a small hello world app and imported the `std.experimental.allocator` module. I'm getting the following optlink error: --- OPTLINK (

Re: std.experimental.allocator optlink error

2015-11-10 Thread Dustin Walker via Digitalmars-d-learn
On Monday, 9 November 2015 at 14:42:01 UTC, ref2401 wrote: Hello I wrote a small hello world app and imported the `std.experimental.allocator` module. I'm getting the following optlink error: --- OPTLINK (R) for Win32 Release 8.00.17 Copyright (

Re: Multiple range enumeration

2015-11-10 Thread cym13 via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 02:38:19 UTC, puming wrote: Hi, If I have multiple ranges, say: auto a = [1, 2, 3]; auto b = ["a", "b", "c"]; auto c = ["x", "y", "z"]; I'd like a composition range that enumerate all combinations of these ranges, having the same effect as a nested foreach l

Re: Multiple range enumeration

2015-11-10 Thread puming via Digitalmars-d-learn
On Wednesday, 11 November 2015 at 02:55:25 UTC, cym13 wrote: On Wednesday, 11 November 2015 at 02:38:19 UTC, puming wrote: Hi, If I have multiple ranges, say: auto a = [1, 2, 3]; auto b = ["a", "b", "c"]; auto c = ["x", "y", "z"]; I'd like a composition range that enumerate all combinations

Multiple range enumeration

2015-11-10 Thread puming via Digitalmars-d-learn
Hi, If I have multiple ranges, say: auto a = [1, 2, 3]; auto b = ["a", "b", "c"]; auto c = ["x", "y", "z"]; I'd like a composition range that enumerate all combinations of these ranges, having the same effect as a nested foreach loop: foreach (i; a) { foreach (j; b) { foreach (k; c) {

Re: opCmp with structs

2015-11-10 Thread anonymous via Digitalmars-d-learn
On 07.11.2015 16:59, anonymous wrote: Wat. It even compiles with @safe. That's not good. Filed an issue: https://issues.dlang.org/show_bug.cgi?id=15315

Re: Feature for paranoids

2015-11-10 Thread ponce via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 20:37:00 UTC, Fyodor Ustinov wrote: assert(false) AKA assert(0) - is a part of this language that I think it is absolute evil. WBR, Fyodor. I would say it's a minor evil, that create problems by needing an explanation. At this point it has been discusse

Re: Feature for paranoids

2015-11-10 Thread Fyodor Ustinov via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 20:46:14 UTC, cym13 wrote: I don't quite get why you'd like to use -release if you are paranoid enough to be afraid of assert(0)'s little difference in behaviour. Could you give a realistic use case? At the very least seeing why it is important to you can only b

Re: Feature for paranoids

2015-11-10 Thread cym13 via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 13:09:09 UTC, Fyodor Ustinov wrote: Hi! Is it possible when using the "-release" indicate that this one in/out/invariant/assert should not to be disabled? WBR, Fyodor. I don't quite get why you'd like to use -release if you are paranoid enough to be afra

Re: Feature for paranoids

2015-11-10 Thread Fyodor Ustinov via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 15:44:26 UTC, ponce wrote: Since assert(false) is special (cf. http://p0nce.github.io/d-idioms/#assert%28false%29-is-special) you can use the following construct to have always-on assert(false) AKA assert(0) - is a part of this language that I think it is abso

Re: AliasSeq + isExpression type specialization behavior

2015-11-10 Thread Alex Parrill via Digitalmars-d-learn
On Monday, 9 November 2015 at 22:41:50 UTC, Brian Schott wrote: Given the following code: ``` import std.meta; static assert(is(char : dchar)); static assert(is(AliasSeq!(int, char) : AliasSeq!(int, char))); static assert(is(AliasSeq!(int, char) : AliasSeq!(int, dchar))); ``` The third static a

Re: AliasSeq + isExpression type specialization behavior

2015-11-10 Thread Marc Schütz via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 13:47:23 UTC, Brian Schott wrote: On Tuesday, 10 November 2015 at 10:28:45 UTC, Marc Schütz wrote: This fails, too: static assert(is(AliasSeq!(char) : AliasSeq!(dchar))); Which makes sense IMO, because it can be thought of as an unnamed struct, cp. the following

Re: Deprecation: module std.stream is deprecated

2015-11-10 Thread Spacen Jasset via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 11:57:03 UTC, Jonathan M Davis wrote: ... building blocks rather than kitchen sinks. And most range-based ... I still can't really see why byChunk and byLine are part of the File API? Especially byLine, I'll get byChunk go for now. I think what I am trying to

Re: Feature for paranoids

2015-11-10 Thread ponce via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 13:09:09 UTC, Fyodor Ustinov wrote: Hi! Is it possible when using the "-release" indicate that this one in/out/invariant/assert should not to be disabled? WBR, Fyodor. Since assert(false) is special (cf. http://p0nce.github.io/d-idioms/#assert%28false%29

Re: Feature for paranoids

2015-11-10 Thread Kagamin via Digitalmars-d-learn
I wouldn't recommend release mode to paranoids. I personally use `debug invariant` and `debug assert` for purely debugging code.

Re: When a variable is passed into a function, is its name kept somewhere for the function to acceess

2015-11-10 Thread DLangLearner via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 14:22:49 UTC, Gary Willoughby wrote: On Tuesday, 10 November 2015 at 14:14:33 UTC, DlangLearner wrote: Please enlighten me if this can be done, thanks. If i understand you, you could use a templated function: import std.stdio; void foo(alias a)() { writefl

Re: why does this error out?

2015-11-10 Thread steven kladitis via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 05:14:29 UTC, lobo wrote: On Tuesday, 10 November 2015 at 04:34:22 UTC, Cauterite wrote: Here's the output I get (DMD v2.068.2): [1, 3, 10, 12, 21, 30, 100, 102, 111, 120, 201, 210] core.exception.AssertError@std\range\package.d(4603): Assertion failure iota.f

Re: When a variable is passed into a function, is its name kept somewhere for the function to acceess

2015-11-10 Thread Gary Willoughby via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 14:14:33 UTC, DlangLearner wrote: Please enlighten me if this can be done, thanks. If i understand you, you could use a templated function: import std.stdio; void foo(alias a)() { writefln("%s was passed in.", a.stringof); } void main(string[] args) {

When a variable is passed into a function, is its name kept somewhere for the function to acceess

2015-11-10 Thread DlangLearner via Digitalmars-d-learn
Here is what I want to know: when a function is called, does this function can recovery the information about which variables pass their values into this function's arguments. I use the following example to show what I want to know. void main(){ int a = 1; writeln(fun(a.stringo

Re: AliasSeq + isExpression type specialization behavior

2015-11-10 Thread Brian Schott via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 10:28:45 UTC, Marc Schütz wrote: This fails, too: static assert(is(AliasSeq!(char) : AliasSeq!(dchar))); Which makes sense IMO, because it can be thought of as an unnamed struct, cp. the following: struct A { char c; } struct B { dchar c; } static assert(is(A :

Re: String interpolation

2015-11-10 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 12:40:07 UTC, Márcio Martins wrote: writeln(interp!"The number #{a} is less than #{b}"); Quite pleasant syntax this way :) Not sure if it's feasible to do this on the language side. Yes. Here a (stupid!) proof of concept: http://dpaste.dzfl.pl/74b1a4e3c8c6

Feature for paranoids

2015-11-10 Thread Fyodor Ustinov via Digitalmars-d-learn
Hi! Is it possible when using the "-release" indicate that this one in/out/invariant/assert should not to be disabled? WBR, Fyodor.

Re: String interpolation

2015-11-10 Thread Márcio Martins via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 11:29:32 UTC, TheFlyingFiddle wrote: On Tuesday, 10 November 2015 at 10:41:52 UTC, tired_eyes wrote: On Tuesday, 10 November 2015 at 10:33:30 UTC, Tobias Pankrath wrote: Ruby: a = 1 b = 4 puts "The number #{a} is less than #{b}" PHP: $a = 1; $b = 4; echo "The nu

Re: String interpolation

2015-11-10 Thread tired_eyes via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 11:29:32 UTC, TheFlyingFiddle wrote: On Tuesday, 10 November 2015 at 10:41:52 UTC, tired_eyes wrote: On Tuesday, 10 November 2015 at 10:33:30 UTC, Tobias Pankrath wrote: Ruby: a = 1 b = 4 puts "The number #{a} is less than #{b}" PHP: $a = 1; $b = 4; echo "The nu

Re: @property

2015-11-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, November 10, 2015 09:53:42 Gary Willoughby via Digitalmars-d-learn wrote: > On Monday, 9 November 2015 at 22:42:16 UTC, Fyodor Ustinov wrote: > > If this feature will be removed, it will be very lacking code, > > like: > > > > writeln = "Hello, world!"; > > > > :) > > WBR, > > Fyod

Re: String interpolation

2015-11-10 Thread tcak via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 11:22:56 UTC, wobbles wrote: On Tuesday, 10 November 2015 at 10:41:52 UTC, tired_eyes wrote: On Tuesday, 10 November 2015 at 10:33:30 UTC, Tobias Pankrath wrote: On Tuesday, 10 November 2015 at 10:21:32 UTC, tired_eyes wrote: [...] std.string.format and std.fo

Re: Deprecation: module std.stream is deprecated

2015-11-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, November 08, 2015 14:41:05 Spacen Jasset via Digitalmars-d-learn wrote: > This looks the simplest solution at the moment: > > >> auto inputRange = File(__FILE__).byChunk(1024).joiner; > >> Foo foo = Foo(inputRange); > > But it doesn't seem efficient and strays off the conceptual

Dhee - tiny app to learn/try out D

2015-11-10 Thread Shriramana Sharma via Digitalmars-d-learn
I wrote up a small PyQt app to help me do quick coding of snippets in D to help me learn how D works. https://github.com/jamadagni/dhee I wish there was (a working) QtD so I wouldn't need to use Python, but well... Looked into GtkD a bit, but somehow Gtk never clicked with me... P.S.: I only c

Re: std.experimental.allocator optlink error

2015-11-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/11/15 12:05 AM, uiop wrote: On Tuesday, 10 November 2015 at 10:34:56 UTC, ref2401 wrote: On Tuesday, 10 November 2015 at 08:48:37 UTC, ref2401 wrote: On Tuesday, 10 November 2015 at 01:04:16 UTC, uiop wrote: Can you find the sources in your setup ? Any chance that that phobos.lib is stil

Re: String interpolation

2015-11-10 Thread TheFlyingFiddle via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 10:41:52 UTC, tired_eyes wrote: On Tuesday, 10 November 2015 at 10:33:30 UTC, Tobias Pankrath wrote: Ruby: a = 1 b = 4 puts "The number #{a} is less than #{b}" PHP: $a = 1; $b = 4; echo "The number $a is less than $b"; D: ??? int a = 1, b = 4; writefln("The nu

Re: String interpolation

2015-11-10 Thread wobbles via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 10:41:52 UTC, tired_eyes wrote: On Tuesday, 10 November 2015 at 10:33:30 UTC, Tobias Pankrath wrote: On Tuesday, 10 November 2015 at 10:21:32 UTC, tired_eyes wrote: [...] std.string.format and std.format are the standard options. What are you missing? Ruby:

Re: std.experimental.allocator optlink error

2015-11-10 Thread uiop via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 10:34:56 UTC, ref2401 wrote: On Tuesday, 10 November 2015 at 08:48:37 UTC, ref2401 wrote: On Tuesday, 10 November 2015 at 01:04:16 UTC, uiop wrote: Can you find the sources in your setup ? Any chance that that phobos.lib is still the the one distributed with dmd

Re: String interpolation

2015-11-10 Thread tired_eyes via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 10:33:30 UTC, Tobias Pankrath wrote: On Tuesday, 10 November 2015 at 10:21:32 UTC, tired_eyes wrote: Hi, The only example of string interpolation I've found so far is on Rosetta Code: void main() { import std.stdio, std.string; "Mary had a %s lamb.".fo

Re: std.experimental.allocator optlink error

2015-11-10 Thread ref2401 via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 08:48:37 UTC, ref2401 wrote: On Tuesday, 10 November 2015 at 01:04:16 UTC, uiop wrote: Can you find the sources in your setup ? Any chance that that phobos.lib is still the the one distributed with dmd 2.068 ? How can I do that? When you setup dmd 2.069, did y

Re: String interpolation

2015-11-10 Thread Tobias Pankrath via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 10:21:32 UTC, tired_eyes wrote: Hi, The only example of string interpolation I've found so far is on Rosetta Code: void main() { import std.stdio, std.string; "Mary had a %s lamb.".format("little").writeln; "Mary had a %2$s %1$s lamb.".format("littl

Re: String interpolation

2015-11-10 Thread wobbles via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 10:21:32 UTC, tired_eyes wrote: Hi, The only example of string interpolation I've found so far is on Rosetta Code: void main() { import std.stdio, std.string; "Mary had a %s lamb.".format("little").writeln; "Mary had a %2$s %1$s lamb.".format("littl

Re: AliasSeq + isExpression type specialization behavior

2015-11-10 Thread Marc Schütz via Digitalmars-d-learn
On Monday, 9 November 2015 at 22:41:50 UTC, Brian Schott wrote: Given the following code: ``` import std.meta; static assert(is(char : dchar)); static assert(is(AliasSeq!(int, char) : AliasSeq!(int, char))); static assert(is(AliasSeq!(int, char) : AliasSeq!(int, dchar))); ``` The third static a

String interpolation

2015-11-10 Thread tired_eyes via Digitalmars-d-learn
Hi, The only example of string interpolation I've found so far is on Rosetta Code: void main() { import std.stdio, std.string; "Mary had a %s lamb.".format("little").writeln; "Mary had a %2$s %1$s lamb.".format("little", "white").writeln; } Is this a "proper" way of string inter

Re: phobos: What type to use instead of File when doing I/O on streams?

2015-11-10 Thread Kagamin via Digitalmars-d-learn
On Monday, 9 November 2015 at 19:42:53 UTC, J.Frank wrote: - Can you flush() a range? - Can you use select() on a range? Maybe you should factor out a function that does pure data processing on arbitrary ranges and manage sources of the ranges - opening, flushing and closing files - in the c

Re: @property

2015-11-10 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 9 November 2015 at 22:42:16 UTC, Fyodor Ustinov wrote: If this feature will be removed, it will be very lacking code, like: writeln = "Hello, world!"; :) WBR, Fyodor. The feature is not being removed. Only the @property attribute and compiler check is being removed.

Re: @property

2015-11-10 Thread Kagamin via Digitalmars-d-learn
It was intended for stricter properties. See http://dlang.org/changelog/2.069.0.html#property-switch-deprecated Last iteration on it was http://wiki.dlang.org/DIP23

Re: std.experimental.allocator optlink error

2015-11-10 Thread Xiaoxi via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 01:04:16 UTC, uiop wrote: Can you find the sources in your setup ? Any chance that that phobos.lib is still the the one distributed with dmd 2.068 ? When you setup dmd 2.069, did you use the 7z or installer ? i have the same issue. i used the installer. i only h

Re: std.experimental.allocator optlink error

2015-11-10 Thread ref2401 via Digitalmars-d-learn
On Tuesday, 10 November 2015 at 01:04:16 UTC, uiop wrote: Can you find the sources in your setup ? Any chance that that phobos.lib is still the the one distributed with dmd 2.068 ? How can I do that? When you setup dmd 2.069, did you use the 7z or installer ? Installer always btw. Thanks f