Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluation order incompatiblity vs LambdaMOO #3

Open
visiblecode opened this issue Dec 30, 2018 · 0 comments
Open

Evaluation order incompatiblity vs LambdaMOO #3

visiblecode opened this issue Dec 30, 2018 · 0 comments

Comments

@visiblecode
Copy link

visiblecode commented Dec 30, 2018

Recent* versions of JHCore have an $integration_utils:parse that relies on LambdaMOO evaluating the LHS of an assignment statement before the RHS. So:

"parse(list lists of objects and/or strings, verb_or_property)";
set_task_perms(caller_perms());
what = args[1];
voo = args[2];
result = {};
for l in (what)
result = {@result, {}};
for os in (l)
  if (msg = this:_parse(os, voo))
    if (msg)
      result[index = length(result)] = {@result[index], msg};
    endif
  endif
endfor
  if (!result[index = length(result)])
    result = listdelete(result, index);
  endif
endfor
return result; 

Will crash with E_VARNF on result[index = length(result)] = {@result[index], msg};, as the RHS of the assignment gets evaluated first, meaning that index won't be defined yet. The code's expecting the LHS to get evaluated first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant