Menu

example

Hirotaka NIITSUMA

Scm2Cpp Translation example


(define (fact n)
   (if (= n 0) 1
       (* (fact (- n 1)) n)))

translate to


#include    "scm2cpp.hpp"

template< typename NType >  
typename scm2cpp::make_variant_shrink_over< boost::mpl::vector< int,NType > >::type 
fact( NType  n ) 
{ 
  if( n == 0 ) 
  {  return 1 ; } 
  else 
  { return (fact((n-1))*n) ; }}

You can see detail of


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.