Skip to content

Debug print (toString / str / to_s / repr / inspect / etc) implementations #299

@GreyCat

Description

@GreyCat

Currently, the classes we generate are not very string conversion friendly. Many languages feature some kind of debugging print aid (like toString() or repr or stuff like that) that allows us to customize what would be printed out during to string conversion of an object.

From bird's eye perspective, there are two major variations of that feature:

  • In some languages (Java, C#, at, to some extent, C++) it's easier to generate toString-like method that would print out
  • In some languages (Ruby, Python, PHP, etc), it's probably easier to implement relevant code in KaitaiStruct that would achieve the same using reflection

Doing that should probably make debugging print much easier for all languages. Right now only Ruby and, to some extent, JavaScript, does sane debug printing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions