Re: [Vala] __str__ method in vala ?



* Roberto Majadas wrote, On 24/10/08 12:50:
Hi everyone :

Could be really interesting a method like __str__ method in python. 

From python doc :

__str__(
self)
        Called by the str() built-in function and by the print statement
        to compute the ``informal'' string representation of an object.
        This differs from __repr__() in that it does not have to be a
        valid Python expression: a more convenient or concise
        representation may be used instead. The return value must be a
        string object.
        
Examples : 
  
Opinions ?
  

I suppose you could define a debug interface that objects could implement.

Is is possible to query a vala object to see if it implements a certain
interface?
That is one of the IInterface benefits I forgot about on IRC this week.

Sam



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]