[Omake] Higher-order functions with "export transparency"?

Jason Hickey jyh at cs.caltech.edu
Thu Oct 25 14:59:18 PDT 2007


On Oct 25, 2007, at 12:16 PM, Aleksey Nogin wrote:

> On 25.10.2007 11:10, Jason Hickey wrote:
>
> As I said at the end of my previous message, I am starting to suspect
> that the real problem is that the foreach concept is simply _not_
> expressible as a HO function - all our attempts to make it into a HO
> function keep making us consider adding more and more features to the
> language (curry, private exports, etc). I thing that Python got it
> right
<snip>

I think I agree.

The "solution" in old-0.9.9 is that foreach (and similar builtin  
functions) is a special function that threads the exports, ignoring  
the static nesting rules.  The final export still obeys the rules, so  
the end result is the same.

I hadn't thought about the curry case--I think it works, but I have  
to look into it more.

For the general topic of specials: Unfortunately, the existence of  
special functions complicates the semantics.  Users can't define  
special primitives of their own.  You can't define a "foreach"  
function on your own, even by using a while-loop...  In the end,  
though, I don't know if I can say whether foreach-as-special-function  
or foreach-as-language-primitive (Python-style) is better.

Jason

--
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257





More information about the OMake-Devel mailing list