Skip to content

Commit

Permalink
Updating: minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
gallettilance committed Apr 26, 2018
1 parent 1a0cc75 commit ce9b848
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions src/cli.dats
Original file line number Diff line number Diff line change
Expand Up @@ -189,26 +189,34 @@ case+ args of
| nil0() => (println!("must provide argument to define"); ())
| cons0(a, _) => let
val f = "./" + a + ".txt"
val out = fileref_open_exn(f, file_mode_a)
in
if file_exists("blockchain.txt")
then
(
let
val () = fprint_string(out, "0")
val () = fileref_close(out)
in
()
end
)
else
if file_exists(f)
then (println!(a + " is already defined"); ())
else
(
let
val () = fprint_string(out, "10")
val () = fileref_close(out)
val out = fileref_open_exn(f, file_mode_a)
in
()
end
if file_exists("blockchain.txt")
then
(
let
val () = fprint_string(out, "0")
val () = fileref_close(out)
in
()
end
)
else
(
let
val () = fprint_string(out, "10")
val () = fileref_close(out)
in
()
end
)
end
)
end

Expand Down

0 comments on commit ce9b848

Please sign in to comment.