Leency пишет: mcall как я понимаю более экономный в плане размера программы чем названия функций. Минус читабельность - да.
"Экономный в плане размера" — только в том случае, если функция используется единожды, так как код тела функции вставляется столько раз, сколько эта функция используется.
Что касается скорости выполнения, то узкое место — системный вызов сам по себе, а "положить на стек параметры и сделать call" — выполняется на порядок быстрее.
Если интересно, то вот статья на Хабре: Стоимость операций в тактах ЦП
"Минус читабельность" — да, и здесь тоже минус.
Вот я и говорю, что выдумали mcall, от которого никаких плюсов нет, но есть минусы.
И снова могу привести пример, который уже приводил:
▼
mcall:
mcall SF_SYSTEM, SSF_MOUSE_SETTINGS, SSSF_GET_DOUBLE_CLICK_DELAY
вызов функции из KolibriOS.Lib:
Invoke GetDoubleClickTime
Так что, как не пытайтесь сделать mcall удобным — это не получится.
Просто вызывайте функции с понятными для человека названиями — и всего-то!
Добавлено 2020-12-24 в 16:00
Leency пишет:В Си-подобных языках мне нравится {} и я понимаю что begin/end поставлено на хоткеи, но все же. В остальном мне сложно судить что лучше
Ну всё же семантика в языках программирования важнее, чем синтаксис.
Да, ты можешь, конечно, в Си задефайнить что угодно, но от этого он не превратится в другой язык программирования.
▼Приведу кусочек кода из одного проекта на Си
/*
VALX linker
Copyright 1997-2011 David Lindauer.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Original 16-bit linker written by:
David Troendle
You may contact the author of this derivative at:
mailto::camille@bluegrass.net
*/
/* LANGEXT.H */
/* Fixup some C syntax I really don't like
De gustibus non est desputandum
(Concerning taste there is not argument -- or
Only fools argue where taste is concerned) */
/* Block basic C commands */
#pragma pack(1)
#define If if (
#define Then ) {
#define Else } else {
#define ElseIf } else if (
#define EndIf }
#define Using switch (
#define BeginCase ) {
#define When case
#define Otherwise default
#define EndCase }
#define Loop while(1)
#define BeginLoop {
#define EndLoop }
#define ExitLoop break
#define ContinueLoop continue
#define ExitIf(cond) if (cond) break
#define LoopIf(cond) if (cond) continue
#define While while (
#define BeginWhile ) {
#define EndWhile }
#define Repeat do
#define BeginRepeat {
#define RepeatIf } while ((
#define Until } while (!(
#define EndRepeat ))
#define For for (
#define BeginFor ) {
#define EndFor }
#define ReturnIf(cond) if (cond) return
#define Return return
#define BeginDeclarations {
#define EndDeclarations
#define BeginCode
#define EndCode }
#define Type typedef
#define Structure struct
#define BeginStructure {
#define EndStructure }
#define Union union
#define BeginUnion {
#define EndUnion }
#define Enumeration enum
#define BeginEnumeration {
#define EndEnumeration }
Отличия Си и Pascal далеко не только в фигурных скобках.
Например, сравнительная таблица есть вот тут
Также есть статья на wiki(конечно, статья общая, не для всех диалектов языка)