Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
27
Task/Man-or-boy-test/Dylan/man-or-boy-test.dylan
Normal file
27
Task/Man-or-boy-test/Dylan/man-or-boy-test.dylan
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
define method a
|
||||
(k :: <integer>, x1 :: <function>, x2 :: <function>, x3 :: <function>,
|
||||
x4 :: <function>, x5 :: <function>)
|
||||
=> (i :: <integer>)
|
||||
|
||||
local b() => (i :: <integer>)
|
||||
k := k - 1;
|
||||
a(k, b, x1, x2, x3, x4)
|
||||
end;
|
||||
|
||||
if (k <= 0) x4() + x5() else b() end if
|
||||
|
||||
end method a;
|
||||
|
||||
define method man-or-boy
|
||||
(x :: <integer>)
|
||||
=> (i :: <integer>)
|
||||
|
||||
a(x, method() 1 end,
|
||||
method() -1 end,
|
||||
method() -1 end,
|
||||
method() 1 end,
|
||||
method() 0 end)
|
||||
|
||||
end method man-or-boy;
|
||||
|
||||
format-out("%d\n", man-or-boy(10))
|
||||
Loading…
Add table
Add a link
Reference in a new issue