Skip to content

Make boot an optional argument rather than an argument that is an optional #72

@mdales

Description

@mdales

When I started Claudius I thought there would be more use for the boot function, as it was something I used fairly regularly in TIC-80. But I think because of the more functional style of coding in OCaml, I find that in most the examples they don't use a boot function, and so you end up having to pass in None to run:

let () =
  Screen.create 640 480 1 (Palette.generate_mono_palette 16) |>
  Base.run "Genuary Day 1: Particals" None tick

Instead, we should just change the signature of run (and run_functional) to have boot as an optional argument, so if you don't need it nothing has to be specified. It's sad to break the API, but in the long run I think will simplify the common case and lean more into Claudius being in favour of functional style usage (if you have a boot function, that means you probably have an initial state, which implies what you're doing isn't functional).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions