[Fwd: Re: Re: Calling LDAP C API from Smalltalk]

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Fwd: Re: Re: Calling LDAP C API from Smalltalk]

Stephen Woolerton
.. an email that didn't get copied to the list (from Paolo to me)

-------- Original Message --------
Subject: Re: [Help-smalltalk] Re: Calling LDAP C API from Smalltalk
Date: Sun, 28 Sep 2008 13:56:08 +0200
From: Paolo Bonzini <[hidden email]>
To: Stephen Woolerton <[hidden email]>
References: <[hidden email]>
<[hidden email]> <[hidden email]>
<[hidden email]> <[hidden email]>
<[hidden email]> <[hidden email]>
<[hidden email]> <[hidden email]>
<[hidden email]>


> It is rather ironic that the reason I began this exercise was to work
> with mail routing on an LDAP server! The very attribute that won't
> display the value :-).

I don't understand, did the C program work? :-)

>   CObject subclass: BER [
>     " -----------------------
>     LBER_F( void )
>     ber_free LDAP_P((
>         BerElement *ber,
>         int freebuf ));
>     ------------------------- "
>       BER class >> free [
>     <cCall: 'ber_free' returning: #void args: #(#self #int)>
>     ]
>   ]

Why is this a class method?  You should have done something like

    free: arg [
       <cCall: 'ber_free' returning: #void args: #(#self #int)>
    ]

    free [ self free: 0]

and likewise:

>   CObject subclass: LDAPMessage [
>       LDAPMessage class >> free [
>     <cCall: 'ldap_msgfree' returning: #int args: #(#self)>
>     ]
>   ]

This should also use an instance-side method.

Now it would be a nice exercise to turn it into a more Smalltalk-like API.

Paolo



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk