Kagamin пишет:
> Weed Wrote:
>
>> If you do not want to initialize repeatedly matrix inside the sub, which
>> often cause each other, must be static matrices or declared as global
>> (in relation to these procedures). You agree with that?
>
> What's problem? If you want static or global variabl
Kagamin пишет:
Weed Wrote:
If you do not want to initialize repeatedly matrix inside the sub, which
often cause each other, must be static matrices or declared as global
(in relation to these procedures). You agree with that?
What's problem? If you want static or global variables, you have t
Weed Wrote:
> If you do not want to initialize repeatedly matrix inside the sub, which
> often cause each other, must be static matrices or declared as global
> (in relation to these procedures). You agree with that?
What's problem? If you want static or global variables, you have them in D.
>
Kagamin пишет:
Weed Wrote:
too cannot be initialized in a compile time.
Sure it can't. Does it cause that big problems?
Sometimes it is the only way to avoid a large number of global ad
In D module variables can be protected by access modifiers and become
module-local.
Module full of mathem
Weed Wrote:
> too cannot be initialized in a compile time.
> >>> Sure it can't. Does it cause that big problems?
> >> Sometimes it is the only way to avoid a large number of global ad
> >
> > In D module variables can be protected by access modifiers and become
> > module-local.
>
> Module
Weed пишет:
Kagamin пишет:
Weed Wrote:
I'd prefer run-time checks, though
templates can be used for sure.
This problem would help solve the availability of inheritance for
structs or compile-time creation of class instances.
And I see no problem. Absence of compile-time object creation does
Kagamin пишет:
Weed Wrote:
It is not necessary to suggest to wrap up "pixel" in a class - then it
too cannot be initialized in a compile time.
Sure it can't. Does it cause that big problems?
Sometimes it is the only way to avoid a large number of global ad
In D module variables can be prote
Weed Wrote:
> >> It is not necessary to suggest to wrap up "pixel" in a class - then it
> >> too cannot be initialized in a compile time.
> >
> > Sure it can't. Does it cause that big problems?
>
> Sometimes it is the only way to avoid a large number of global ad
In D module variables can be p
Kagamin пишет:
Weed Wrote:
The problem is not in use templates.
Templates are implementing some of the functionality of 2 types of
structures matrices (normal and dynamic). But the structures do not
inherit, then to add functionality matrix to other entities ( "pixel",
"image" etc) sites wi
Weed Wrote:
> The problem is not in use templates.
>
> Templates are implementing some of the functionality of 2 types of
> structures matrices (normal and dynamic). But the structures do not
> inherit, then to add functionality matrix to other entities ( "pixel",
> "image" etc) sites will hav
Kagamin пишет:
Weed Wrote:
I'd prefer run-time checks, though
templates can be used for sure.
This problem would help solve the availability of inheritance for
structs or compile-time creation of class instances.
And I see no problem. Absence of compile-time object creation doesn't prevent
Weed Wrote:
> > I'd prefer run-time checks, though
> > templates can be used for sure.
>
> This problem would help solve the availability of inheritance for
> structs or compile-time creation of class instances.
I see no way, how it can help.
Weed Wrote:
> > I'd prefer run-time checks, though
> > templates can be used for sure.
>
> This problem would help solve the availability of inheritance for
> structs or compile-time creation of class instances.
And I see no problem. Absence of compile-time object creation doesn't prevent
you
Kagamin пишет:
Weed Wrote:
that is, suppose that after some action should get a matrix matrix3x1
Well... if you want to template every piece of your code, this can
cause disaster, so I think, this is not very good design. For
example, multiplication method will be duplicated N*N*N times for a
Weed Wrote:
> that is, suppose that after some action should get a matrix matrix3x1
Well... if you want to template every piece of your code, this can cause
disaster, so I think, this is not very good design. For example, multiplication
method will be duplicated N*N*N times for all possible mat
Sun, 21 Dec 2008 12:04:42 -0500, Kagamin wrote:
> Sergey Gromov Wrote:
>
>> C++ static object constructors execute at run time except for trivial
>> cases.
>
> Although I think it's not guaranteed to work this way and compiler
> decides when to execute constructor. So code should be ready for
>
On Sun, 21 Dec 2008 19:34:52 +0300, Kagamin wrote:
Derek Parnell Wrote:
I think he wants to have some objects constructed at compile-time.
Sure he wants. From my point of view, this technique is supposed to be a
means to solve some problem rather than problem itself. But this problem
wa
Weed пишет:
Kagamin пишет:
Weed Wrote:
Sure he wants. From my point of view, this technique is supposed to
be a means to solve some problem rather than problem itself. But
this problem was not put.
please read it thread:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars
Kagamin пишет:
Weed Wrote:
Sure he wants. From my point of view, this technique is supposed to be a means
to solve some problem rather than problem itself. But this problem was not put.
please read it thread:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id
Weed Wrote:
> > Sure he wants. From my point of view, this technique is supposed to be a
> > means to solve some problem rather than problem itself. But this problem
> > was not put.
>
> please read it thread:
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_i
Sergey Gromov Wrote:
> C++ static object constructors execute at run time except for trivial
> cases.
Although I think it's not guaranteed to work this way and compiler decides when
to execute constructor. So code should be ready for run-time evaluation. And as
code evolves those constructors c
Kagamin пишет:
Derek Parnell Wrote:
I think he wants to have some objects constructed at compile-time.
Sure he wants. From my point of view, this technique is supposed to be a means
to solve some problem rather than problem itself. But this problem was not put.
please read it thread:
http:
Kagamin пишет:
Derek Parnell Wrote:
I think he wants to have some objects constructed at compile-time.
Sure he wants. From my point of view, this technique is supposed to be a means
to solve some problem rather than problem itself. But this problem was not put.
Please read even this editi
Derek Parnell Wrote:
> I think he wants to have some objects constructed at compile-time.
Sure he wants. From my point of view, this technique is supposed to be a means
to solve some problem rather than problem itself. But this problem was not put.
Denis Koroskin wrote:
On Sat, 20 Dec 2008 16:46:44 +0300, Christopher Wright
wrote:
Sergey Gromov wrote:
Thu, 18 Dec 2008 18:36:07 -0500, Christopher Wright wrote:
Weed wrote:
Compile-time creation an object of class or (most likely wrong)
struct inheritance.
I have prepared a distinct
On Sat, 20 Dec 2008 16:46:44 +0300, Christopher Wright
wrote:
Sergey Gromov wrote:
Thu, 18 Dec 2008 18:36:07 -0500, Christopher Wright wrote:
Weed wrote:
Compile-time creation an object of class or (most likely wrong)
struct inheritance.
I have prepared a distinct feature request and s
Sergey Gromov wrote:
Thu, 18 Dec 2008 18:36:07 -0500, Christopher Wright wrote:
Weed wrote:
Compile-time creation an object of class or (most likely wrong) struct
inheritance.
I have prepared a distinct feature request and send it later
You aren't providing a use case, though. Why not show a
On Fri, 19 Dec 2008 04:07:40 -0500, Kagamin wrote:
> Derek Parnell Wrote:
>
>> A static constructor (also known as the Module constructor) executes at
>> program run-time and not at program compile-time.
>
> So do C++ static object constructors. Though C++ has syntax sugar, which
> helps writin
Thu, 18 Dec 2008 18:36:07 -0500, Christopher Wright wrote:
> Weed wrote:
>> Compile-time creation an object of class or (most likely wrong) struct
>> inheritance.
>>
>> I have prepared a distinct feature request and send it later
>
> You aren't providing a use case, though. Why not show an exam
Fri, 19 Dec 2008 04:07:40 -0500, Kagamin wrote:
> Derek Parnell Wrote:
>
>> A static constructor (also known as the Module constructor) executes at
>> program run-time and not at program compile-time.
>
> So do C++ static object constructors. Though C++ has syntax sugar,
> which helps writing de
Derek Parnell Wrote:
> A static constructor (also known as the Module constructor) executes at
> program run-time and not at program compile-time.
So do C++ static object constructors. Though C++ has syntax sugar, which helps
writing declaration and initialization at the same place.
Derek Parnell пишет:
On Thu, 18 Dec 2008 07:24:34 -0500, Kagamin wrote:
Static constructor can execute any valid D statements including construction of
objects.
A static constructor (also known as the Module constructor) executes at
program run-time and not at program compile-time. I think W
Weed wrote:
Compile-time creation an object of class or (most likely wrong) struct
inheritance.
I have prepared a distinct feature request and send it later
You aren't providing a use case, though. Why not show an example (actual
code) of what you would do if you had this ability?
On Thu, 18 Dec 2008 07:24:34 -0500, Kagamin wrote:
> Static constructor can execute any valid D statements including construction
> of objects.
A static constructor (also known as the Module constructor) executes at
program run-time and not at program compile-time. I think Weed wants the
ability
Weed Wrote:
> Therefore, it can not create instance of object.
You have a trouble with terminology here.
In my example m=new Matrix(7); creates an instance of Matrix class.
naryl Wrote:
> Weed wants every object to be declared in the function where it is needed.
Haa?..
void main()
{
Matrix m=new Matrix(7);
writeln(m.i);
}
Kagamin Wrote:
> Static constructor can execute any valid D statements including construction
> of objects.
> This works:
> ---
> import std.stdio;
>
> class Matrix
> {
> int i;
>
> this(int j)
> {
> i=j;
> }
> }
>
> Matrix m;
>
> static this()
> {
>
Kagamin пишет:
Weed Wrote:
Kagamin пишет:
Weed Wrote:
Global variables are static members of module, wich is similar to
class and also has static constructor.
So what?
So your problem is solved.
If everything was so simple! :)
Once again: the static constructor of class NOT constructs an
Weed Wrote:
> Kagamin ÐÉÛÅÔ:
> > Weed Wrote:
> >
> >>> Global variables are static members of module, wich is similar to
> >>> class and also has static constructor.
> >> So what?
> >
> > So your problem is solved.
>
> If everything was so simple! :)
>
> Once again: the static constructor of c
Weed пишет:
Kagamin пишет:
Weed Wrote:
Global variables are static members of module, wich is similar to
class and also has static constructor.
So what?
So your problem is solved.
If everything was so simple! :)
Once again: the static constructor of class NOT constructs an object. He
ju
Kagamin пишет:
Weed Wrote:
Global variables are static members of module, wich is similar to
class and also has static constructor.
So what?
So your problem is solved.
If everything was so simple! :)
Once again: the static constructor of class NOT constructs an object. He
just fills the
Well, the wish to place an object at specific location is not a problem, it's a
wish.
Weed Wrote:
> > Global variables are static members of module, wich is similar to
> > class and also has static constructor.
>
> So what?
So your problem is solved.
Kagamin пишет:
Weed Wrote:
There does not need a static initialization of static members of the
class. There must be able to create objects of classes at compile time.
Well, these objects should be placed in some static variables,
right?
Yes
Static variables are initialized with static co
Weed Wrote:
> There does not need a static initialization of static members of the
> class. There must be able to create objects of classes at compile time.
Well, these objects should be placed in some static variables, right? Static
variables are initialized with static constructors. Global va
Janderson пишет:
Weed wrote:
Janderson пишет:
Weed wrote:
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile
time.
- ability of creating matrix instance in runt
Weed wrote:
Janderson пишет:
Weed wrote:
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile
time.
- ability of creating matrix instance in runtime.
I have decid
Weed пишет:
Christopher Wright пишет:
Weed wrote:
If I create struct MatrixStruct for compile-time matrix and class
MatrixClass for all other I will not be able to create a function of
interaction between these objects through the templates because some
of them will be announced before the ot
Christopher Wright пишет:
Weed wrote:
If I create struct MatrixStruct for compile-time matrix and class
MatrixClass for all other I will not be able to create a function of
interaction between these objects through the templates because some
of them will be announced before the other and it wi
Christopher Wright пишет:
Weed wrote:
If I create struct MatrixStruct for compile-time matrix and class
MatrixClass for all other I will not be able to create a function of
interaction between these objects through the templates because some
of them will be announced before the other and it wi
Weed wrote:
If I create struct MatrixStruct for compile-time matrix and class
MatrixClass for all other I will not be able to create a function of
interaction between these objects through the templates because some of
them will be announced before the other and it will not be able to get
anot
Janderson пишет:
Weed wrote:
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile time.
- ability of creating matrix instance in runtime.
I have decided to make it s
Weed wrote:
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile time.
- ability of creating matrix instance in runtime.
I have decided to make it struct because I ne
Weed пишет:
Kagamin пишет:
Weed Wrote:
I agree.
In my case I chose to structure rather than a class because it can be
initialized at compile time.
But now I thing must be allowed to deploy class in the default data
segment. And add the possibility of creating a object of class at
compile
Kagamin пишет:
Weed Wrote:
I agree.
In my case I chose to structure rather than a class because it can be
initialized at compile time.
But now I thing must be allowed to deploy class in the default data
segment. And add the possibility of creating a object of class at
compile time.
If yo
Weed Wrote:
> I agree.
> In my case I chose to structure rather than a class because it can be
> initialized at compile time.
>
> But now I thing must be allowed to deploy class in the default data
> segment. And add the possibility of creating a object of class at
> compile time.
If you want
Yigal Chripun пишет:
If I understand you correctly - I think you confuse here two separate
and orthogonal issues.
1) struct vs. class
2) memory allocation
What D tries to do is to provide types with value semantics via structs
and types with reference semantics _and_polymorphism_ via classe
Weed wrote:
bearophile пишет:
> Weed:
>> Planned in the future to implement inheritance of structs or the
static creation of classes?
>
> Inheritance of structs: I think it's not planned. Structs in D are
meant to be used for different things than classes.
> Yet, as time passes structs are g
bearophile пишет:
> Weed:
>> Planned in the future to implement inheritance of structs or the
static creation of classes?
>
> Inheritance of structs: I think it's not planned. Structs in D are
meant to be used for different things than classes.
> Yet, as time passes structs are gaining more powe
Weed:
> Planned in the future to implement inheritance of structs or the static
> creation of classes?
Inheritance of structs: I think it's not planned. Structs in D are meant to be
used for different things than classes.
Yet, as time passes structs are gaining more power: you can't believe that
Weed пишет:
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile time.
- ability of creating matrix instance in runtime.
I have decided to make it struct because I ne
Bill Baxter пишет:
2008/12/16 Weed :
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile time.
- ability of creating matrix instance in runtime.
I have decided to m
Bill Baxter пишет:
2008/12/16 Weed :
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile time.
- ability of creating matrix instance in runtime.
I have decided to m
2008/12/16 Weed :
> I should explain why it's important for me:
>
> For example, I am making a matrix object(s)
>
> It should be:
> - any size
> - with ability of making matrix instance of a given size in compile time.
> - ability of creating matrix instance in runtime.
>
> I have decided to make i
I should explain why it's important for me:
For example, I am making a matrix object(s)
It should be:
- any size
- with ability of making matrix instance of a given size in compile time.
- ability of creating matrix instance in runtime.
I have decided to make it struct because I need to create
65 matches
Mail list logo