Forums

nested defs

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

nested defs

Postby relez » Thu Oct 16, 2008 3:49 pm

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....
relez
 
Posts: 69

Re: nested defs

Postby Charles » Thu Oct 16, 2008 7:00 pm

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
Charles
 
Posts: 2513
Location: Los Angeles, CA

Re: nested defs

Postby relez » Fri Oct 17, 2008 3:21 pm

Ok, there is the ticket #49
relez
 
Posts: 69


Return to Discussion

Who is online

Users browsing this forum: No registered users and 16 guests

cron