Tuple!(string, int))[] field_orders

2019-03-14 Thread Ozan via Digitalmars-d-learn
Hi In vibe.d / data / mongo / collection I found the function * ensureIndex(Tuple!(string, int))[] field_orders) What could be the right way to use "Tuple!(string, int))[] field_orders"? I tried different ways like [Tuple!("a", 1), Tuple!("b", 2)]", but compiler said "No" Any hint? Thanks

Re: Why does nobody seem to think that `null` is a serious problem in D?

2018-11-29 Thread O-N-S (ozan) via Digitalmars-d-learn
On Monday, 19 November 2018 at 21:23:31 On Monday, 19 November 2018 at 21:23:31 UTC, Jordi Gutiérrez Hermoso wrote: I'm not the only one who has done this. I can't find it right now, but I've seen at least one person open a bug report because they misunderstood this as a bug in dmd. I have

Can I use D with the Microsoft universal windows platform?

2018-01-03 Thread Ozan via Digitalmars-d-learn
Hi Are there any use cases or libraries for using D in Microsoft's universal windows platform environment? It would be nice to have XBOX Apps build on D ;-) Regards Ozan

Re: No aa.byKey.length?

2016-04-02 Thread Ozan via Digitalmars-d-learn
On Friday, 1 April 2016 at 20:50:32 UTC, Yuxuan Shui wrote: Why? This is annoying when I need to feed it into a function that requires hasLength. aa.keys.length

Re: Address of an element of AA

2016-04-02 Thread Ozan via Digitalmars-d-learn
On Saturday, 2 April 2016 at 14:22:01 UTC, Temtaime wrote: Hi ! I can't find this in specs. If i add an element to AA: aa[10] = 123; Will [10] be always the same (of course i don't remove that key) ? Thanks for a reply. I think specs should be enhanced. Running following int

Re: Updating D-based apps without recompiling it

2016-03-26 Thread Ozan via Digitalmars-d-learn
On Thursday, 24 March 2016 at 23:03:54 UTC, cym13 wrote: On Thursday, 24 March 2016 at 18:46:43 UTC, Jesse Phillips wrote: On Wednesday, 23 March 2016 at 17:29:50 UTC, Jacob Carlborg wrote: On 2016-03-23 18:15, Jesse Phillips wrote: Do you have an example of this being done in any other

Re: Updating D-based apps without recompiling it

2016-03-26 Thread Ozan via Digitalmars-d-learn
On Wednesday, 23 March 2016 at 17:15:35 UTC, Jesse Phillips wrote: On Wednesday, 23 March 2016 at 12:21:33 UTC, Ozan wrote: Hi Enterprise applications in productive environments requires smooth updating mechanisms without recompiling or reinstalling. It's not possible to stop an enterprise

Re: Finding out names in shared libraries

2016-03-23 Thread Ozan via Digitalmars-d-learn
On Wednesday, 23 March 2016 at 15:17:18 UTC, Ozan wrote: If I want to use a class or a function in a shared library, it is necessary to use funny names like "D7myclass10getMyClassFZC7myclass7MyClass". Is it possible to get a list of all the names in shared library? What is the schema behind

Finding out names in shared libraries

2016-03-23 Thread Ozan via Digitalmars-d-learn
Hi If I want to use a class or a function in a shared library, it is necessary to use funny names like "D7myclass10getMyClassFZC7myclass7MyClass". Is it possible to get a list of all the names in shared library? What is the schema behind these names? Is there a listing for "D7", "10",

Updating D-based apps without recompiling it

2016-03-23 Thread Ozan via Digitalmars-d-learn
Hi Enterprise applications in productive environments requires smooth updating mechanisms without recompiling or reinstalling. It's not possible to stop an enterprise application, then run "dub --reforce" and wait until finish. Mostly only few functions need to be replaced. Has someone

Combining template conditions and contracts?

