renpy / renpy

The Ren'Py Visual Novel Engine
http://www.renpy.org/
4.76k stars 680 forks source link

Renpy calls and ATL roadmap #5102

Open Gouvernathor opened 8 months ago

Gouvernathor commented 8 months ago

When an ATL transform is called, three things happen : the inner scope is updated (as with any call in renpy ot python), the parameters are curryfied and prepared for a potential next call, and the child of the transform is updated. All three of these are buggy. Some parameters are not managed and treated as they should : pos-only are treated as pos-or-kw, required kw-only are not handled and cause exceptions, and variadic parameters are rejected at parse time. This affects the inner scope update and the correct currying of parameters for the next call. The rules for setting the child are not consistent, resulting in the very function made to do it (At) failing in some edge cases, not to mention when you call the transform directly (not everyone uses At).

As a sidenote, a difficulty when currying ATL is that in the resulting signature, the default values of the passed parameters are actual, evaluated values, whereas a "raw" ATL transform has evaluable expressions as default values of the optional parameters. Properly managing that will probably require two Signature classes, or two Parameter classes, or both. The current code gets around that by putting only required positional parameters in the signature, and treating values already in the scope as acceptable keyword-arguments. But that's incompatible with pos-only parameters, which set a matching entry in the scope yet aren't acceptable as keyword arguments. From this point of view, enabling kw-only parameters will be simpler than enabling args, kwargs or pos-onlies.

### Tasks
- [ ] https://github.com/renpy/renpy/pull/5099
- [ ] https://github.com/renpy/renpy/pull/4799
- [ ] https://github.com/renpy/renpy/issues/4371
- [ ] https://github.com/renpy/renpy/issues/4405
- [ ] https://github.com/renpy/renpy/pull/5237
- [ ] https://github.com/renpy/renpy/pull/5591
- [ ] https://github.com/renpy/renpy/pull/5592
- [ ] https://github.com/renpy/renpy/pull/5593
renpytom commented 2 weeks ago

@Gouvernathor Can you taker your new pull requests out of draft status, so I can merge them? (Also, a short description other than the title would help.)

Gouvernathor commented 2 weeks ago

They are not tested and need to be, I will do it eventually.