And then for some programming
Apr. 6th, 2014 11:49 pmOh dear, am I tired. (I made some pretty silly test mistakes a few weeks ago, also. Always read the questions in detail, folks![1])
I will say this, however: The functional programming I'm learning about (not what I had a test in) seems to be coloring my thoughts pretty significantly at the moment, because I used some of today's time wondering how to make a C-alike language that would support a more functional style... and I came up with odd syntax like
void foo(int x, int y) = { cout << x << ", " << y << endl; }
("And all functions are simply variables in the global scope") and
But there might be a language that does this already. Though to be powerful enough, this hypothetical C variant should also support type inference, so that higher order functions like imperative_map can work on any and all types. Either that, or it's typename<T> time!
Er, yeah.
( Read more... )
I will say this, however: The functional programming I'm learning about (not what I had a test in) seems to be coloring my thoughts pretty significantly at the moment, because I used some of today's time wondering how to make a C-alike language that would support a more functional style... and I came up with odd syntax like
void foo(int x, int y) = { cout << x << ", " << y << endl; }
("And all functions are simply variables in the global scope") and
void bar() = { void foo(int a) = { return(a + 1); } int an_array[3] = {1, 2, 3}; // increments every element in an_array by 1. imperative_map(an_array, foo, 3); for (int i = 0; i < 3; ++i) { cout << a_list[i] << endl; } }
But there might be a language that does this already. Though to be powerful enough, this hypothetical C variant should also support type inference, so that higher order functions like imperative_map can work on any and all types. Either that, or it's typename<T> time!
Er, yeah.
( Read more... )