Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Wrapping a C Library: Allocation and duplication issues
jbonnar@gmail.com
9/11/2006 7:54:00 PM
I'm writing a wrapper for a C library [1] written in a very object
orientated style. Since C isn't an OO language, it uses conventions
instead. All of the "classes" are created with a librdf_new_classname
method which acts almost the same as Ruby's Class#new.
The problem I'm having is cleanly separating allocation from
initialization. Since most of the class construction functions require
arguments to initialize the object, I can't define separate alloc and
initialize functions.
The only option I see is to use Ruby 1.6 style code and define a
Klass.new method for my classes, but how should Klass#clone and
Klass#dup methods be written that take into account object freezing,
taint, etc?
Thanks,
Justin
[1]
http://l...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Wrapping a C Library: Allocation and duplication issues
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password