Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some overloads violate function intent #79

Closed
timholy opened this issue Jun 7, 2024 · 2 comments
Closed

Some overloads violate function intent #79

timholy opened this issue Jun 7, 2024 · 2 comments

Comments

@timholy
Copy link
Contributor

timholy commented Jun 7, 2024

Some of the overloads of Base methods violate the intended API of the function. For example, print(x, y, z...) should print all of x, y, and z to the terminal, yet we have methods that add a format argument that isn't displayed:

By comparison:

julia> print("Hello", Float32)
HelloFloat32

The way that Base intends you to customize output of print is with an IOContext wrapper around the io object.

@diegozea
Copy link
Owner

Hi @timholy !

I think I will change the read , parse and write and print for (something, FileFormat), to read_file, parse_file, print_file, and write_file, respectively. Do you think that's a better approach?

Cheers,

@diegozea
Copy link
Owner

Hi!

MIToS 2.18 now defines the read_file, parse_file, print_file, and write_file functions for reading and writing in specific file formats—subtypes of FileFormat—instead of overloading the functions from Base. The signatures and behaviors don't change, so the migration will require replacing read with read_file and so on. So, for example read(msafile, FASTA) becomes read_file(msafile, FASTA).

Cheers

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

No branches or pull requests

2 participants