#include
function hello(){
struct obj = { char *data = 'hello'}
obj.add = obj_add(obj);
return obj;
}
function obj_add(obj){
function add(value){
obj.data += value;
return obj;
}
}
main(){
test = hello();
test.add('world');
printf(test.data);
}
I
On 2/8/07, Leif K-Brooks <[EMAIL PROTECTED]> wrote:
> def obj():
> result = {'data': 'hello'}
> result['add'] = adder(result)
> return result
>
> def adder(obj):
> def add(value):
> obj['data'] += va
"Gert Cuykens" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| def obj():
|return {'data':'hello',
|'add':add(v)}
v is undefined
| def add(v):
|data=data+v
data is undefined
| if __name__ == '__main__
Gert Cuykens wrote:
> def obj():
>return {'data':'hello',
>'add':add(v)}
>
> def add(v):
>data=data+v
>
> if __name__ == '__main__':
>test=obj()
>test.add('world')
>print t
def obj():
return {'data':'hello',
'add':add(v)}
def add(v):
data=data+v
if __name__ == '__main__':
test=obj()
test.add('world')
print test.data
I don't know why but i have one of does none class