colon syntax

3 moment(s) that assert this concept — showing 1–3 of 3

moderateTwo independent sources — corroborated, but not broadly
↣ how this spread over time →
provenance — click a node to open its encoding unit
[1] luaworkshop[2] Glamorous[3] Glamorous
showing 3 of 3 moments
luaworkshop · youtube · en
1Lua's colon syntax for method calls provides explicit self reference, enabling nested functions to access the outer scope's self, unlike JavaScript where nested functions lose access to 'this'.
“much prefer the explicit self with the colon syntax sugar in Lua because when you're doing closures you're nested function can still use the self from the outside but in JavaScript every nested function has its own this no matter how you use it”
spoken · 330s · 2012-12-04
Glamorous Toolkit · youtube · en-US
2Keyword messages in Smalltalk consist of keywords followed by a colon and an argument, such as `#copyReplaceAll:with:`.
“Keyword messages consist of a number of keywords, each followed by a colon and an argument. `'Hello world' copyReplaceAll: 'world' with: 'folks'` sends the message `#copyReplaceAll:with:` to the string `'Hello world'` with the two arguments `'world'` and `'folks'`”
spoken · 135s · 2023-01-09
Glamorous Toolkit · youtube · en-US
3A block can take arguments declared with a colon followed by an or-bar, such as incrementing its argument.
“A block can take arguments, which are declared at the beginning of the block with a colon, followed by an or-bar. This block increments its argument.”
spoken · 245s · 2023-01-09