Programming ideas: различия между версиями
Материал из fidoman.ru
Sergey (обсуждение | вклад) (Новая страница: «= Function classes = Taking function as argument obviously requires that function have defined argument list and return value type - but nothing is said about wh...») |
Sergey (обсуждение | вклад) |
||
Строка 6: | Строка 6: | ||
E.g. we want have to put on queue only functions that have meaning in this queue (different variants of uart send functions). So we require function that have class of "uart send queue". So if programmer creates functions that works in this context, he would mark it with this class "uart send queue". No other functions can be given here is result, even they have identical attribute list - but is nonsence if called here. | E.g. we want have to put on queue only functions that have meaning in this queue (different variants of uart send functions). So we require function that have class of "uart send queue". So if programmer creates functions that works in this context, he would mark it with this class "uart send queue". No other functions can be given here is result, even they have identical attribute list - but is nonsence if called here. | ||
+ | |||
+ | [[Category:Programming]] |
Версия 15:06, 24 мая 2023
Function classes
Taking function as argument obviously requires that function have defined argument list and return value type - but nothing is said about what the function will do.
Assigning function some class may provide tool for programmer to specify, what function can be used as argument.
E.g. we want have to put on queue only functions that have meaning in this queue (different variants of uart send functions). So we require function that have class of "uart send queue". So if programmer creates functions that works in this context, he would mark it with this class "uart send queue". No other functions can be given here is result, even they have identical attribute list - but is nonsence if called here.