Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Clownfish
    • Labels:
      None

      Description

      Add support for function/method parameter lists to Boilerplater.

      1. parser_add_param_list.diff
        2 kB
        Marvin Humphrey
      2. ParamList.pm
        3 kB
        Marvin Humphrey
      3. 301-param_list.t
        1 kB
        Marvin Humphrey

        Activity

        Hide
        Marvin Humphrey added a comment -

        Committed as r806144.

        Show
        Marvin Humphrey added a comment - Committed as r806144.
        Hide
        Marvin Humphrey added a comment -

        Parameter lists in Boilerplater consist of an array of
        Boilerplater::Variables, and sometimes an array of default values.

        /** 
         * @param capacity The number of elements that the Hash will be 
         * asked to hold initially.
         */
        public inert incremented Hash*
        new(u32_t capacity = 0);
        

        The first argument to any method is always "self", and is included as the
        first element in the parameter list. Methods testing to see if their
        signatures test as "equal" are strict about parameter lists:

        • Variable names must match (important for parameter labeling).
        • Variable types must match ("self" is a special case – it must pass an
          inheritance test rather than match exactly).
        • Initial values must match.

        Put another way, method signatures in Boilerplater are defined not only by
        types as in C, but also by variable names and default values. Once a method's
        public interface has been published, it is not possible to change a parameter
        name without breaking backwards compatibility or writing custom binding code
        specifically to support the legacy interface.

        Default values cannot be baked into C bindings, but they can for other
        languages: Perl using labeled parameters and testing for undef, Java using
        method signature overloading, etc.

        Show
        Marvin Humphrey added a comment - Parameter lists in Boilerplater consist of an array of Boilerplater::Variables, and sometimes an array of default values. /** * @param capacity The number of elements that the Hash will be * asked to hold initially. */ public inert incremented Hash* new(u32_t capacity = 0); The first argument to any method is always "self", and is included as the first element in the parameter list. Methods testing to see if their signatures test as "equal" are strict about parameter lists: Variable names must match (important for parameter labeling). Variable types must match ("self" is a special case – it must pass an inheritance test rather than match exactly). Initial values must match. Put another way, method signatures in Boilerplater are defined not only by types as in C, but also by variable names and default values. Once a method's public interface has been published, it is not possible to change a parameter name without breaking backwards compatibility or writing custom binding code specifically to support the legacy interface. Default values cannot be baked into C bindings, but they can for other languages: Perl using labeled parameters and testing for undef, Java using method signature overloading, etc.

          People

          • Assignee:
            Marvin Humphrey
            Reporter:
            Marvin Humphrey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development