From: Simon Forman Date: Fri, 23 Sep 2022 15:38:17 +0000 (-0700) Subject: autoformat X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=64d4a429789fd27b6363de81b17c7048628bdf27;p=joypy%2FThun.git autoformat --- diff --git a/implementations/Ocaml/helloworld/_build/.db b/implementations/Ocaml/helloworld/_build/.db index 258ebc1..08e2657 100644 Binary files a/implementations/Ocaml/helloworld/_build/.db and b/implementations/Ocaml/helloworld/_build/.db differ diff --git a/implementations/Ocaml/helloworld/_build/.digest-db b/implementations/Ocaml/helloworld/_build/.digest-db index 4c04e45..fc9d9e1 100644 Binary files a/implementations/Ocaml/helloworld/_build/.digest-db and b/implementations/Ocaml/helloworld/_build/.digest-db differ diff --git a/implementations/Ocaml/helloworld/_build/default/bin/.formatted/main.ml b/implementations/Ocaml/helloworld/_build/default/bin/.formatted/main.ml index 76bc33e..fd4a636 100644 --- a/implementations/Ocaml/helloworld/_build/default/bin/.formatted/main.ml +++ b/implementations/Ocaml/helloworld/_build/default/bin/.formatted/main.ml @@ -5,13 +5,20 @@ type joy_type = | JoyInt of int | JoyList of joy_type list -type joy_list = joy_type list +(* type joy_list = joy_type list *) let joy_true = JoyTrue let joy_false = JoyFalse let j_loop = JoySymbol "loop" -let empty_list = JoyList [] let zero = JoyInt 0 -let dummy = [ joy_true; joy_false; j_loop; zero ] -let list_get jt = match jt with JoyList el -> el | _ -> [] -let () = print_endline "Hello, World!" +let dummy = JoyList [ joy_true; joy_false; j_loop; zero ] + +let rec joy_to_string jt = + match jt with + | JoySymbol sym -> sym + | JoyTrue -> "true" + | JoyFalse -> "false" + | JoyInt i -> string_of_int i + | JoyList el -> "[" ^ String.concat " " (List.map joy_to_string el) ^ "]" + +let () = print_endline (joy_to_string dummy) diff --git a/implementations/Ocaml/helloworld/_build/log b/implementations/Ocaml/helloworld/_build/log index 584df09..d8542db 100644 --- a/implementations/Ocaml/helloworld/_build/log +++ b/implementations/Ocaml/helloworld/_build/log @@ -1,9 +1,9 @@ -# dune exec helloworld +# dune build --auto-promote @fmt # OCAMLPARAM: unset # Shared cache: disabled # Workspace root: /usr/home/sforman/src/Joypy/implementations/Ocaml/helloworld # Auto-detected concurrency: 8 -$ /usr/home/sforman/.opam/default/bin/ocamlc.opt -config > /tmp/dune_31d5e4_output +$ /usr/home/sforman/.opam/default/bin/ocamlc.opt -config > /tmp/dune_9b5fa0_output # Dune context: # { name = "default" # ; kind = "default" @@ -116,3 +116,28 @@ $ /usr/home/sforman/.opam/default/bin/ocamlc.opt -config > /tmp/dune_31d5e4_outp # ; windows_unicode = false # } # } +$ (cd _build/default && /usr/home/sforman/.opam/default/bin/ocamlformat --impl bin/main.ml) > _build/default/bin/.formatted/main.ml +$ /usr/local/bin/git --no-pager diff --no-index --color=always -u _build/default/bin/main.ml _build/default/bin/.formatted/main.ml +> diff --git a/_build/default/bin/main.ml b/_build/default/bin/.formatted/main.ml +> index 2fcd04c..fd4a636 100644 +> --- a/_build/default/bin/main.ml +> +++ b/_build/default/bin/.formatted/main.ml +> @@ -14,11 +14,11 @@ let zero = JoyInt 0 +> let dummy = JoyList [ joy_true; joy_false; j_loop; zero ] +> +> let rec joy_to_string jt = +> - match jt with +> - | JoySymbol sym -> sym +> - | JoyTrue -> "true" +> - | JoyFalse -> "false" +> - | JoyInt i -> string_of_int i +> - | JoyList el -> "[" ^ (String.concat " " (List.map joy_to_string el)) ^ "]";; +> + match jt with +> + | JoySymbol sym -> sym +> + | JoyTrue -> "true" +> + | JoyFalse -> "false" +> + | JoyInt i -> string_of_int i +> + | JoyList el -> "[" ^ String.concat " " (List.map joy_to_string el) ^ "]" +> +> let () = print_endline (joy_to_string dummy) +[1] diff --git a/implementations/Ocaml/helloworld/bin/main.ml b/implementations/Ocaml/helloworld/bin/main.ml index 2fcd04c..fd4a636 100644 --- a/implementations/Ocaml/helloworld/bin/main.ml +++ b/implementations/Ocaml/helloworld/bin/main.ml @@ -14,11 +14,11 @@ let zero = JoyInt 0 let dummy = JoyList [ joy_true; joy_false; j_loop; zero ] let rec joy_to_string jt = - match jt with - | JoySymbol sym -> sym - | JoyTrue -> "true" - | JoyFalse -> "false" - | JoyInt i -> string_of_int i - | JoyList el -> "[" ^ (String.concat " " (List.map joy_to_string el)) ^ "]";; + match jt with + | JoySymbol sym -> sym + | JoyTrue -> "true" + | JoyFalse -> "false" + | JoyInt i -> string_of_int i + | JoyList el -> "[" ^ String.concat " " (List.map joy_to_string el) ^ "]" let () = print_endline (joy_to_string dummy)