Add support for injectable
function parameters in DML
#293
Labels
4 imporant
Important issue
in: DML
issues related to the macro language
is: feature
Issue proposes a new feature
I had intended that this would be implemented as part of adding support for general overloaded functions (#288), but that's turning out to be trickier than I had thought (partially due to COVID brain), and the OSU folks are going to want this sooner rather than later, so I think I'm going to try a somewhat kludgier approach for the short term.
When mocking up a macro for them, since there isn't support for general paths yet (#282), I found myself writing
The notion is that we have a two-argument function
walk_circle()
, but we want to be able to sayBy marking the
drop
parameter asinjectable
, when the compiler seeswalk_circle(north)
, instead of complaining that an incorrect number of arguments have been supplied, it would remember the arguments passed in and return a new function that took one argument, spliced it into the correct position in the list, and then called the function.I think that I should be able to do this pretty straightforwardly by adding the injectable positions to
CallableType
.Note, that, unlike the approach I have been taking with #288, this would not result in
walk_circle
being treated asdir -> (drop -> no_val)
, although I guess I could probably make it work inCallableType._find_conversion_to()
.Migrated from internal repository. Originally created by @EvanKirshenbaum on Aug 02, 2023 at 12:13 PM PDT. Closed on Aug 02, 2023 at 4:22 PM PDT.
The text was updated successfully, but these errors were encountered: