Welcome! Log In Create A New Profile

Advanced

DRY/Functional Programming?

Posted by holmescharles 
DRY/Functional Programming?
November 08, 2023 04:09PM
I am working with the v1 runtime. Is there an elegant way to avoid rewriting the same code over and over for different timing scripts? E.g., lets say I want to include the same hotkey mapping in all of my tasks; is there a way to avoid repeating myself rather than having to explicitly include this code in every task's timing file?

Or what if I want to add functionality, i.e., wrap, to a runtime function?
Re: DRY/Functional Programming?
November 08, 2023 05:13PM
I made a new function for it. Download the NIMH ML package again. Then you will be able to use include().
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#include

You can define the wrapper in the timing script.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.