Project

General

Profile

Feature #1972

provide full-support for DYNAMIC-FUNCTION set to function parameters

Added by Constantin Asofiei over 11 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Start date:
08/06/2013
Due date:
08/06/2013
% Done:

100%

Estimated time:
1.00 h
billable:
No
vendor_id:
GCD

Related issues

Related to Base Language - Feature #1920: implement persistent procedures Closed

History

#1 Updated by Constantin Asofiei over 11 years ago

In 4GL, when a parameter of a function call is set as the the returned value of a DYNAMIC-FUNCTION call, as in:

function fi returns int(i as int):
   return i.
end.
function fch returns char(ch as char):
   return ch.
end.

message fi(dynamic-function("fch", "0")). /* this shows number 0*/
message fi(dynamic-function("fch", "a")). /* this shows number parsing error and the ? char */

4GL performs an "auto-cast" from the real value's type to the expected parameter's type. The full rules are not fully-discovered yet, but at least for the above case, a string containing a valid number will be converted to its numeric representation.
The same applies for assignments, as in:
def var i as int.
i = fi(dynamic-function("fch", "0")). /* i gets set to 0*/
i = fi(dynamic-function("fch", "a")). /* this shows number parsing error and i gets set to unknown*/

This suggests that the implementation of this kind of parsing needs to be done at the assign method for each P2J implementation of the 4GL types. These assign methods in turn would get invoked from the i.e. new integer(BaseDataType) c'tor too, to allow proper parsing.

#2 Updated by Constantin Asofiei about 11 years ago

  • Estimated time set to 1.00

This is a _POLY case which should be solved by #2068 changes for _POLY cases. Estimate 1h to confirm.

#3 Updated by Greg Shah about 11 years ago

  • Assignee set to Constantin Asofiei
  • Start date set to 08/15/2013
  • Target version set to Milestone 7
  • Due date set to 08/15/2013

#4 Updated by Greg Shah almost 11 years ago

  • Start date changed from 08/15/2013 to 08/30/2013
  • Due date changed from 08/15/2013 to 08/30/2013

#5 Updated by Greg Shah almost 11 years ago

  • Due date changed from 08/30/2013 to 08/06/2013
  • Start date changed from 08/30/2013 to 08/06/2013

#6 Updated by Constantin Asofiei over 10 years ago

  • Status changed from New to Feedback

This is fixed by #2068. Can be closed.

#7 Updated by Greg Shah over 10 years ago

  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

#8 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 7 to Runtime Support for Server Features

Also available in: Atom PDF