hammerlab / genspio

Generate Shell Phrases In OCaml
https://smondet.gitlab.io/genspio-doc/
Apache License 2.0
49 stars 3 forks source link

Semantics for commands *after* `with_signal` #54

Closed smondet closed 7 years ago

smondet commented 7 years ago

Piece of code like this:

        seq [
          with_signal
            (* ~signal_name:"INT" *)
            ~catch:(
              seq [
                eprintf (string "Get didn't work, creating...\\n") [];
                tmp#set (get_successful_single_string create ~or_else:fail);
                sayl "'Create' got %s\\n" [tmp#get];
              ]
            )
            (fun jump ->
               seq [
                 eprintf (string "Trying 'Get'\\n") [];
                 tmp#set (get_successful_single_string get ~or_else:jump);
                 eprintf (string "'Get' got %s\\n") [tmp#get];
                 if_seq (tmp#get =$= string "null") ~t:[jump];
               ]);
          Magic.unit "echo \"magic: $?\"";
        ]

In the cases were jump is called (and hence catch happens), the display has:

magic: 143

Need to investigate and/or document this.

smondet commented 7 years ago

with_signal was totally removed in #61