Skip to content

Roundtrip printing #466

@YingboMa

Description

@YingboMa

Currently, show displays units that are cannot be copy-pasted into Julia REPL. This makes serializing expressions impossible if the expression contains unitful objects.

julia> using Unitful

julia> unit = u"m/s";

julia> show(unit)
m s⁻¹
julia> :(x = $unit)
:(x = m s⁻¹)

In Julia, by convention, pretty print should only be done on MIME methods, and default show should do roundtrip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions