Skip to content

Comments

Update defining blocks page and playground samples#9242

Merged
kimprice merged 9 commits intomasterfrom
kim-playground
Nov 21, 2022
Merged

Update defining blocks page and playground samples#9242
kimprice merged 9 commits intomasterfrom
kim-playground

Conversation

@kimprice
Copy link
Contributor

  • Replaced all '%' parameter annotations with '$' (closes Update Playground samples and defining blocks documentation to use '$' instead of '%' for parameters #9211)
  • Removed 'eg:' from JSDoc comments in favor of setting the default with PARAM.defl. The eg notation automatically sets the first value listed as the default value for the parameter. This indirect way of setting the default may cause confusion, so we are no longer advertising it.
  • Added a sample for fixed instances of a class
  • Added a sample for default array values
  • Updated the classes sample to include an example with blockCombine
  • Removed all the information on Blockly mutators. The mutator blocks do not fit with the look and feel of our other blocks, so we no longer want to advertise it.

Also closes #9175 because the corresponding section was removed as unnecessary.

@abchatra
Copy link
Collaborator

Nice set up changes.

block = field, { '|' field }
field := string
| string `%` parameter [ `=` type ]
| string `$` parameter [ `=` type ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably get rid of the = type bit since param.shadow is preferred

//% block="play an alarm sound || of $sound for $duration ms"
//% duration.shadow=timePicker
//% expandableArgumentMode="toggle"
//% sound.defl=AlarmSound.Annoy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might need to put quotes around AlarmSound.Annoy here... I'm not actually sure. The . might confuse our parser

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked it in the playground and it works fine.

@kimprice kimprice merged commit e484e25 into master Nov 21, 2022
@kimprice kimprice deleted the kim-playground branch November 21, 2022 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants