classdef syntax question

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

classdef syntax question

John W. Eaton
Administrator
Does Matlab require that "classdef NAME < SUPERCLASS" all appear on a
single line?  If not, where are newlines allowed?

Thanks,

jwe

Reply | Threaded
Open this post in threaded view
|

Re: classdef syntax question

apjanke-floss
You can use "..." continuations in it just like any other Matlab line of
code, and AFAIK they can break the line anywhere, same as other Matlab
code lines.

Cheers,
Andrew

On 4/17/19 5:20 PM, John W. Eaton wrote:
> Does Matlab require that "classdef NAME < SUPERCLASS" all appear on a
> single line?  If not, where are newlines allowed?
>
> Thanks,
>
> jwe
>


Reply | Threaded
Open this post in threaded view
|

Re: classdef syntax question

John W. Eaton
Administrator
On 4/17/19 6:31 PM, Andrew Janke wrote:
> You can use "..." continuations in it just like any other Matlab line of
> code, and AFAIK they can break the line anywhere, same as other Matlab
> code lines.

Thanks.  So

   classdef CLASSNAME ...
      < SUPERCLASS

and variations of that would be allowed but not

   classdef CLASSNAME
     < SUPERCLASS

?

That's what Octave should also allow now.

jwe


Reply | Threaded
Open this post in threaded view
|

Re: classdef syntax question

apjanke-floss


On 4/17/19 7:26 PM, John W. Eaton wrote:

> On 4/17/19 6:31 PM, Andrew Janke wrote:
>> You can use "..." continuations in it just like any other Matlab line of
>> code, and AFAIK they can break the line anywhere, same as other Matlab
>> code lines.
>
> Thanks.  So
>
>   classdef CLASSNAME ...
>      < SUPERCLASS
>
> and variations of that would be allowed but not
>
>   classdef CLASSNAME
>     < SUPERCLASS
>
> ?
>
> That's what Octave should also allow now.
>
> jwe
>

I believe that is corret.

Andrew