octave-maintainers
[Top][All Lists]
Advanced

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

Re: Accepting arbitrary strings as structure field names


From: Rafael Laboissiere
Subject: Re: Accepting arbitrary strings as structure field names
Date: Sun, 5 Nov 2006 17:36:31 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Rafael Laboissiere <address@hidden> [2006-11-05 12:42]:

> There are two problems with this patch, at least:
> 
> 1) Command completion.  When doing
> 
>    octave> var.[TAB]
> 
>    we get:
> 
>    octave> address@hidden
> 
>    which results in a syntax error.
> 
> 2) Saving/loading in text mode fails:
> 
>    octave> var.("@#$%") = 0;
>    octave> save -text data var
>    octave> load data
>    error: load: bogus identifier address@hidden' found in file `'
>    error: load: internal error loading struct elements
>    error: load: trouble reading ascii file `data'
>    error: load: reading file data
> 
> I am thinking about writing a patch for addressing both issues above.  I
> would also introduce a built-in variable warn_arbitrary_string_in_field_name
> (or whichever name).  Do the Octave maintainers think it is worth
> implementing the idea?

Attached below is a trivial patch addressing both issues above (the built-in
variable mentioned above is not implemented though).  It is actually rather
a matter of removing than adding code.  The completion does now:

    octave> var.("@#$%") = 0;
    octave> var.a = 1;     
    octave> var.[TAB][TAB]
    var.("@#$%")  var.a

Of course, this will not complete:

    octave> var.("@[TAB]
    
but at least the completion will not end up proposing syntactically
erroneous code.
 
-- 
Rafael

Attachment: diffs
Description: Text document


reply via email to

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