Skip to content

add parse(Complex{T}, string) #22250

@stevengj

Description

@stevengj

As @ChrisRackauckas points out on discourse, this shouldn't really be done in a package because Base.parse and all of the argument types are "owned" by Base.

Would also be nice not to have to use horribly inefficient techniques involving eval; see also #21935.

Should be straightforward to implement. The main question in my mind is how permissive it should be:

  • Should it allow arbitrary whitespace between the real and imaginary parts? e.g. "3+4im" and 3 + 4im both allowed?
  • Should it require im, or accept the common variants im, i, j, and I?
  • Should it require 3+4im, or also allow 3+4*im?
  • Should it support the Fortran style (real,imag)? (Probably not, since we don't support Fortran-style real literals 1.0D+00 either.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions