Opened 12 years ago

Last modified 11 years ago

#127 assigned defect

[Discuss] Handling of overloaded functions in command mode.

Reported by: magne Owned by: Anya Helene Bagge
Priority: high Milestone: m13.11
Component: magnolia-eclipse Version:
Keywords: Cc:
Blocked By: Blocking:

Description

How is it possible to access a specific instance of overloaded functions?

For instance, in sophus-src, Applications/ExperimentalTypes/several_libraries_boolean_integer32_floating64 has 4 overloaded versions of minus: unary and binary for Number and Float. Only the unary one for Number is accessible from the command line. Running "minus 3.4 4.3" gives an error message (wrong number of arguments). Running "minus 3.4" yield -3, i.e., the integer and not the float version.

Change History (2)

comment:1 by Anya Helene Bagge, 12 years ago

Status: newassigned
Summary: Handling of overloaded functions in command mode.[Discuss] Handling of overloaded functions in command mode.

comment:2 by magne, 11 years ago

Priority: lowhigh
Type: enhancementdefect

In the executable file the commands are now sorted, except that overloads of the same command appear in random order.

Two enhancements seem needed:

1) a consistent ordering of overloaded operations, e.g., first by command name, then by argument type

2) a technique for accessing a given instance of the overloaded operation. A solution is to give each operation a suffix, e.g., #n, which is optional to use.

Assume we have two overloads

 function -_(a:Large):Large;
 function -_(a:Small):Small;

in program xxx. Given the suggested rules, the following two calls are clear:

   ./xxx '-_#1' 12
   ./xxx '-_#2' 12 

The first one is for Large, the second one is for Small.

Note: See TracTickets for help on using tickets.