Page 1 of 1

nested defs

PostPosted: Thu Oct 16, 2008 3:49 pm
by relez
Is it possible to use nested function?
That is something like this Python code:
Code: Select all
def sqg(num):
 def f():
  return num + num
 return f
sqg2 = sqg(2)
print sqg2()


I tried of course ma Cobra compiler seems to refuse....

Re: nested defs

PostPosted: Thu Oct 16, 2008 7:00 pm
by Charles
Not yet, but I'm favor of nested methods. Just haven't gotten there.

You can add a new ticket if you want to make sure that this doesn't get lost between the cracks. The login/password for the Trac/wiki/tickets is the same as your discussion forum account.

http://cobra-language.com/trac/cobra/report/1

Re: nested defs

PostPosted: Fri Oct 17, 2008 3:21 pm
by relez
Ok, there is the ticket #49