Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Named-parameters/Oz/named-parameters-1.oz
Normal file
15
Task/Named-parameters/Oz/named-parameters-1.oz
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
declare
|
||||
class Foo
|
||||
meth init skip end
|
||||
meth bar(PP %% positional parameter
|
||||
named1:N1
|
||||
named2:N2
|
||||
namedWithDefault:NWD <= 42)
|
||||
{System.showInfo "PP: "#PP#", N1: "#N1#", N2: "#N2#", NWD: "#NWD}
|
||||
end
|
||||
end
|
||||
|
||||
O = {New Foo init}
|
||||
{O bar(1 named1:2 named2:3 namedWithDefault:4)} %% ok
|
||||
{O bar(1 named2:2 named1:3)} %% ok
|
||||
{O bar(1 named1:2)} %% not ok, "missing message feature in object application"
|
||||
10
Task/Named-parameters/Oz/named-parameters-2.oz
Normal file
10
Task/Named-parameters/Oz/named-parameters-2.oz
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
declare
|
||||
proc {Foo PP Other=unit(named1:N1 named2:N2 ...)}
|
||||
NWD = {CondSelect Other namedWithDefault 42}
|
||||
in
|
||||
{System.showInfo "PP: "#PP#", N1: "#N1#", N2: "#N2#", NWD: "#NWD}
|
||||
end
|
||||
|
||||
{Foo 1 unit(named1:2 named2:3 namedWithDefault:4)}
|
||||
{Foo 1 unit(named2:2 named1:3)}
|
||||
{Foo 1 unit(named1:2)} %% not ok...
|
||||
Loading…
Add table
Add a link
Reference in a new issue