home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,064 of 33,346   
   Seungbeom Kim to Roman W   
   Re: Why not add a feature to let lambda    
   29 Mar 12 20:46:02   
   
   9f94e7b9   
   From: musiphil@bawi.org   
      
   On 2012-03-29 10:10, Roman W wrote:   
   > On Thursday, March 29, 2012 5:53:33 AM UTC+1, James K. Lowden wrote:   
   >> On Wed, 28 Mar 2012 13:38:03 -0700 (PDT)   
   >> terminator  wrote:   
   >>   
   >>> I understand that since every lambda is a singleton ,no general type   
   >>> string is provided for them, **but** why should it be anonymous?   
   >>   
   >> Wouldn't a lambda with a name be something we've had from the   
   >> beginning, namely a functor?   
   >   
   > No, because the syntax to declare it would be lighter.   
   >   
   > Haskell has something like that:   
   >   
   > let factorial n = if n == 0 then 1 else n * (factorial (n - 1))   
   >   
   > Simple & powerful.   
      
   long factorial(long n) { return (n == 0) ? 1 : (n * factorial(n - 1)); }   
      
   or   
      
   template    
   T factorial(T n) { return (n == 0) ? 1 : (n * factorial(n - 1)); }   
      
   Isn't this simple and powerful enough?   
      
   --   
   Seungbeom Kim   
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca