Re: Why I can't catch the exception?

2016-06-05 Thread Piotrek via Digitalmars-d-learn

On Sunday, 5 June 2016 at 18:20:12 UTC, Era Scarecrow wrote:
 The assertion is being thrown in the storage.d and 
backtracking it basically points to line 115 (usersCollection), 
so am going to guess based on error messages alone that you are 
passing a struct/class that doesn't match inputs that it is 
expecting for one of the elements it needs to store.


 So my advice is to look at the User struct/class, and then 
look at the DB's User table. But this is just a far thrown 
guess at the problem.


You are very close. This is just a limitation of the current 
database code which can only handle the simplest structs.


https://gitlab.com/PiotrekDlang/DraftLib/issues/4

Piotrek


Re: Will D have a standard cross platform GUI toolkit?

2015-02-26 Thread Piotrek via Digitalmars-d-learn

On Thursday, 26 February 2015 at 18:20:12 UTC, Rinzler wrote:

Hello,

I was wondering if D will have a standard cross platform GUI 
toolkit.


I think that any modern language should provide a 
cross-platform GUI toolkit. I know that there are some GUI 
toolkits, but are there cross-platform? Are there serious 
works? That is, will them always be supported and evolve along 
with the D programming language?


I think that having bindings of a GUI toolkit for a programming 
languages can be useful, but they have to be well supported.


Will QT support D programming language? I really love the Qt 
framework (except from the fact it's not open source, as far as 
I know), even though I have not used it a lot.


I have to admit that I love D, even if I did not start 
programming with it. It seems it combines the most useful 
things of C++ and Java, which are my favourite programming 
languages.


Maybe there are other questions already in the forum, since I 
am new, I don't know, but a new question, more up to date, can 
also be useful.


Thanks!


Hi,

There were several discussions about the std gui in the past. And 
the current state is not so bad. There are some big contributions 
 in the gui domain. However the complexity of the topic is so hi 
that there is no *standard* gui for D for the time being.


However I've been trying to start with the concept of DIP73 
http://wiki.dlang.org/DIP73
(I'm the submitter and the only executor ;) with the hope that 
there is a chance.


Currently I'm choosing some example ideas of new modules 
(including database and gui especially).


Piotrek


Re: Problem with creating a new account on wiki.dlang.org

2015-02-04 Thread Piotrek via Digitalmars-d-learn
On Wednesday, 4 February 2015 at 07:02:01 UTC, Zach the Mystic 
wrote:

Vladimir fixed it. Yay!


That was quick action. Thank you both Zach and Vladimir.

Piotrek


Problem with creating a new account on wiki.dlang.org

2015-02-03 Thread Piotrek via Digitalmars-d-learn

Hi,

I wanted to create my account at wiki.dlang.org:

Went to:
http://wiki.dlang.org/?title=Special:UserLoginreturnto=Wish+listtype=signup

And got:
No questions found; set some in LocalSettings.php using the 
format from QuestyCaptcha.php.


Anyone familiar with the issue?

Piotrek


Re: static class vs. static struct

2015-01-27 Thread Piotrek via Digitalmars-d-learn

On Tuesday, 27 January 2015 at 18:24:29 UTC, Ali Çehreli wrote:

On 01/27/2015 08:33 AM, Piotrek wrote:

 Non-static means nested.

 Hmm,this can be misleading. Nesting in structs doesn't
introduce context
 pointer.

You must be thinking of structs nested inside user-defined 
types. Structs that are nested inside functions do have the 
context pointer.


Ali


What you wrote about the structs is true. However I was referring 
to other thing. I just wanted to emphasize (with my poor English) 
that also classes and structs *nested in struct* doesn't contain 
the additional context pointer. As opposed to class nested in 
class.


Then I think we'd better not say that non-static means nested.

Piotrek


Re: static class vs. static struct

2015-01-27 Thread Piotrek via Digitalmars-d-learn

On Tuesday, 27 January 2015 at 18:18:02 UTC, Ali Çehreli wrote:

On 01/27/2015 08:58 AM, Piotrek wrote:

Nice list. :)

 1. static variable

 struct A{int a} // no static before declaration
 static A s; //note that static is used for struct variable
storage class
 (lifetime)

 static int b;
 etc.

 2. static declaration

 static struct A{int a}; //static used for context unnesting
 static int fun(){}; // static used also for removing scope
context

Of course that includes static member functions, where the 
'this' pointer is removed.


Actually, static opCall is kind of different because it makes 
the type itself callable.



 etc.

 3. static if

 static if(compile_time_cond)
 {
//this section of code will be taken into the binary, used
for meta
 programming
 }

Another use of 'static' that means at compile time:

static assert

4. Module initialization and deinitialization:

static this
shared static this

static ~this
shared static ~this

5. Module import:

static import std.stdio;

Ali


Thanks for comments, Mr. Professor. On duty as usual ;)
Let me here thank for your book which I've been reading for some 
time.


Piotrek


Re: static class vs. static struct

2015-01-27 Thread Piotrek via Digitalmars-d-learn

On Tuesday, 27 January 2015 at 09:01:39 UTC, ref2401 wrote:
For several times I've met struct(or static struct) usage in 
Phobos for singleton pattern implementation. Unfortunately now 
i can remember only core.runtime.Runtime.
So I've got a question. Why do Phobos guys use struct or static 
struct for or singleton pattern implementation? Why don't use 
static final class for this purpose?


You probably saw static member function.

Please take the following with a big grain of salt as I took it 
out of my head:

We can divide the D static keyword usage into 3 types:

1. static variable

struct A{int a} // no static before declaration
static A s; //note that static is used for struct variable 
storage class (lifetime)


static int b;
etc.

2. static declaration

static struct A{int a}; //static used for context unnesting
static int fun(){}; // static used also for removing scope context

etc.

3. static if

static if(compile_time_cond)
{
  //this section of code will be taken into the binary, used for 
meta programming

}

I don't think there is much (if any) use of static (type 1) for 
singleton.


Piotrek


Re: static class vs. static struct

2015-01-27 Thread Piotrek via Digitalmars-d-learn

On Monday, 26 January 2015 at 21:55:19 UTC, anonymous wrote:

On Monday, 26 January 2015 at 21:33:10 UTC, Piotrek wrote:

On Monday, 26 January 2015 at 14:11:32 UTC, bearophile wrote:

Non-static structs/classes have an extra pointer.

Bye,
bearophile


Since when structs have an extra pointer? Maybe you are 
talking about nested structs?


Non-static means nested.


Hmm,this can be misleading. Nesting in structs doesn't introduce 
context pointer.


But I agree that if we take into account a hypothetical inferred 
static attribute for nesting in struct and the module scope 
cases, then the static and non-static classification looks the 
most suitable.


Piotrek


Re: static class vs. static struct

2015-01-26 Thread Piotrek via Digitalmars-d-learn

On Monday, 26 January 2015 at 14:11:32 UTC, bearophile wrote:

Non-static structs/classes have an extra pointer.

Bye,
bearophile


Since when structs have an extra pointer? Maybe you are talking 
about nested structs?



Piotrek