Skip to content

Should class instances follow the same block model as variables? #7

@carlosperate

Description

@carlosperate

So taking the neopixels as an example.
We currently have blocks, like the "clear", that are meant to only take "neopixel_object" type blocks as an input, to be used as an instance of the NeoPixel class, but due to the nature of the variable block you could attach any type of variable to this.
So you could set variable foo to 0 and then attach foo to the clear block to generate the equivalent of 0.clear().
Apart from that, even things like figuring out where the constructor block is meant to go is not very straightforward.

I was thinking if following the variables approach would be a better model for class instances? With or without the "create variable" button on the toolbox, but at least to have a way of creating instances (the previously mention button, or a block) and then blocks with a special dropdown that contains only the relevant instances.

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