Ben Tilly
unread,Nov 30, 2009, 2:16:44 PM11/30/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SnakE, yuk...@gmail.com, TerryP, golang-nuts
Virtually every dynamic language allows this. Of course there it is
easy because by the time the call is looked up at run time, both
definitions exist.
But the Hugs compiler for Haskell provides an example of a strongly
typed static language that allows this.
http://cvs.haskell.org/Hugs/pages/users_guide/haskell98.html has an
example of two mutually recursive functions which call each other with
the type declaration being automatically correctly figured out by the
compiler.
However the design of that language is sufficiently different from Go
that I would be surprised to see that kind of capacity added to Go.
Cheers,
Ben