PyHP_pph icon indicating copy to clipboard operation
PyHP_pph copied to clipboard

How do we accept input?

Open ghost opened this issue 8 years ago • 6 comments

Do we do it similar to how we're doing output? i.e.

Console.StandardInputStream << $InputVar;
if ($InputVar ====== "exit")
  {
    Exit(0);
  } else
  {
    BreakEverything()
  }

ghost avatar Jun 22 '17 20:06 ghost

We should do something like Python 2's raw_input and input, where the much simpler to type input is incredibly dangerous, while the uglier and harder to type raw_input is safe.

Kampfkarren avatar Jun 22 '17 20:06 Kampfkarren

So what should the 'dangerous' one do?

ghost avatar Jun 22 '17 22:06 ghost

Just like the one in Python 2, treat it as an expression.

Kampfkarren avatar Jun 23 '17 02:06 Kampfkarren

What about if the program is compiled? Do we embed an entire CIC into the program?

ghost avatar Jun 23 '17 23:06 ghost

Isn't that what Python freezing does?

Kampfkarren avatar Jun 24 '17 00:06 Kampfkarren

Isn't that with bytecode, though? So it has to do that anyway, so it's not much trouble to allow eval, exec, etc.

ghost avatar Jun 24 '17 14:06 ghost