WebAssembly/decompressor-prototype

Different forms of define arguments.

Opened this issue · 0 comments

Currently, all arguments to a define are "pass by expression", matching a structured form of a static macro call. To add more power, we would really like to allow many different forms of parameter passing (done at the Eval node). The proposed new parameter forms are:

(params) - The define gets no arguments.

(params n) - The define gets N values. These values are evaluated before they are passed to the define.

(exprs n) - The define gets n expressions that are only evaluated on demand, within the define.

(exprs.cached n) - The define gets n expressions, but the data for expressions are cached at the point of the call, rather than on demand. When reading, this allows the same data to be read multiple times, effectively allowing the insertion of multiple copies.

(cached) - The data for the macro (and not its arguments) is cached, based on the single argument value passed in.

(args E1 ... EN) - A mixed list of arguments, composed by its arguments, each of which can be one of the previous argument specifiers.