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

Already on GitHub? Sign in to your account

Change std.stdio by using UFCS #515

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
Member

9rnsr commented Apr 2, 2012

Change following member functions to module function:

  • byLine, byChunk, and byRecord
  • write, writeln, writef, and writefln
  • readf, and readln
Member

schveiguy commented Apr 2, 2012

I think given the discussion we are having in the NG about how templates do not pull in UFCS methods, it may be premature to do this. Is there a compelling reason for this change, or is it "just because we can"?

Member

9rnsr commented Apr 3, 2012

It is "just because we can". But, formatting and iterating are orthogonal functions to the wrapping FILE handle in C-lib.
I've been thought that these functions should be placed outside of File struct, in the maintenance of std.format module.

But, OK. UFCS and name-lookup is still debatable. I can wait to do this.

Member

schveiguy commented Apr 4, 2012

But, formatting and iterating are orthogonal functions to the wrapping FILE handle in C-lib.

Yes, but C code never existed that said stderr.fprintf("hello world\n");

My point is, anything that is currently a member function of a struct/class cannot be moved outside the struct/class without possibly breaking code inside a template.

I'm not trying to be a pest, I know you've agreed to put it on hold, I just wanted to make it clear what my objections are so they aren't forgotten :)

@9rnsr 9rnsr closed this Jun 24, 2012

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