Re: [Siop-development] Passing by value and by reference
Status: Pre-Alpha
Brought to you by:
slobberchops
From: Rapheal K. <ra...@ma...> - 2006-07-03 17:31:10
|
>> Now it's a little easier: >> >> >> # Helper method to define Python class >> # In the future, may provide helper library to do this >> def pyclass( name, *parents, &definition ) >> klass = $types.ClassType( name.to_s, >> Siop::val( Siop::Tuple( *parents ) ), >> Siop::val( {} ) >> ) >> klass.instance_eval &definition unless definition.nil? >> klass >> end >> > > I would hope that code like this would be part of the siop framework, at > least at some point. You're not going to expect a siop user like me to > write or maintain code like that, are you? > > Meaning, siop will include code for creating classes? I think that class creation should be one of the levels. Then it would be a lot simpler to code the above thingy. There would, for one, be no need to do the val thing nor the tuple thing, because the bridge on the receiving side could take care of all of that for you. > I had a similar reaction to the wxRython snippets...they seemed to be a > mix of generic and specific code. I don't want to see the sausage-making > generic code. It's all about encapsulating the icky parts into the > framework so clients like us can just use remote classes and objects as > if they were local. > > Something like this would be cool: > > class MyApp < siop.remote_class(:wx, :App) > def on_init > # blah blah blah > end > end > Right, that's what I am thinking. |