c++
std::transform( a.begin(), a.end(), b.begin(), []( int x ){ return func(2*x; } );
my language:
b[] = func( 2 *a[] )
- generates an efficient for loop
- no back inserter needed for std::vector type things.
The least toxic and most interesting social network | https://www.goodreads.com/user/show/28185427-chris-green |
c++
std::transform( a.begin(), a.end(), b.begin(), []( int x ){ return func(2*x; } );
my language:
b[] = func( 2 *a[] )
- generates an efficient for loop
- no back inserter needed for std::vector type things.
dist keyworld for distributed processing in my c++ preprocessor based language:
dist var state : solver // create the var on all nodes
state.iterate() // one iteration on the local copy
dist state.iterate() // iterate on all nodes
var flBest = dist min( state.residual ) // reduction across all nodes
generated c++ code:
sexpr myList = cons( 1, cons( 2, cons( 3, NIL);
int nOne = car( myList); // exception if type mismatch.
flDet = det( myMatrix );
In my custom c++ preprocesor based language I added the ability to define custom prefix operators. They end up being like function calls w/o mandatory parens.
var myList :sexpr = $( 1 2 3 ),
nOne :int = car myList
flDet = det myMatrix //calc determinant