Definedness Constraints Smiley
Definedness constraints A container can also enforce a variable to be defined. Put a smiley in the declaration: my Int:D $def = 3; say $def; # OUTPUT: «3» $def = Int; # Typecheck failure
A programming tutorial screenshot demonstrates a definedness constraint in Raku, where a variable declared as Int:D must contain a defined integer. The joke is the cheerful-looking smiley-like colon in the declaration contrasted with the typecheck failure when assigning the undefined type object Int.
code screenshot / скриншот кодаprogramming tutorial / учебник по программированиюtext heading / текстовый заголовокcode block / блок кодаvariable declaration / объявление переменнойinteger value / целое числоsmiley-like colon / двоеточие в виде смайликаerror message / сообщение об ошибкеwhite background / белый фонmaroon divider line / бордовая разделительная линия
- @rzeczyzabawne / 12700 2023-10-13
- Type
- image
- Size
- 794×243 · 20.2 KiB
- Mood
- technical humor
- Language
- en
- Added