Opened 11 years ago

Last modified 11 years ago

#5541 new Feature Requests

Partial function application

Reported by: Lars Viklund <zao@…> Owned by: Thomas Heller
Milestone: To Be Determined Component: phoenix
Version: Boost Development Trunk Severity: Not Applicable
Keywords: Cc:

Description

In functional languages, it's common to partially apply a function to some arguments in order to produce a function accepting only the remaining arguments.

This can be approximated in C++ through use of our bind and its placeholders, but this requires knowledge of the number of placeholders to use to match the number of remaining parameters.

Is it possible to construct Phoenix functions that when invoked with fewer arguments than its arity indicates will produce a function taking the remaining arguments?

Change History (2)

comment:1 by Thomas Heller, 11 years ago

I think this might be possible to some extend. Further investigation is needed for functions with overloads of different arity and function objects.

comment:2 by Steven Watanabe, 11 years ago

I think it would be a bad idea to make this happen automatically without some special syntax.

Note: See TracTickets for help on using tickets.