Re: RSA library

2016-08-18 Thread Andre via Digitalmars-d-learn
On Thursday, 18 August 2016 at 14:29:54 UTC, Adam D. Ruppe wrote: On Thursday, 18 August 2016 at 09:00:58 UTC, Andre Pany wrote: Is there a D library which can be built with a plain x86 DMD and without dll dependencies? Not that I know of, and I don't think the win32 api includes rsa256

Re: string mixin and alias

2016-07-29 Thread Andre via Digitalmars-d-learn
On Friday, 29 July 2016 at 18:39:23 UTC, Jesse Phillips wrote: On Friday, 29 July 2016 at 18:34:56 UTC, Jesse Phillips wrote: Here the generateCode() is mixed in to the context of foo(), which is fine if your code is performing actions but is no good if you're creating declarations that you

Re: JSONValue floating and 42

2016-04-19 Thread Andre via Digitalmars-d-learn
On Tuesday, 19 April 2016 at 13:58:05 UTC, Edwin van Leeuwen wrote: On Tuesday, 19 April 2016 at 13:44:08 UTC, Andre wrote: -> I need to analyze every value whether it is a floating or an integer? This is the correct option. Something like: double f; if (j["value"].type == JSON_TYPE.INTEGER)

JSONValue floating and 42

2016-04-19 Thread Andre via Digitalmars-d-learn
Hi, I have to deal with a JSON like this [{"value":42},{"value":1e+100}] Value is a floating number, but the providing system does not write 42 as 42.00. While trying to get the value with .floating, I get an exception because 42 is not a floating value. I try to understand what is the

Re: Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Andre via Digitalmars-d-learn
On Friday, 8 April 2016 at 14:56:51 UTC, Adam D. Ruppe wrote: On Friday, 8 April 2016 at 14:38:10 UTC, Andre wrote: Therefore I use std.conv.text to convert the string enum? to string. That converts the *name* of the enum to string, not the contents. (BTW, I think the name of the enum is

Some strange behaviors of enums and string.startsWith

2016-04-08 Thread Andre via Digitalmars-d-learn
Hi, I have some issues with enums. Please have a look at the last 3 assertions. It is annoying that I cannot directly use my StringEnum for startsWith. Therefore I use std.conv.text to convert the string enum? to string. But then the assertion fails, that is very strange, it fails only for

Re: Issue with 2.071: Regression or valid error?

2016-04-06 Thread Andre via Digitalmars-d-learn
On Wednesday, 6 April 2016 at 19:22:44 UTC, Daniel Kozak wrote: This should not compile. Cat cant access create because it is private. Ok it can access it but only if you move cat into same module as animal Dne 6. 4. 2016 17:16 napsal uživatel "Andre via Digitalmars-d-learn" <

Issue with 2.071: Regression or valid error?

2016-04-06 Thread Andre via Digitalmars-d-learn
Hi, With 2.071 following coding does not compile anymore and somehow I feel it should compile. The issue is with line "cat.create();". Cat is a sub type of Animal. Animal "owns" method create and I want to call the method create within the class Animal for cat. Is the error message "no

Re: dub, copyFiles and linux

2016-03-30 Thread Andre via Digitalmars-d-learn
OK solved;) Shared libraries doesn't need to be mentioned in libs section in dub. Therefore copying after the linking is correct and is working fine. Kind regards André

Re: dub, copyFiles and linux

2016-03-30 Thread Andre via Digitalmars-d-learn
On Thursday, 31 March 2016 at 04:57:01 UTC, Andre wrote: I can't see why it is working with vibe-d projects (openssl libraries copied to application folder) but not for my project. There is no console output "copying files for..." while using dub for my application project. What is wrong?

dub, copyFiles and linux

