nathanfallet / ocaml

An OCaml editor, top level, and learning place for iOS, iPadOS and macOS
https://ocaml-learn-code.com
GNU General Public License v3.0
70 stars 8 forks source link

Be able to stop code execution #9

Open nathanfallet opened 3 years ago

nathanfallet commented 3 years ago

Describe the bug When some never ending code is executed, we are unable to stop its execution in the top level

To Reproduce Steps to reproduce the behavior:

  1. Write some never ending code
  2. Execute it

Example code:

let a n =
  let b = ref 0 in
  while n <> 0 do
    b := !b + 1
  done;;
a 1;;

Expected behavior Add a way to stop code execution

Screenshots image

Smartphone (please complete the following information):

Additional context

nathanfallet commented 3 years ago

With #21, it's now possible to reload the console to stop code execution. Now we need to see if we add a stop button to replace the play button while executing, or only use the reload button.