save/load anonymous function loses empty string in returned cell-array

David Bateman David.Bateman at motorola.com
Fri Apr 4 04:15:09 CDT 2008


Olaf Till wrote:
> On Thu, Apr 03, 2008 at 02:14:55PM -0400, John W. Eaton wrote:
> Content-Description: message body text
>   
>> On  3-Apr-2008, Olaf Till wrote:
>>
>> | Octave version: 3.0 (on Debian stable, from a package in unstable)
>> | 
>> | If an anonymous function which returns a cell-array containing an
>> | empty string is saved and reloaded, the entry with the empty string in
>> | the cell-array to be returned is lost:
>> | 
>> | octave3.0:39> a = @ () {""}
>> | a =
>> | 
>> | @() {}
>> | 
>> | octave3.0:40> save -binary test.dat a
>> | octave3.0:41> load test.dat
>> | octave3.0:42> a 
>> | a =
>> | 
>> | @() {}(0x0)
>>
>> Please try the following change.
>>
>> Thanks,
>>
>> jwe
>>     
>
> With the patch, it is fixed, but:
>
> I don't know, but with the patch the quotes around the string seem to
> be stored literally, i.e. single quotes or double quotes, depending on
> which were typed in. Will that not break saving in -mat format, if the
> string was given with double quotes? I can not test, since saving
> anonymous functions in -mat format does not work now anyway.
>
>   
Saving anonymous function in mat-files has been one of the things I
wanted for a long while. Though as the format for anonymous functions in
mat-files is undocumented, and quite bizarre, it is quite difficult to
implement. Maybe one of these days I'll be motivated enough to take
another look at this but I don't know when.. Its probably move important
to support the embedded HDF mat-file format in any case that is what
should be done first on this front.

D.




-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



More information about the Bug-octave mailing list