On Wednesday, 16 May 2012 at 11:12:19 UTC, Stephen Jones wrote:
Cain: My understanding is that D is based on "no proper ways of
doing things" just get the job done. The use of properties when
you can use public access baffles me. So long as you are
I suppose "proper way of doing things" isn't
>Am 16.05.2012 13:12, schrieb Stephen Jones:
just throw aways your sensless void pointer or whatever idea - create a
base interface or better base-class - everything else is just damn wrong
btw: all oop widget sets for c++, java or else are haveing a widget base
class that works like people t
On Wednesday, 16 May 2012 at 11:12:19 UTC, Stephen Jones wrote:
Ali your post above, and T your post in the other forum
(Simpsons bit) is sort of what I was after. I tried both
interface and abstract class but not outright super class. The
problem I have with the solution is the same problem I
case you'd
downcast to the common base class.
If some one knows void pointer syntax that would be helpful.
As I
understand it there is a type called size_t that takes the
address
of as a a value. Can I make an array of these and simply
initialize
each with &button1, &cursor,
Am 14.05.2012 20:40, schrieb Stephen Jones:
Ali Çehreli post got your answer - see the last example of the post
news://news.digitalmars.com:119/[email protected]
but first: try to understand how the base-class, interface stuff realy
works - you will got the same problems in every
class.
> If some one knows void pointer syntax that would be helpful. As I
> understand it there is a type called size_t that takes the address
> of as a a value. Can I make an array of these and simply initialize
> each with &button1, &cursor, etc? Also, how is size_t freed?
the array to.
Exactly! :) Either you or the compiler must keep track of it. void*
removes any trace of type information.
> If some one knows void pointer syntax that would be helpful.
import std.stdio;
void main()
{
int i;
double d;
void*[] array;
array ~= cast(void*)&
y int vertCount();// getter
public @property int vertCount(int); // setter
void draw(){}
}
If some one knows void pointer syntax that would be helpful. As
I understand it there is a type called size_t that takes the
address of as a a value. Can I make an array of these and
simply initi
ferent sorts of widgets into a
single array was so I did not have to track what each type of
object was; not tracking what each object in the array is I have
no means of knowing what to cast each Widget in the array to.
If some one knows void pointer syntax that would be helpful. As I
understan
On Mon, May 14, 2012 at 12:05:53PM -0700, H. S. Teoh wrote:
> On Mon, May 14, 2012 at 08:40:30PM +0200, Stephen Jones wrote:
> > I want an array of different classes of objects. I tried to
> > subsume the differences by extending the classes under a single
> > interface/abstract class/super class (
On Mon, May 14, 2012 at 08:40:30PM +0200, Stephen Jones wrote:
> I want an array of different classes of objects. I tried to
> subsume the differences by extending the classes under a single
> interface/abstract class/super class (3 different approaches) all
> to no avail as I could not access the
I want an array of different classes of objects. I tried to
subsume the differences by extending the classes under a single
interface/abstract class/super class (3 different approaches) all
to no avail as I could not access the public variables of the
instantiated classes while storing them in an
On Fri, 29 Oct 2010 12:57:39 -0400
bearophile wrote:
> I have added your example here:
>
> http://d.puremagic.com/issues/show_bug.cgi?id=4539
Thank you for your answers. (I'm pleased to see I was not totally stupid to
find this behaviour somewhat nonsensical ;-) .)
Denis
-- -- -- -- -- -- --
I have added your example here:
http://d.puremagic.com/issues/show_bug.cgi?id=4539
Bye,
bearophile
spir wrote:
Hello,
I have a little issue with pointer syntax:
auto toS = &("abc") ; // ok
auto toS = &"abc" ; // ok
auto toI = &(1) ; // Error: constant 1 is not an lvalue
auto toI = &1 ; // Error: c
Hello,
I have a little issue with pointer syntax:
auto toS = &("abc") ; // ok
auto toS = &"abc" ; // ok
auto toI = &(1) ; // Error: constant 1 is not an lvalue
auto toI = &1 ; // Error: constant 1 is not an
> D dynamic arrays are not bad, but they are not very efficient,
I meant associative array, sorry.
spir:
> (Hope you don't mind if I send other bits of code to be improved that way?)
Feel free to show them, if I am busy other people may give you an answer. The
worst that may happen is that no one answers you.
> Right. I think at keeping explicit defaults like "int element = 0" for
> docume
On 10/14/10, bearophile wrote:
> Generally the field dereferencing doesn't require the "(*symbol).name", in D
> you use "symbol.name".
> Pointers to arrays are possible, but quite uncommon in D.
I'm not sure, but I think function pointers (the C syntax ones, not
variables declared with function/
On Thu, 14 Oct 2010 17:16:23 -0400
bearophile wrote:
> spir:
>
> > As a way to start learning D by practicing, I'm trying to implement a
> > symbol table as linked list: see prototype code of the structs below.
> > (Hints about good D coding welcome :-)
>
> I have modified your code a little:
spir:
> As a way to start learning D by practicing, I'm trying to implement a symbol
> table as linked list: see prototype code of the structs below. (Hints about
> good D coding welcome :-)
I have modified your code a little:
struct Symbol {
string name;
int element;
Symbol* next;
Hello,
As a way to start learning D by practicing, I'm trying to implement a symbol
table as linked list: see prototype code of the structs below. (Hints about
good D coding welcome :-)
2 little questions about pointers:
1. To please the compiler, I had to wrap dereferencing in parens, like in
22 matches
Mail list logo