2016-02-29 Thread Ozan via Digitalmars-d-learn
Is it possible to combine template conditions and contracts? Like in the following T square_root(T)(T x) if (isBasicType!T) { in { assert(x >= 0); } out (result) { assert((result * result) <= x && (result+1) * (result+1) > x); } body { return cast(long)std.math.sqrt(cast(real)x);

Using enums as function parameters (in a minimized way)

2015-12-01 Thread Ozan via Digitalmars-d-learn
Hi Let's say we have an enum like enum SomethingAboutChristmas { SantaClaus, Angel, Tree } and want to use it in a function like void goingChristmas(SomethingAboutChristmas enumvalue) it works fine like following goingChristmas(SomethingAboutChristmas.Tree) I prefer to use a

Exit with code xx

2015-11-25 Thread Ozan via Digitalmars-d-learn
Hi Is there any overview, list, wiki about what's behind runtime errors like "Program exited with code -11"? Okay, I made a mistake...but it's better to know where and what kind? Thanks & Regards, Ozan

Re: Exit with code xx

2015-11-25 Thread Ozan via Digitalmars-d-learn
On Wednesday, 25 November 2015 at 16:11:09 UTC, Ozan wrote: Hi Is there any overview, list, wiki about what's behind runtime errors like "Program exited with code -11"? Okay, I made a mistake...but it's better to know where and what kind? Thanks & Regards, Ozan Okay, I found my little

Re: How to check whether an empty array variable is null?

2015-10-11 Thread Ozan via Digitalmars-d-learn
On Saturday, 10 October 2015 at 15:46:51 UTC, Meta wrote: On Saturday, 10 October 2015 at 15:20:04 UTC, tcak wrote: [code] int[] list; list = new int[0]; std.stdio.writeln("Is Null ? ", (list is null)); [/code] Result is "Is Null? true". } Do I miss the

Re: Bug? 0 is less than -10

2015-10-09 Thread Ozan via Digitalmars-d-learn
On Thursday, 8 October 2015 at 09:01:32 UTC, Dominikus Dittes Scherkl wrote: On Wednesday, 7 October 2015 at 16:25:02 UTC, Marc Schütz wrote: Lionello Lunesu posted a PR that should fix this: https://github.com/D-Programming-Language/dmd/pull/1913 See also the discussion in the linked bug

Reading Atributes (UDA) of overloaded functions

2015-09-17 Thread Ozan via Digitalmars-d-learn
Hi! Is it possible to read all attributes in case of overloading functions? Example: struct Att { string name; } struct Att2 { string name; } @Att void testUDA(string x) { writeln("test(string ",x,")"); } @Att2 void testUDA(int x) { writeln("test(string ",x,")"); } void main(string[] args) {

Re: Reading Atributes (UDA) of overloaded functions

2015-09-17 Thread Ozan via Digitalmars-d-learn
On Thursday, 17 September 2015 at 12:36:42 UTC, John Colvin wrote: On Thursday, 17 September 2015 at 11:47:40 UTC, Ozan wrote: ... use __traits(getAttributes, /*...*/) on each of the members of the result of __traits(getOverloads, /*...*/) Great! Thanks! Now it works: foreach (ov;

Re: Real OOP with D

2015-08-18 Thread Ozan via Digitalmars-d-learn
On Monday, 17 August 2015 at 06:08:35 UTC, Ali Çehreli wrote: On 08/16/2015 10:57 PM, Ozan wrote: [...] From the way you use it below, a better name for that class would be FamilyMember but I get the point. Yes, you're right. [...] father.greeting; son.greeting; What you mean is

Re: Real OOP with D

2015-08-18 Thread Ozan via Digitalmars-d-learn
On Monday, 17 August 2015 at 06:59:51 UTC, BBasile wrote: On Monday, 17 August 2015 at 05:57:52 UTC, Ozan wrote: Hi [...] Is there any way to get real OOP with D? Regards, Ozan Can you name an OOP oriented language that allows this ? Your example is eroneous OOP. The 2 other answers you

Re: Real OOP with D

2015-08-18 Thread Ozan via Digitalmars-d-learn
On Monday, 17 August 2015 at 06:10:38 UTC, Rikki Cattermole wrote: On 17/08/2015 5:57 p.m., Ozan wrote: Hi [...] import std.stdio; abstract class Family { void greeting(); } class Dad : Family { void greeting() { writeln(I'm dad); } } class Boy : Family { void greeting() { writeln(I'm

Real OOP with D

2015-08-17 Thread Ozan via Digitalmars-d-learn
Hi Working with objectoriented concepts results often in large trees of related classes. Every instance of a class knows his methods and data. An example like following would work: import std.stdio; class Family { } class Dad : Family { void greeting() { writeln(I'm dad); } } class Boy :

Re: More type-flexible arrays?

2015-06-15 Thread Ozan via Digitalmars-d-learn
On Sunday, 14 June 2015 at 06:46:05 UTC, Ali Çehreli wrote: On 06/13/2015 11:12 PM, Ozan wrote: Hallo! Is it possible to create arrays which has more then one type, Not possible. f. ex. array[0] = 1; array[1] = z; array[2] = new clazz(), I tried Variant, but it slow down heavily my

Re: More type-flexible arrays?

2015-06-15 Thread Ozan via Digitalmars-d-learn
On Sunday, 14 June 2015 at 06:43:48 UTC, ketmar wrote: On Sun, 14 Jun 2015 06:12:29 +, Ozan wrote: Hallo! Is it possible to create arrays which has more then one type, f. ex. array[0] = 1; array[1] = z; array[2] = new clazz(), I tried Variant, but it slow down heavily my app. it

More type-flexible arrays?

2015-06-14 Thread Ozan via Digitalmars-d-learn
Hallo! Is it possible to create arrays which has more then one type, f. ex. array[0] = 1; array[1] = z; array[2] = new clazz(), I tried Variant, but it slow down heavily my app. Greetings, Ozan