Category manipulation

I honestly didn't realize it wasn't a dollar sign.

You can try the experimental version here

Okay. Maybe making a load library feature [ v] block that metaprograms data types, and then puts them in categories? Or dynamically only generates the categories and blocks you actually need (think SciSnap!, but it has even more categories, and dynamically creates blocks and categories as they are needed!)

That's fair. It doesn't really affect the code itself, but they do make it easier to work with code.

So, a couple of things about SciSnap!: It's only because all the categories are already there when you load the library that you can write code using the blocks in that category. How are you going to write a script that uses a block from a category that doesn't exist yet? I'm not sure you can really have a practical use case. And also, all those SciSnap! categories really eat into the palette area; if you create even more dynamically, the user isn't going to be able to find blocks!

P.S. Yeah, you can use metaprogramming to create new blocks dynamically. But basically at that point you're programming in text, but in a particularly roundabout and unpleasant way.

Metaprogramming, to coin a phrase, should be safe, legal, and rare.

Something like

[scratchblocks]
get {(get temperature)@addInput::grey ring} from [Temperature Sensing v]::control
[/scratchblocks]

[scratchblocks]
//which returns
[/scratchblocks]

[scratchblocks]
{(get temperature in [Kelven v] from [Device 1 v]::#0000ff )@addInput::grey ring}
[/scratchblocks]

You're right. That would be really annoying.

Are you in a Snap! mod? Why are the options blue, and why is there a color option?

Oh right, I have a userscript that adds the color option. The options are blue, because I was editing a motion block.

I had forgotten the options were dynamically colored, that's pretty cool.

Colors were officially supported around v10.

Another thing that I think is cool is when you turn off the zebra option in Shift + Settings, the jagged block previews use a dark grey, seeming like this is the only time Snap! uses the color. (Granted, it is the default in the Snap! source.)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.