NetLogo / Tortoise

Compiler and runtime engine for NetLogo models that runs in JavaScript 🐢
https://netlogoweb.org
Other
56 stars 27 forks source link

Primitives with optional arguments do not work well with `apply-result`. #242

Closed CIVITAS-John closed 2 years ago

CIVITAS-John commented 2 years ago

Submitted by @Maizi. https://gitee.com/turtle-sim/turtle-universe-issue-tracker/issues/I59OEO

To reproduce, try __apply-result word ["str1""str2""str3"].

Expected: str1str2str3. Actual: str1str2.

The reason is that at compilation time, __apply-result would assume only 2 parameters for word.

LaCuneta commented 2 years ago

:+1: Thanks for the report. I happen to be working on variadic-args parity with desktop at the moment, so I'll throw this test case into the mix.

LaCuneta commented 2 years ago

Resolved in this commit, and test case added to NetLogo here.