slang-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] Re: Why __add_string() is not used for strcat()?


Hello John,

"John E. Davis" <davis@xxxxxxxxxxxxx> wrote:
> =?UTF-8?Q?J=C3=B6rg?= Sommer <joerg@xxxxxxxxxxxx> wrote:
>>why is the function registered with __add_string() not used for strlen(),
>>strcat() and thelike? I thought this functions is used everywhere a
>>string is needed.
>
> No.  It simply defines a string representation of a user-defined type.
> It does not automatically convert the object to a string when one is
> needed.
>
>  […]
>
> The C interface permits application-defined types to be transparantly
> converted to strings, but I have not added a "typecast" method to the
> slang layer yet.  Is that what you are looking for?

Yes. I want to fake the access to a variable. Every write access should
trigger an update of another variable. For this, I want to use a user
defined data type and overload the assignment variable. Because the rest
of the code must still work I have to wrap all accesses to this variable.
A method to overload the typecast would be very nice.

Bye, Jörg.
-- 
A red sign on the door of a physics professor: 'If this sign is blue,
you're going too fast.'



[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]