Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Julian Leviston
Answering my own question... On 09/06/2011, at 4:27 PM, Julian Leviston wrote: > See below... > > On 09/06/2011, at 2:59 PM, Josh Gargus wrote: > I really don't understand what this means: typedef struct object *(*method_t)(struct object *receiver, ...); method_t is a

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Wesley Smith
> One common idiom is to use a typedef while defining the type.  In this case, > you might write: > typedef struct object object_t; > typedef object_t *(*method_t)(object_t *receiver, ...); > > Okay, so in the initial example, why the typedef? What function is it > performing here? I thought typede

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Julian Leviston
See below... On 09/06/2011, at 2:59 PM, Josh Gargus wrote: >>> I really don't understand what this means: >>> >>> typedef struct object *(*method_t)(struct object *receiver, ...); >>> >>> method_t is a pointer to a function that returns an object pointer and >>> takes receiver and additional a

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread BGB
On 6/8/2011 10:03 PM, Josh Gargus wrote: Looks like you beat me to the punch on my last email... On Jun 8, 2011, at 9:39 PM, BGB wrote: apparently, some people don't like using typedef for some reason I am not entirely sure of... According to wikipedia (http://en.wikipedia.org/wiki/Struct

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Josh Gargus
Looks like you beat me to the punch on my last email... On Jun 8, 2011, at 9:39 PM, BGB wrote: > > > apparently, some people don't like using typedef for some reason I am not > entirely sure of... According to wikipedia (http://en.wikipedia.org/wiki/Struct_(C_programming_language) ), one of t

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Josh Gargus
On Jun 8, 2011, at 9:20 PM, Julian Leviston wrote: > Tanks everyone for answering on this so much... > > Comment/Question below, > > On 09/06/2011, at 4:56 AM, Kevin Jones wrote: > >> I really don't understand what this means: >> >> typedef struct object *(*method_t)(struct object *receiver,

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread BGB
On 6/8/2011 9:20 PM, Julian Leviston wrote: Tanks everyone for answering on this so much... Comment/Question below, On 09/06/2011, at 4:56 AM, Kevin Jones wrote: I really don't understand what this means: typedef struct object *(*method_t)(struct object *receiver, ...); method_t is a pointe

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Josh Gargus
OK, the lightbulb went on. Thanks guys. Cheers, Josh On Jun 8, 2011, at 12:35 PM, BGB wrote: > On 6/8/2011 12:13 PM, Josh Gargus wrote: >> >> >> On Jun 8, 2011, at 11:56 AM, Kevin Jones wrote: >> >>> Comments and explanations inline below. >>> >>> --- On Wed, 6/8/11, Julian Leviston wrote

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Julian Leviston
Tanks everyone for answering on this so much... Comment/Question below, On 09/06/2011, at 4:56 AM, Kevin Jones wrote: > I really don't understand what this means: > > typedef struct object *(*method_t)(struct object *receiver, ...); > > method_t is a pointer to a function that returns an objec

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread BGB
On 6/8/2011 12:13 PM, Josh Gargus wrote: On Jun 8, 2011, at 11:56 AM, Kevin Jones wrote: Comments and explanations inline below. --- On *Wed, 6/8/11, Julian Leviston />/* wrote: Also, what is this? struct vtable *_vt[0]; Is that creating a pointer

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Josh Gargus
On Jun 8, 2011, at 11:56 AM, Kevin Jones wrote: > Comments and explanations inline below. > > --- On Wed, 6/8/11, Julian Leviston wrote: > > Also, what is this? > > struct vtable *_vt[0]; > > Is that creating a pointer to a struct array which has zero elements in it? I > don't follow what t

Re: [fonc] Issues with understanding obj.c

2011-06-08 Thread Kevin Jones
Comments and explanations inline below. --- On Wed, 6/8/11, Julian Leviston wrote: From: Julian Leviston Subject: [fonc] Issues with understanding obj.c To: "Fundamentals of New Computing" Date: Wednesday, June 8, 2011, 11:00 AM Hi, I've been attempting to assimilate the corresponding code t

[fonc] Issues with understanding obj.c

2011-06-08 Thread Julian Leviston
Hi, I've been attempting to assimilate the corresponding code to Ian Piumerta's object model at http://piumarta.com/software/cola/objmodel2.pdf My C knowledge is lacking, because I don't understand some of the basics in it. I thought maybe some of you might be kind enough to elucidate. I real