[nem-bug] [Nemerle 0000987]: Allow not only literals to be default value for parameters

feedback at nemerle.org feedback at nemerle.org
Thu Apr 19 08:04:26 CEST 2007


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=987> 
======================================================================
Reported By:                divan
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   987
Category:                   Compiler
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             04-08-2007 15:47 CEST
Last Modified:              04-19-2007 08:04 CEST
======================================================================
Summary:                    Allow not only literals to be default value for
parameters
Description: 
Default functional parameters can be useful.

def SomeAlgo (y : int, f = x => x, g = x => 1){}
SomeAlgo (1, f = x => 2*x);

And maybe allow parameters to use previous parameters.
def f (x : int, y = x + 1, z = y + x + 4);
f (5);
f (5, z = 1);
======================================================================

----------------------------------------------------------------------
 VladD2 - 04-19-07 08:04 
----------------------------------------------------------------------
Addition example:
module Program
{
  Test(_lst = [] : list[string]) : void //E: Incorrect format of parameter
'_lst' default value. You should use 'paramName = <literal>'
  {
  }

  Main() : void
  {
  }
}

In my option emty list also should interpret as literal.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-08-07 15:47 divan          New Issue                                    
04-19-07 08:04 VladD2         Note Added: 0001845                          
======================================================================




More information about the bugs mailing list