[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] OOPs not based on Structs.



SWIG (a toolkit for wrapping external code) with Perl uses blessed
scalars for the interface.  When handling almost any C object, it uses 
a scalar (containing the pointer value), blessed into an appropriate
package.  It's a very logical way of handling stuff.  After all, the
Perl interpreter has no use for the contents of the C object, except
passing it around to the wrapped C functions.

Of course, it also means that if you bless a scalar value
appropriately, you can get Perl to call C code with random pointers.
That's almost like programming in C!
-- 
Ariel Scolnicov        |"GCAAGAATTGAACTGTAG"            | ariels@compugen.co.il
Compugen Ltd.          |Tel: +972-2-6795059 (Jerusalem)	\ We recycle all our Hz
72 Pinhas Rosen St.    |Tel: +972-3-7658514 (Main office)`---------------------
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555    http://3w.compugen.co.il/~ariels

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe