Skip to content

Conversation

@foreverallama
Copy link
Contributor

@foreverallama foreverallama commented Dec 10, 2025

Reference: #221

  • Added new basic type FunctionHandle
  • Read support in v7 and HDF formats
  • Updated test for function_handles.mat to reflect new type

TODO: Add write support

If the new type is sufficient then I'll move on to writing.

* MAT_HDF: New method m_write() to write function handles
* MAT_HDF: New constants for MATLAB_object_decode 1 to 3
* write.jl: Add RW test
* read.jl: Remove standalone read test
* MAT_subsys: Fix for writing MatlabOpaque objects with object ID = 0
* MAT_subsys: Added class "function_handle_workspace" to list of saveobj classes
* MAT_subsys: Fix for serializing nested objects
@foreverallama
Copy link
Contributor Author

Added write support for function handles

  • Removed standalone read test and incorporated it into write.jl as its easier to read then write.
  • Added constants for the MATLAB_object_decode attribute

Some types of function handles use opaque objects which revealed some bugs which has been fixed:

  • Fix: Writing objects with an object ID = 0
  • Fix: Serializing nested properties uses a copy for structs/cells to avoid overwriting the property value with object metadata. I think the copy is cheap as it should be copying references. Now we're only modifying the copy with nested object metadata (if any) instead.

These bugs are implicitly tested with RW for function handles.

I think the FunctionHandle type can be extended as a Dict like the other types. It'll keep things uniform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant