functions decleration

135 views
Skip to first unread message

David Ben-Michael

unread,
May 30, 2019, 10:43:20 AM5/30/19
to Nemerle Forum
. have some problem in decleration of functions at nemerle
.I want to write recursive calling of function, but i did not succeed to handle with the function declartion
.At nemerle it is not passable to call a function that her defination is beneath the calling steatment
?Does There is a way to declare the functions at the beginning of the program and implement them at diffrent places
 

catbert

unread,
May 31, 2019, 5:04:05 AM5/31/19
to Nemerle Forum
Hi David!

Writing recursive functions is pretty easy in Nemerle:

def factorial(x) { if (x == 0) 1 else x * factorial(x - 1) }

You don't need forward declarations for this, and Nemerle does not support them.

Regards,
  -- Ivan.

четвер, 30 травня 2019 р. 16:43:20 UTC+2 користувач David Ben-Michael написав:
Reply all
Reply to author
Forward
0 new messages