Nim for Beginners #17 Constants

preview_player
Показать описание
In this video i will teach you about Constants, what they are, how to make them and what their usage is.

*Timestamps:*
00:00​ Intro - Constants and their usage
00:49 Simplest constant
01:05 Constants cannot be declared
01:40 Constant values cannot be assigned at runtime
02:09 const section
02:46 Constant array
03:19 Constant tuple

*LINKS:*
Рекомендации по теме
Комментарии
Автор

Timestamps:
00:04 Constants intro and usage
00:49 Simplest constant
01:05 Constants cannot be declared
01:40 Constant values cannot be assigned at runtime
02:09 const section
02:46 Constant array
03:19 Constant tuple

kiloneie
Автор

Very nice. Line 23 should be `const john: person = (name: "John", age: 20)`, if you're trying to show making a constant from your newly defined type. Otherwise, it just creates a constant of type regular tuple.

UNIcodeX_Plays
Автор

Very cool, now I know more about mutable vs immutable objects. How can I make a method that changes John's age or name? Im trying to use getter and setter methods.

torarinvik
Автор

Please disable the autocomplete menu for future videos. It is very distracting and blocks me from seeing the code clearly at all times.

vcool
join shbcf.ru