bugGNU Octave - Bugs: bug #44036, interpreter does not recognize...

 
 

bug #44036: interpreter does not recognize classdef (syntax error)

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Sun 18 Jan 2015 03:26:31 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 19 Jan 2015 01:57:48 PM UTC, comment #5:

How important this is is obviouly a matter of opinion and
programming style. Everyone has their own of both.

So, does anyone know how hard it would be to implement
this? Obviously, if it is pretty easy it would be "nice."
And, if it is hard and time consuming it is not likely
to get done anyhow.

Michael Godfrey <godfrey>
Project Member
Mon 19 Jan 2015 12:45:02 PM UTC, comment #4:

A simple usage case, which I believe is related to this, is being able to define a new class on an Octave program or script. We can do this in Octave (not in Matlab), and it's a great feature which allows us to write a program in a single file, i.e., something such as

Also, being able to define things at the prompt is very handy while writing code. One probably won't create new classdef at the prompt to work on real time, but may do so to test one while writing it.

Carnë Draug <carandraug>
Project Member
Mon 19 Jan 2015 04:37:34 AM UTC, comment #3:

Defining classes at the command line doesn't seem nearly as useful as functions. A class is more likely to be long with properties and class methods and the chance of entering it correctly on the command line is pretty low. It doesn't bother me that Octave doesn't allow this, but maybe there is a usage case I'm not seeing.

Rik <rik5>
Project Administrator
Sun 18 Jan 2015 06:30:02 PM UTC, comment #2:

Why is not expected to work? Not implemented yet or not possible at all? Being able to define functions at the Octave prompt is a very handy feature missing in Matlab, would be nice if it was possible to also define classdef blocks.

Carnë Draug <carandraug>
Project Member
Sun 18 Jan 2015 05:42:29 PM UTC, comment #1:

I don't think this is expected to work.

Do you want a better error message that says that classdef objects must be defined in files?

Looking at oct-parse.in.yy, I see:

I guess this message is somehow not being triggered for your example.

John W. Eaton <jwe>
Project Administrator
Sun 18 Jan 2015 03:26:31 PM UTC, original submission:

Creating a new class with classdef in a file works fine but when trying to define a new class on the interpreter, Octave does not recognize it.

Carnë Draug <carandraug>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by carandraug (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1