help-octave
[Top][All Lists]
Advanced

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

RE: override display() for class


From: Steve White
Subject: RE: override display() for class
Date: Sat, 11 Dec 2010 21:38:45 +0100

Hi again Pascal,

Thanks for checking Matlab's behavior!

As I understand it, there is no way in Octave to achieve this behavior
(which seems very natural), and that to you, since Matlab also seems to
lack any way to achieve it, the behavior is not "valid".

So I'l lead to propose that a switch be added to Octave, which would turn
on ecohing of statements assigning variables to class objects in a way
similar to that for built-in types. This way, Octave would by default emulate
MatLab, but could be made to behave in a way more natural to 
object-oriented programmers.

Is it worth a feature request?

I don't mean to sound impudent.  I've only been working with Octave for a 
couple of weeks, so I'm not clear on the attitude of the community to changes 
that would diverge from MatLab, or to new ideas in general...

Cheers!

----------------------------------------
> Date: Fri, 10 Dec 2010 09:14:37 -0800
> From: address@hidden
> To: address@hidden
> Subject: RE: override display() for class
>
>
>
> Steve White wrote:
> >
> >
> > The question is, how do I emulate the built-in behavior wherein
> > typing in an assignment results in the variable name as well as
> > the value being printed?
> >
> >
>
> I looked briefly into MatLab, and Octave behaviour is quite similar:
> a= 1
> results in
> a =
> 1
> while
> b=someclass(randn(3, 3))
> results in a call to display(b)
>
> so the behaviour you're asking for is only valid, as far as I can see, for
> basic types: double, int, ...
>
> Regards
>
> Pascal
                                          


reply via email to

[Prev in Thread] Current Thread [Next in Thread]