Re: [vos-d] Re: Python scripting

2006-02-08 Thread Peter Amstutz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 8 Feb 2006, Lalo Martins wrote:


The SWIG bindigns are a wrapper for the whole API.  AFAICS, there is no
way to take an existing Vobject from C++, turn it into a Python object,
and send it as an argument to a Python function.  SWIG simply doesn't do
this.  I may be wrong, but I couldn't find a way.  Rather, the python


Um?  Unless I misunderstand what you want, this is exactly the purpose of 
SWIG's C++ support.  See the discussion of proxy classes:

http://www.swig.org/Doc1.3/Python.html#Python_nn28

Have you looked at the python programs using the existing SWIG bindngs, in 
vos/swig/tutorials?


[   Peter Amstutz   ][ [EMAIL PROTECTED] ][ [EMAIL PROTECTED]  ]
[Lead Programmer][Interreality Project][Virtual Reality for the Internet]
[ VOS: Next Generation Internet Communication][ http://interreality.org ]
[ http://interreality.org/~tetron ][ pgpkey:  pgpkeys.mit.edu  18C21DF7 ]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFD6mNQaeHUyhjCHfcRAuREAJ4xS97w0vWyMt7SiXIyen/DUsKKTgCfUzy/
4BW4TJLpkffbjk/+kQ0kNNY=
=yFAW
-END PGP SIGNATURE-


___
vos-d mailing list
vos-d@interreality.org
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d


[vos-d] Re: Python scripting

2006-02-08 Thread Lalo Martins
And so says Peter Amstutz on 09/02/06 05:31...
 On Wed, 8 Feb 2006, Lalo Martins wrote:
 
 The SWIG bindigns are a wrapper for the whole API.  AFAICS, there is no
 way to take an existing Vobject from C++, turn it into a Python object,
 and send it as an argument to a Python function.  SWIG simply doesn't do
 this.  I may be wrong, but I couldn't find a way.  Rather, the python
 
 
 Um?  Unless I misunderstand what you want, this is exactly the purpose
 of SWIG's C++ support.  See the discussion of proxy classes:
 http://www.swig.org/Doc1.3/Python.html#Python_nn28

Then I think you misunderstood; a proxy class wraps an existing class,
I'm talking about wrapping an existing instance.  After reading the
whole text of the chapter above, I:

- still don't see how to do that
- believe even more strongly that swig is not meant for what I'm doing
- believe even more strongly that complete, 1:1 wrapping as done by swig
is a very poor way to bridge between languages :-)

 Have you looked at the python programs using the existing SWIG bindngs,
 in vos/swig/tutorials?

I have; since they are in Python, they are unrelated to what I'm doing here.

===

Another way to try to explain what I mean is by using the terminology of
world as used by the guile manual.  It talks about an application in
the scheme world, which calls functions defined in C, as opposed to an
application in the C world, which calls back into Scheme code (typically
scripts).

Swig helps with the former; it *may* help with the latter, but I can't
find how from the documentation.

Even if I could, I'd rather maintain this separate set of (higher-level)
bindings, than give these scripts the full power of the VOS api; it's
less trouble in the long term.  I don't want these scripts to be able to
easily create a site, set ACLs, load/unload site extensions, for
example.  All they're supposed to do is traverse the object hierarchy
and communicate trough messages.

best,
   Lalo Martins
--
  So many of our dreams at first seem impossible,
   then they seem improbable, and then, when we
   summon the will, they soon become inevitable.
--
personal:  http://www.laranja.org/
technical:http://lalo.revisioncontrol.net/
GNU: never give up freedom http://www.gnu.org/


___
vos-d mailing list
vos-d@interreality.org
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d