Skip to content

Make nannou::app receive a closure.  #793

@alexfertel

Description

@alexfertel

Currently, nannou::app and, in general, the app::Builder API expect an argument of type fn, but it would be nice to be able to pass a closure instead.

My use case is that I'm writing a CLI wrapper to speed up my workflow, and I need to close over the environment in model, update, and view, but I can't because they have to be of type fn.

I think this wouldn't be a breaking change because you can pass a function in a place where a closure is expected, but not the other way around. However, there may be some nuance I am not aware of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions