PyHP-pph / PyHP_pph

This repository serves as a centre for collaboration on the PyHP++# language. It will also include a functioning interpreter and compiler for PyHP++# once the standard is finalised.
https://www.reddit.com/r/PyHP_pph/
GNU Affero General Public License v3.0
23 stars 3 forks source link

How do we accept input? #41

Open ghost opened 7 years ago

ghost commented 7 years ago

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

Console.StandardInputStream << $InputVar;
if ($InputVar ====== "exit")
  {
    Exit(0);
  } else
  {
    BreakEverything()
  }
Kampfkarren commented 7 years ago

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.

ghost commented 7 years ago

So what should the 'dangerous' one do?

Kampfkarren commented 7 years ago

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

ghost commented 7 years ago

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

Kampfkarren commented 7 years ago

Isn't that what Python freezing does?

ghost commented 7 years ago

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