PyHP_pph icon indicating copy to clipboard operation
PyHP_pph copied to clipboard

How do you print?

Open Kampfkarren opened this issue 8 years ago • 9 comments

Options:

  • Python 2/PHP style: print "text"; or echo "text";
  • Python 3 style: print("text");
  • C++ style: cout << "text" << endl;
  • C# style: Console.WriteLine("text");

Kampfkarren avatar Jun 18 '17 18:06 Kampfkarren

We should mix the verbosity of C#/Java with the ugly syntax of C++.

Console.StandardOutputStream << "text" << Console.Characters.EndLine;

as-com avatar Jun 18 '17 18:06 as-com

I second that motion...

On Sun, Jun 18, 2017 at 1:28 PM Andrew Sun͈̮ [email protected] wrote:

We should mix the verbosity of C#/Java with the ugly syntax of C++.

Console.StandardOutput << "text" << System.EndLine;

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PyHP-pph/PyHP_pph/issues/35#issuecomment-309294274, or mute the thread https://github.com/notifications/unsubscribe-auth/ASo3UbWzQkgh0UA3zbBR4PrIpKkrH8c6ks5sFWw2gaJpZM4N9kVP .

prydt avatar Jun 18 '17 18:06 prydt

Sounds good, but now we need to have a specification for streams.

Kampfkarren avatar Jun 18 '17 19:06 Kampfkarren

We should also take from python2 and have Console.StandardOutputStream not be a stream, but a special language construct. It should look exactly like a stream though.

Boscillator avatar Jun 19 '17 14:06 Boscillator

So it looks like a stream, but it's really just a special syntax just for that? You're a genius.

Kampfkarren avatar Jun 19 '17 15:06 Kampfkarren

We need to add in some Python as well.

Console.StandardOutputStream << print("text") << Console.Characters.EndLine;

But I've always thought print() was a bit misleading... Screw convention, let's use disp() (short for display)!

Console.StandardOutputStream << disp("text") << Console.Characters.EndLine;

ghost avatar Jun 19 '17 18:06 ghost

And the chevrons should point forwards to indicate a progressive language.

Console.StandardOutputStream >> disp("text") >> Console.Characters.EndLine;

Of course, the meaning is the same. Only the chevrons should change.

ghost avatar Jun 19 '17 18:06 ghost

I'll turn this into a PR.

ghost avatar Jun 19 '17 18:06 ghost

If I'm understanding right, you're suggesting a special syntax of "Console.StandardOutputStream >> disp(string here) >> Console.Characters.EndLine;"? That's fantastic. Absolute support.

Kampfkarren avatar Jun 19 '17 19:06 Kampfkarren