NewRPL: Default and optional arguments
|
04-19-2019, 04:20 PM
Post: #1
|
|||
|
|||
NewRPL: Default and optional arguments
Hello
1: Optional arguments In the following code, when executing the SUMa function, it waits for 3 arguments and returns 24 PHP Code: « The second version of the previous code SUMb, using a global variable 'args', selects the type of code to execute PHP Code: « My idea or notation is to specify those arguments in the following way OPERATORNAME←ARGS PHP Code: CLEAR 9 8 7 SUMb←3 @ 24 Where the numeric value after ← stores the value in the temporary variable associated with the name of the current function # ←args 2: the other idea is to be able to specify the initial value « → expr var = 'x' « expr var xOperator » » 'FNTa' STO 'x^3' FNTa←1 @ takes 1 unique argument and by default the second with value 'x' 'Y^3' 'Y' FNTa←2 or 'Y^3' 'Y' FNTa @ takes 2 arguments and overwrites the second with the value of 'Y' |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
NewRPL: Default and optional arguments - compsystems - 04-19-2019 04:20 PM
|
User(s) browsing this thread: 2 Guest(s)