When using a Pluto notebook, I realised that I cannot modify an @enum that I have created, either in the same or other cell. For example, executing a cell with:
@enum myRainbow R=1 O Y G B I V
followed by executing this or a different cell with the @enum modified at all:
Is this because @enum types are created with a macro and not tracked in the same way as other objects? And is there a method that I can use if I want to reassign an @enum type (or even to delete it if I don’t need it…I really like Pluto’s philosophy of removing any variables that aren’t actively in a cell).
To try to express my question better: Pluto actually deletes variables(?) that are no longer defined, except for the @enum type which not only persists but does not allow subsequent modifications. This is not the same behaviour as the REPL which does allow me to modify an @enum, albeit with warnings that the keys have been modified.
You can relabel an @enum in the REPL but you can’t actually redefine it. For example, you can’t add additional colours to your myRainbow type. Have you tried redefining non-@enum type definitions in Pluto?
Hi! This is a bug in Pluto - it does not understand the macro @enum, so it does not know that this code definesmyRainbow, it looks like it referencesmyRainbow.
But I will add a special case for the @enum macro to fix it!