Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Change std.stdio by using UFCS #515

Closed
wants to merge 3 commits into from

2 participants

@9rnsr
Collaborator

Change following member functions to module function:

  • byLine, byChunk, and byRecord
  • write, writeln, writef, and writefln
  • readf, and readln
@schveiguy
Collaborator

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"?

@9rnsr
Collaborator

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.

@schveiguy
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.