Cabbage Logo
Back to Cabbage Site

Question for the Old Timers

So, I’m not quite certain if this is Csound in origin, or if this is unique to Cabbage, but I have never seen any function call like…

colour:0("red")

Not that I am an expert in language syntax, but I have never seen anything like the “:” used with a function name. And yes, I know they are called “identifiers”, but when they execute, they are functions… (Just an opinion. It may very well be a concept that I just have to accept, but I’ve never seen anything like this, so this is me trying to understand…)

I only bring this up because Csound does use the “:” to allow the assignment of “rate” to an operation. Rate is something unique to a media language.

Nothing to do with Csound at all. And perhaps not the finest syntactical decision I ever made! At the time I thought fontcolour:0() and colour:1() were simpler than fontcolouron() and colouroff(). :rofl:

I might overhaul this at some point. With camel case fontColourOn()/colourOn() isn’t so bad.

They are not really functions at all. They are just a construct for the parser. Deep within the Cabbage code base are they actual setColour() functions, or setText(), etc.

1 Like

I like the idea of more clear names for these. fontColourOn() and fontColourOff() are much more logical without having to test or look up in docs.

Yeah, I’m starting to think the same. And it would make life a lot easier in terms of parsing because I don’t have to think about the :1, :0. If I did this I think I would go all in, which would result in a breaking change - if you tried to compile older .csd files with the new version. Your plugins would of course still function the exact same, as they shipped with the older version…

Any chance of a python script similar to the CamelCase fix? If that were the case, I think I’d be 100% on board.

For sure, I’d even add it as a function in the main menu so that people can do the conversions directly in Cabbage. :+1:

1 Like

As someone who lives in Lite: “Main menu… what main menu?” :innocent:

Oh yeah, I’m currently upgrading Cabbage to use JUCE 6, I think the writing is on the wall for the CabbageLite, but I will pour more time into the standalone builds before I pull the trigger!