objeck / objeck-lang

Objeck is a modern object-oriented programming language with functional features tailored for machine learning. It emphasizes expression, simplicity, portability, and scalability. The programming environment consists of a compiler, virtual machine, REPL shell, and command line debugger with IDE plugins.
https://objeck.org
Other
157 stars 11 forks source link

How to handle va_list on binding code? #327

Closed objeck closed 1 year ago

objeck commented 1 year ago

Discussed in https://github.com/objeck/objeck-lang/discussions/326

Originally posted by **iahung2** September 1, 2023 For example: `int test1(int x, int y, ...)` `int test2(int x, int y, va_list args)`
objeck commented 1 year ago

See #336

ghost commented 1 year ago

Frankly speaking, this is not a duplicate of #336. This is a question about how to handle va_list in binding code. #336 is a question about whether the language supports Varargs at all.

objeck commented 1 year ago

Consider mapping the C++ va_list object to an Objeck array or list type.

ghost commented 1 year ago

Consider mapping the C++ va_list object to an Objeck array or list type.

Example code, please? Btw, when I raised this question I pretty much think I will follow the .NET's P/Invoke way, that is define the function with a fixed number of arguments.