Morpho-lang / morpho

The Morpho language 🦋. Morpho is a small embeddable language for scientific computing applications.
MIT License
33 stars 11 forks source link

apply with variadic args #244

Closed softmattertheory closed 9 months ago

softmattertheory commented 10 months ago

Describe the bug The apply function doesn't seem to work with variadic args.

To Reproduce

fn g(...x) { 
  for (q in x) print q
}

apply(g, [1,2,3])

returns "Error 'ClssLcksMthd': Class lacks method 'enumerate'."

Expected behavior The function g should be called with the list, and should print its contents in sequence.

softmattertheory commented 9 months ago

This bug is fixed in morpho6 by this pull request https://github.com/Morpho-lang/morpho-libmorpho/pull/17

We will merge into this repository soon.