one question that came to my mind at some point.
given that some standard higher order applicatives exist
(map/reduce/filter/fold)
are there standard higher order operatives?
does that makes sense?
if it makes sense and there aren't standard ones, can we think of some?
I don't know, but it reminds me of this post:
http://www.eighty-twenty.org/index.cgi/tech/scheme/fexprs-remain-inscrutable-20110929.html
I feel that we need a lot more work with operatives in order to classify
different types of operatives and use cases to warrant a more
widespread use of higher order operatives.
is no. Only "wrap" comes close, as it works with wide range of
operatives. There exists a paper about variants of wrap providing
lazy and parallel evaluation of arguments:
http://faculty.cs.byu.edu/~jay/conferences/2013-tfp/proceedings/tfp2013_submission_20.pdf
Usually, each operative defines its own little language with its ownWhat about higher-order combiners that welcome both applicative and
operative combiners as arguments? Thanks!
syntax and semantics (see e.g. $let, $if, $define!). It is hard to
imagine a high-order combiner which could be useful with all of
them.
For example one that takes a short-circuiting boolean function (like $and? or $or?),
In[9]:= Sqrt[Unevaluated[3 + 6]]
Out[9]= 3
In[10]:= Sqrt[Hold[3 + 6]]
Out[10]= Sqrt[Hold[3 + 6]]
In[11]:= Sqrt[Hold[Evaluate[3 + 6]]]
Out[11]= Sqrt[Hold[9]]
Now, Mathematica is a rewriting system, so things are a tad different, but this idea holds promise for me. Instead of having first-class operatives, we could have first-class blocks of code. Then a "higher-order operative" would simply be a higher-order function that accepts blocks of code as arguments.
On Mar 20, 2014 3:19 PM, "Brandon Bloom" <brandon...@gmail.com> wrote:
>
> Now, Mathematica is a rewriting system, so things are a tad different, but this idea holds promise for me. Instead of having first-class operatives, we could have first-class blocks of code. Then a "higher-order operative" would simply be a higher-order function that accepts blocks of code as arguments.
What operations would these "blocks of code" have? If the only operation they support is "eval" they aren't different from promises which kernel already has.
While smalltalk uses this idea of "blocks of code" quite heavily, in the lisp world (even in the scheme camp) there is a tendency to use special forms (operatives in kernel). It's only natural that in some cases higher order things need to be done with them.
As you say, working with operatives in this way is hard at first, but no one forces you to do it :) You can always use applicatives, thunks, promises or whatever thing you can come up with.
Regards,
Andres Navarro