2016-03-30 Thread Andre via Digitalmars-d-learn
Hi, I created a library which uses some shared objects. The dub.json looks like this: { "name": "sec", "configurations": [ { "name": "debug", "targetType": "library",

Re: Usage of custom class with JSONValue

2016-03-24 Thread Andre via Digitalmars-d-learn
On Thursday, 24 March 2016 at 16:03:13 UTC, Edwin van Leeuwen wrote: On Thursday, 24 March 2016 at 11:39:13 UTC, arturg wrote: isnt alias this supposed to do this implicitly? convert this auto jsValue = JSONValue(new MyClass()); into this auto jsValue = JSONValue((new MyClass())._data);

Usage of custom class with JSONValue

2016-03-24 Thread Andre via Digitalmars-d-learn
Hi, I have a class which has already an alias this to a string array, so I can use it in a foreach loop. class MyClass { string[] _data; alias _data this; // ... } void main() { import std.json; auto jsValue = JSONValue(new MyClass()); } For some

Re: Determine decimal separator (comma vs point)

2016-03-07 Thread Andre via Digitalmars-d-learn
On Monday, 7 March 2016 at 12:29:39 UTC, Andre wrote: Hi, I execute an external application and get some decimal numbers: auto p = execute(["curl", "-o", "/dev/null", "-s", "-w",

Determine decimal separator (comma vs point)

2016-03-07 Thread Andre via Digitalmars-d-learn
Hi, I execute an external application and get some decimal numbers: auto p = execute(["curl", "-o", "/dev/null", "-s", "-w", "%{time_namelookup}:%{time_appconnect}:%{time_redirect}:%{time_starttransfer}:%{time_pretransfer}:%{time_connect}:%{time_total}", url]);

Re: Issues

2016-02-23 Thread Andre via Digitalmars-d-learn
On Tuesday, 23 February 2016 at 19:53:52 UTC, Johan Engelen wrote: On Monday, 22 February 2016 at 23:21:28 UTC, Jonathan M Davis wrote: Well, if you'll notice th list of resolved issues is going up way faster than the list of new issues. (To put some oil on the fire:) But the number of

Re: Issues

2016-02-23 Thread Andre via Digitalmars-d-learn
On Tuesday, 23 February 2016 at 00:13:23 UTC, ag0aep6g wrote: On 22.02.2016 23:56, Andre wrote: I was wondering how people in this D community think about the number of issues with NEW status... It could scare individuals/organizations to start with D, when they get the impression that there

Issues

2016-02-22 Thread Andre via Digitalmars-d-learn
I was wondering how people in this D community think about the number of issues with NEW status... It could scare individuals/organizations to start with D, when they get the impression that there are a large and growing number of issues that are open (for years). I know this is not a fair

cast fails for classes from windows dll

2016-01-12 Thread Andre via Digitalmars-d-learn
Hi, I am not sure, whether this is a current limitation of the windows dll functionality of D or I am doing s.th. which will not work. I have developed in D a windows DLL which creates class instances by passing the name (using object.factory method). In another D application I am using

Re: Runtime.unloadLibrary terminates application on Windows

2015-12-14 Thread Andre via Digitalmars-d-learn
On Monday, 14 December 2015 at 17:50:26 UTC, Andre wrote: Hi, there is an issue with the example from http://wiki.dlang.org/Win32_DLLs_in_D While executing the DYNAMIC_LOAD version, the application will exit on statement: if (!Runtime.unloadLibrary(h)) Neither "error freeing mydll.dll" nor

Re: Runtime.unloadLibrary terminates application on Windows

2015-12-14 Thread Andre via Digitalmars-d-learn
On Monday, 14 December 2015 at 19:17:00 UTC, Andre wrote: It seems to be a regression https://issues.dlang.org/show_bug.cgi?id=1550 I will open a ticket for this issue https://issues.dlang.org/show_bug.cgi?id=15443

Runtime.unloadLibrary terminates application on Windows

2015-12-14 Thread Andre via Digitalmars-d-learn
Hi, there is an issue with the example from http://wiki.dlang.org/Win32_DLLs_in_D While executing the DYNAMIC_LOAD version, the application will exit on statement: if (!Runtime.unloadLibrary(h)) Neither "error freeing mydll.dll" nor "End..." is written to the console. The application just

Forward declaration issue

2015-12-04 Thread Andre via Digitalmars-d-learn
Hi, I have a strange issue with following coding. void baz(); // forward declaration void foo() { void bar() { baz(); // (1) without f.d. syntax error } void baz() { bar(); } baz(); // (2)

Re: Forward declaration issue

2015-12-04 Thread Andre via Digitalmars-d-learn
On Friday, 4 December 2015 at 09:51:30 UTC, Artur Skawina wrote: No, it's how D is designed -- inside functions the order of declarations matters (and forward declarations don't work). Your version wrongly declares another `baz` at module scope, and, as there's no definition, you end up with

Re: utils.toBulkString is not accesible from utils

2015-12-02 Thread Andre via Digitalmars-d-learn
On Wednesday, 2 December 2015 at 12:37:29 UTC, Marc Schütz wrote: I think so, yes. But according to digger, the current behaviour goes back to at least DMD 2.052. Please file a bug report anyway. Bug report filed https://issues.dlang.org/show_bug.cgi?id=15395

utils.toBulkString is not accesible from utils

2015-12-01 Thread Andre via Digitalmars-d-learn
Hi, for following coding there is an error during compilation: module utils; package string toBulkString(string s) { import std.string: format; return "$%s\r\n%s\r\n".format(s.length, s); } unittest { string actual = "foobar".toBulkString();

Re: experimental.logger: safe function and stdou

2015-11-18 Thread Andre via Digitalmars-d-learn
On Thursday, 19 November 2015 at 06:27:58 UTC, Andre wrote: override void writeLogMsg(ref LogEntry payload) { with (payload) { _stdOutLogger.logf(logLevel, `{ "file":"%s", "line":%s, "funcName":"%s", "prettyFuncName":"%s",

experimental.logger: safe function and stdou

2015-11-18 Thread Andre via Digitalmars-d-learn
Hi, I want to write log entries to stdout in JSON format. Therefore I created a customer logger. Unfortunatelly there are 2 errors with following implementation: module logger; import std.experimental.logger; import std.stdio: stdout; class MyCustomLogger : Logger { private FileLogger

win32 from master: unicode functions by default?

2015-11-11 Thread Andre via Digitalmars-d-learn
Hi, by using the win32 library from master, the functions aliases to the ansi windows functions (...A) instead of the unicode functions (...W). Is there a way to control this behavior beside using the explicit function names (A/W)? Kind regards André

Re: win32 from master: unicode functions by default?

2015-11-11 Thread Andre via Digitalmars-d-learn
On Thursday, 12 November 2015 at 05:08:25 UTC, Mike Parker wrote: On Thursday, 12 November 2015 at 04:58:42 UTC, Andre wrote: Hi, by using the win32 library from master, the functions aliases to the ansi windows functions (...A) instead of the unicode functions (...W). Is there a way to

Ternary if and ~ does not work quite well

2015-10-11 Thread Andre via Digitalmars-d-learn
Hi, I am not sure, whether the output of following coding is correct: import std.stdio; void main() { writeln("foo "~ true ? "bar" : "baz"); writeln("foo "~ false ? "bar" : "baz"); // assert("foo "~ true ? "bar" : "baz" == "foo bar"); does not compile } Output: bar bar I

Re: Ternary if and ~ does not work quite well

2015-10-11 Thread Andre via Digitalmars-d-learn
On Monday, 12 October 2015 at 05:25:46 UTC, H. S. Teoh wrote: On Mon, Oct 12, 2015 at 05:19:38AM +, Andre via Digitalmars-d-learn wrote: [...] [...] It's best to parenthesize when mixing other operators with ?, because ? has a pretty low precedence and may "steal" argum

Re: Final templated interface method not found

2015-09-16 Thread Andre via Digitalmars-d-learn
Thanks, it works like a charme. Kind regards André

Final templated interface method not found

2015-09-15 Thread Andre via Digitalmars-d-learn
Hi, following coding shoud work, or? It doesn't compile with v2.068.0. Kind regards André interface IfStatement { void execute(); final void execute(T...)(T t) { execute(); } } class Statement: IfStatement { void execute(){} }

Definition of SIGRTMIN

2015-08-31 Thread Andre via Digitalmars-d-learn
Hi, I cannot use the definition of SIGRTMIN on ubuntu. For following code I receive errors: import core.sys.posix.time, core.sys.posix.signal, core.sys.posix.stdlib, core.sys.posix.unistd; import std.stdio; alias SIG = SIGRTMIN; void main() { writeln("Establishing handler for signal

Re: PrimitiveRef ?

2015-03-23 Thread Andre via Digitalmars-d-learn
Thanks a lot. I read it in the D Cookbook from Adam D. Ruppe. In the chapter of memory management there is a topic, how to build reference counted objects. Here this construct is explained. Kind regards André On Monday, 23 March 2015 at 20:58:48 UTC, Namespace wrote: Something like that?

PrimitiveRef ?

2015-03-23 Thread Andre via Digitalmars-d-learn
Hi, I read that if a structure only contains a reference, it will behave like a reference type in function calls (needed for specifying reference behavior in a type tuple). I need exactly that behavior. I am currently unsure whether it is possible at all to have such a construct which works

Re: How to use UFCS and std.algorithm.sort?

2015-03-10 Thread Andre via Digitalmars-d-learn
Thanks a lot! Kind regards André On Tuesday, 10 March 2015 at 08:40:28 UTC, Jonathan M Davis wrote: On Tuesday, March 10, 2015 07:24:52 Andre via Digitalmars-d-learn wrote: Hi, with the new beta I get the warning I should use std.algorithm.sort instead the .sort property. I thought

Re: 2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Andre via Digitalmars-d-learn
Thanks a lot! Kind regards André On Tuesday, 10 March 2015 at 09:25:02 UTC, Meta wrote: On Tuesday, 10 March 2015 at 08:37:46 UTC, Jonathan M Davis wrote: It's the base type that isn't implicitly convertible to the enum type. Err, yes. I had that the wrong way around. Anyway, I filed an

2.067 Beta: Behavior of enum and ref changed

2015-03-10 Thread Andre via Digitalmars-d-learn
Hi, following coding raises a compiler error with the beta of 2.067. Is this error intended or not? It is working if I change first line of main to: ulong bits; enum Bits: ulong { none = 0 } bool hasBit(ref ulong rBits, ulong rBit) { return cast(bool)(rBits rBit); } void

How to use UFCS and std.algorithm.sort?

2015-03-10 Thread Andre via Digitalmars-d-learn
Hi, with the new beta I get the warning I should use std.algorithm.sort instead the .sort property. I thought the std.algorithm.sort method is used in this example? void main() { import std.algorithm: sort, uniq, map; import std.array: array; string[]

Re: Implicit fall through not detected (Example from lex.html)

2015-03-03 Thread Andre via Digitalmars-d-learn
On Tuesday, 3 March 2015 at 07:27:33 UTC, ketmar wrote: implicit fallthru is not a fatal bug (but i believe it should be), it generates only warning. I am also not really happy with the actual behavor (w / wi switch needed) because the documentation is clear about that it is an error:

Implicit fall through not detected (Example from lex.html)

2015-03-02 Thread Andre via Digitalmars-d-learn
Hi, I am little bit confused. I am copied the switch example from lex.html and expected that case 6 will lead to a syntax error due to the missing break statement. But the example compiles without error (C:dmd app) I tried 3 different dmd version, also the newest beta. Kind regards André

curl password issue

2015-02-23 Thread Andre via Digitalmars-d-learn
Hi, Curl has some issues with passwords containing special characters like the hash key (#). The password will not be accepted although it is correctly set with the method setAuthencication(user, pass1234#); I know this is more a Curl issue than a DLang issue but it is very frustrating and for

Re: Parameterized enum does not work

2015-01-09 Thread Andre via Digitalmars-d-learn
Thanks a lot. Kind regards André On Friday, 9 January 2015 at 07:59:51 UTC, Daniel Kozak wrote: On Friday, 9 January 2015 at 07:52:50 UTC, Daniel Kozak wrote: On Friday, 9 January 2015 at 07:50:53 UTC, Daniel Kozak wrote: On Friday, 9 January 2015 at 06:17:53 UTC, Andre wrote: Hi, Should

Parameterized enum does not work

2015-01-08 Thread Andre via Digitalmars-d-learn
Hi, Should following coding work? string lpad(ubyte length, long n) { import std.string: rightJustify; import std.conv: to; return rightJustify(to!string(n), length, '0'); } enum lpad14(long n) = lpad(14, n); void main() { lpad14(123); } There is

Re: BigInt and

2014-12-19 Thread Andre via Digitalmars-d-learn
Great! Thanks a lot. Kind regards André On Friday, 19 December 2014 at 08:47:50 UTC, bearophile wrote: Andre: Do you have any idea how to translate the coding correctly? Try: i += long(buffer[3]) 24 0; But I also suggest to add parentheses, to make the code less unreadable for humans.

BigInt and

2014-12-18 Thread Andre via Digitalmars-d-learn
Hi, I try to translate following javascript coding to D: i = buffer[2] 16; i |= buffer[1] 8; i |= buffer[0]; i += buffer[3] 24 0; Buffer is: [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 111] Expected result for i is: 4294967295 But in D the last statement

Re: Template bug with second mixin?

2014-12-05 Thread Andre via Digitalmars-d-learn
!(readTinyInt, ubyte); mixin insertReadMethods!(readShortInt, short); } void main(){} Kind regards André On Friday, 5 December 2014 at 07:28:26 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 05 Dec 2014 07:06:34 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: Template bug with second mixin?

2014-12-05 Thread Andre via Digitalmars-d-learn
thanks a lot. That makes sense. Kind regards André On Friday, 5 December 2014 at 09:29:21 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 05 Dec 2014 09:19:27 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I think I mimized the coding too much. What I

Template bug with second mixin?

2014-12-04 Thread Andre via Digitalmars-d-learn
Hi, following coding fails to compile with 2.066.0 and 2.067.0-b1. This is a bug, or? source\app.d(9): Error: mixin app.Data.insertReadMethods!(readTinyInt, ubyte) is not defined template insertReadMethods(string MethodName, DataType) { enum insertReadMethods = ; } struct Data {

jsnode crypto createHmac createHash

2014-11-28 Thread andre via Digitalmars-d-learn
Hi, I translate some functionality written in jsnode, which contains a crypto library. Although there is some sha256 support in phobos I think, they do not provide all functionality I need to translate following two functions. (Input and output is ubyte[]) Is there a library which supports the

Re: jsnode crypto createHmac createHash

2014-11-28 Thread andre via Digitalmars-d-learn
fantastic, thanks a lot. Kind regards André On Friday, 28 November 2014 at 13:09:34 UTC, Daniel Kozák via Digitalmars-d-learn wrote: V Fri, 28 Nov 2014 12:46:25 + andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: Hi, I translate some functionality written

attribute length missing in std.array: Appender

2014-11-27 Thread Andre via Digitalmars-d-learn
Hi, I implement a network protocol and use an Appender!(ubyte[])(). I have following issue. The first three bytes I have to fill, the following bytes are reserved and must be 0. In this example the overall header length must be 8. import std.array: appender; const HEADER_LENGTH = 8;

Re: attribute length missing in std.array: Appender

2014-11-27 Thread andre via Digitalmars-d-learn
Thanks a lot for the help. Kind regards André On Thursday, 27 November 2014 at 17:29:50 UTC, Marc Schütz wrote: On Thursday, 27 November 2014 at 16:08:13 UTC, Andre wrote: Hi, I implement a network protocol and use an Appender!(ubyte[])(). I have following issue. The first three bytes I

Re: @property method needs ()

2014-11-24 Thread Andre via Digitalmars-d-learn
Thanks a lot for the info. Kind regards André On Monday, 24 November 2014 at 09:26:16 UTC, Marc Schütz wrote: On Monday, 24 November 2014 at 08:35:08 UTC, ketmar via Digitalmars-d-learn wrote: a known thing. not sure if this is a known *bug* (seems that almost nobody cares). compiler is

@property method needs ()

2014-11-23 Thread Andre via Digitalmars-d-learn
Hi, in following example the @property method needs the () otherwise compiler error for row 24 is thrown. I cannot judge, whether the compiler behaves correct or not. Kind regards André --- alias fnError = void delegate(string s); interface IfSession { @property fnError addError();

InvalidMemoryOperationError@(0)

2014-11-17 Thread Andre via Digitalmars-d-learn
Hi, the following coding is an extract from the DGUI library. On my system (Win 8) I receive InvalidMemoryOperationError@. I got the information that this Error doesn't not occur on a WinXP system. I think there is definetely a bug in the following coding. The Grid class has a Collection of

Get full class name at compile time - Not yet implemented

2014-11-12 Thread Andre via Digitalmars-d-learn
Hi, I currently have some issues to get the full class name at compile time by the variable which might point to null. With .stringof I get the class name without the module. It seems typeid(typeof()) is the solution, but DMD throws the error: source\app.d(10): Error: typeid(app.A).name is

Re: Get full class name at compile time - Not yet implemented

2014-11-12 Thread Andre via Digitalmars-d-learn
perfekt, thanks a lot. Kind regards André On Thursday, 13 November 2014 at 05:37:26 UTC, Rikki Cattermole wrote: On 13/11/2014 6:22 p.m., Andre wrote: http://dlang.org/phobos/std_traits.html#fullyQualifiedName

Re: Intended behavior or bug (private vs public static)

2014-11-07 Thread Andre via Digitalmars-d-learn
Thanks a lot. I will create a bug report. Kind regards André On Friday, 7 November 2014 at 06:09:02 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: That looks like a bug. All you have to do is change the order of the two function declarations or rename the non-static one to something

Re: Issue with WIKI example Win32_DLLs_in_D

2014-10-22 Thread andre via Digitalmars-d-learn
I think there is a bigger issue with the mentioned example. The command cannot work: dmd test mydll.lib -g test.d has an import statement to mydll. mydll has to be included in the command. But as mydll not only contains the exported dll functions but also DllMain, it cannot be compiled

Issue with WIKI example Win32_DLLs_in_D

2014-10-21 Thread Andre via Digitalmars-d-learn
Hi, by copy and paste the example from http://wiki.dlang.org/Win32_DLLs_in_D exactly as described, the following errors is thrown: J:\Projects\Tests\Exampledmd test mydll.lib -g OPTLINK (R) for Win32 Release 8.00.15 test.obj(test) Error 42: Symbol Undefined _D5mydll12__ModuleInfoZ I created

__traits(getMember) works only the second time

2014-10-10 Thread andre via Digitalmars-d-learn
Hi, by executing the example source code, following output is returned: Reference: Child false true At first childStr is not found, then it is found? Is this a bug? Kind regards André - module app; import test; class Child : Parent { mixin ComponentTemplate; @property

Re: __traits(getMember) works only the second time

2014-10-10 Thread andre via Digitalmars-d-learn
I use the syntax is(typeof(__traits(getMember, MyType, childStr))) to check whether a member is public visible or not. (The example above is only a reduced example) By the way hasMember works correctly. I will file an issue. Kind regards André On Friday, 10 October 2014 at 07:25:28 UTC,

(this MyType) automatic deduction?

2014-10-08 Thread andre via Digitalmars-d-learn
Hi, could you check whether it is correct, that second line in main failes with a compiler error? I think the compiler should be able to deduce the type without explicitly passing it to the method call. Kind regards André template ClassTemplate() { static auto deserialize(this MyType)() {

(this MyType) and interface: Symbol undefined

2014-10-08 Thread andre via Digitalmars-d-learn
Hi, please consider following example. I want to acces class B by interface I. Method work should print the actual class (B). The linker say: Error 42: Symbol Undefined _D3app1I17__T4workTC3app1IZ4workMFZv Is this is missing feature or even a bug? Is there any other way to get the actual

Re: (this MyType) automatic deduction?

2014-10-08 Thread andre via Digitalmars-d-learn
Thanks a lot for the helpful explanation. Kind regards André On Wednesday, 8 October 2014 at 21:10:02 UTC, anonymous wrote: On Wednesday, 8 October 2014 at 10:36:33 UTC, andre wrote: Hi, could you check whether it is correct, that second line in main failes with a compiler error? I think the

Re: Curl - Set cookie value

2014-10-06 Thread andre via Digitalmars-d-learn
I found out the real issue. Using addRequestHeader also works for cookies, but there is an issue with HTTP attribute responseHeaders. As this attribute is an associative array (string[string]) it contains only 1 value for 1 key. In case there are several HTTP keys with the same name, it only

Re: isCallable is not an expression

2014-09-25 Thread andre via Digitalmars-d-learn
Thanks a lot. Kind regards André

isCallable is not an expression

2014-09-24 Thread andre via Digitalmars-d-learn
Hi, following code throws an error when I uncomment method getPropertyDuplicate. getPropertyDuplicate is just a copy of getProperty except the method name. Why these errors are thrown? C:\D\dmd2\windows\bin\..\..\src\phobos\std\traits.d(1257): Error: isCallable!(ge tPropertyDuplicate) is

Re: with (auto p = new ...)

2014-09-24 Thread Andre via Digitalmars-d-learn
Enhancement 13526 filed: https://issues.dlang.org/show_bug.cgi?id=13526

with (auto p = new ...)

2014-09-23 Thread Andre via Digitalmars-d-learn
Hi, I just wonder why with (auto p = new ...) is not working. It would be some syntax sugar in this scenario: with (auto p = new Panel()) { parent = this; text = bla; with (auto b = new Button()) {

Re: with (auto p = new ...)

2014-09-23 Thread andre via Digitalmars-d-learn
Yes, that is also working. As far as I remember (only my tablet currently available) also this works: Panel p; with(p = new Panel ()) {} Therefore it seems strange,the same does not work with auto. Kind regards André On Tuesday, 23 September 2014 at 19:49:22 UTC, Graham Fawcett wrote:

alias this cast

2014-09-11 Thread andre via Digitalmars-d-learn
Hi, I am 80% sure, the failing assertion is correct but please have a look. Second assertion fails. Kind regards André class A{} class B{} class C : B { A a; alias a this; this() { a = new A(); } } void main() { B b

Re: alias this cast

2014-09-11 Thread andre via Digitalmars-d-learn
3 represenations: A, B and C. It is a matter of steps. Kind regards André On Thursday, 11 September 2014 at 11:53:30 UTC, Daniel Kozak via Digitalmars-d-learn wrote: V Thu, 11 Sep 2014 11:40:05 + andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: Hi, I am 80

Re: DUB: link to local library

2014-09-10 Thread andre via Digitalmars-d-learn
Dub command line supports something like Dub add-local. Then you can use the package directly. Kind regards Andre On Wednesday, 10 September 2014 at 15:40:11 UTC, Edwin van Leeuwen wrote: On Wednesday, 10 September 2014 at 13:40:16 UTC, rcor wrote: dub.json contains what I think should do

Re: dgui - Button continually repainting

2014-09-09 Thread andre via Digitalmars-d-learn
Hi, Just checked, on WM_PAINT all event listeners (event paint) are called. Overwriting onPaint seems to work better (issue 18 in dgui bitbucket site). Please file this issue also on the dgui bibucket home page. Kind regards Andre On Tuesday, 9 September 2014 at 10:50:11 UTC, Mike James

dgui - self defined components with double buffering

2014-09-09 Thread andre via Digitalmars-d-learn
Hi, I habe several self defined components in my Windows. During resizing of the Windows, the Windows controls gets ugly and then disappear. I want to implement double buffering but found no obvious way to create a memory canvas and after having done the drawing copying It to the canvas of the

User defined forward range - foreach initializes f.r.

2014-06-13 Thread Andre via Digitalmars-d-learn
Hi, I have a template class List which should provide generic list functionality. In my use case, using a class instead a struct is more comfortable. Following unittest fails, although the forward range implements the save method. unittest { auto intList = new List!int(1,2,3);

Re: User defined forward range - foreach initializes f.r.

2014-06-13 Thread Andre via Digitalmars-d-learn
Am 13.06.2014 20:22, schrieb H. S. Teoh via Digitalmars-d-learn: [...] Generally, it's a bad idea to conflate a container with a range over its contents. In this sense, built-in arrays are a very bad example, because they show precisely this sort of conflation. But they get away with it because

Issue with contracts and assertions

2014-05-23 Thread Andre via Digitalmars-d-learn
Hi, for the attached code I noticed some strange behaviors. I compile the programm with: dmd main -unittest The expected assertion of the method c pre condition is not raised. It is only raised if class A not implements interface I. On the otherside the commented assertion in the invariant is

Re: Issue with contracts and assertions

2014-05-23 Thread Andre via Digitalmars-d-learn
Am 23.05.2014 16:34, schrieb Rene Zwanenburg: On Friday, 23 May 2014 at 13:45:07 UTC, Andre wrote: Hi, for the attached code I noticed some strange behaviors. I compile the programm with: dmd main -unittest The expected assertion of the method c pre condition is not raised. It is only raised

Re: Issue with contracts and assertions

2014-05-23 Thread Andre via Digitalmars-d-learn
Am 23.05.2014 16:44, schrieb Rene Zwanenburg: On Friday, 23 May 2014 at 14:38:27 UTC, Andre wrote: Am 23.05.2014 16:34, schrieb Rene Zwanenburg: In case there is a reason that the assertion is not run, if feels very dangerous for me that all assertions can be disabled by mistake just by adding

Array of interface only with cast()?

2014-04-22 Thread Andre via Digitalmars-d-learn
Hi, I just stumbled about this issue with array of interface. I want to pass several objects (C and D) which shares the same interface A. It seems somehow cumbersome that it only works if there is a cast on the first element of the array. interface A{} class B: A{} class C: B{}; class D: B{};

Re: Array of interface only with cast()?

2014-04-22 Thread Andre via Digitalmars-d-learn
Am 22.04.2014 17:23, schrieb Andrej Mitrovic: On Tuesday, 22 April 2014 at 15:19:55 UTC, Andre wrote: Is the cast really needed? It's a known issue and a filed bug report. I don't have the Issue number at hand though, someone else will likely provide it. Nice to hear that it is not by