Skip to content

Default values for missing class methods #643

Closed
@rpatters1

Description

@rpatters1

Is your feature request related to a problem? Please describe.

I am working on localization of some scripts using new localization tools I am developing. Specifically, I would like to localize the transposition scripts as a pilot project for other scripts in the repo. But these scripts still work with JW Lua. I would like to find an elegant solution for skipping the new method calls in RGP Lua so that the scripts can continue to work with JW Lua.

Describe the solution you'd like

It occurred to me that mixin might be able to provide default implementations of missing methods. What I have in mind is that any method call could provide an optional additional parameter. If the additional parameter were present (non nil), the mixin library would check for the existence of the underlying RGP Lua method. If not found, it would return either return the default value passed in or (if the method is fluid) ignore the call entirely and simply return self. (If found it would call the method and behave as it does now.)

Describe alternatives you've considered

I suppose I could write one-off versions of the new methods that do the same thing. Or I could pepper the scripts with ugly if-statements.

@ThistleSifter

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions