Инструменты пользователя

Инструменты сайта


bug_ref_fn

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
bug_ref_fn [2025/12/15 11:26] snegovickbug_ref_fn [2025/12/15 11:29] (текущий) – [Workaround] snegovick
Строка 86: Строка 86:
 ====== Workaround ====== ====== Workaround ======
  
-Объявление функции в блоке "модуль" помогает решить проблему:+Добавление проблемной функции в объявление модуля помогает решить проблему:
  
-Добавляем empty в декларацию модуля: +<code>
- +
-```+
 Sh93: module Sh93: module
 { {
Строка 96: Строка 94:
   empty: fn();   empty: fn();
 }; };
-```+</code>
  
-Lets check libinterp/link.c. The error manifests itself in linkm proc (thats where "link typecheck" message comes from), for some reason `emptyis in `m->extarray (interp.h / struct Module comment calls `m->ext`: "External dynamic links") and this loop:+Lets check libinterp/link.c. The error manifests itself in linkm proc (thats where "link typecheck" message comes from), for some reason empty is in m->ext array (interp.h / struct Module comment calls m->ext: "External dynamic links") and this loop:
 [ for(l = m->ext; l->name; l++)](https://github.com/inferno-os/inferno-os/blob/d7b29f497205f48247d2bab33340bd7ace64de4d/libinterp/link.c#L41) [ for(l = m->ext; l->name; l++)](https://github.com/inferno-os/inferno-os/blob/d7b29f497205f48247d2bab33340bd7ace64de4d/libinterp/link.c#L41)
-iterates over `initand `empty`.+iterates over init and empty.
  
-When you add `emptyto module definition explicitly, then this loop only makes single iteration with `init`.+When you add empty to module definition explicitly, then this loop only makes single iteration with init.
  
 Limbo does not have anonymous functions (lambdas) as far as I know, so this issue just leads to inconvenience of declaration of functions you normally would prefer not to declare. Limbo does not have anonymous functions (lambdas) as far as I know, so this issue just leads to inconvenience of declaration of functions you normally would prefer not to declare.
bug_ref_fn.1765797968.txt.gz · Последнее изменение: snegovick