Take the 2-minute tour ×
Theoretical Computer Science Stack Exchange is a question and answer site for theoretical computer scientists and researchers in related fields. It's 100% free, no registration required.

Consider a function F that takes a function and produces a function based on structure of the input function. As an example consider F that takes all functions having at least two conditionals and swaps their conditional expressions. so

if condition(a, b, c) then calc1(z) else (calc(y) + (if condition1(a, m, k) then u else p ))

becomes

if condition1(a, b, c) then calc1(z) else (calc(y) + (if condition(a, m, k) then u else p ))

Do functions like these fit into category theory/computational science? How are they called? Would love any pointers on books/wikipedia articles about them.

share|improve this question
    
What do you mean by "takes a function"? What's your input representation? Abstract functions don't have conditionals; only their implementations. –  JɛffE Feb 19 '13 at 18:30
    
lets say functions are represented as a composition of primitive functions. All functional programming languages rely on this way of creating complexity. It strikes me that most functional languages lack reflective capabilities so that the representation of the function itself can be inspected. This is why i ended up asking this question. –  Andrew Butenko Feb 21 '13 at 6:53
add comment

1 Answer

up vote 3 down vote accepted

Indeed there is a Wikipedia entry on metaprogramming. The question "What are staged functions?" on cs.stackexchange is also relevant.

share|improve this answer
    
Cool! i guess staged functions is what i was looking for. never heard of them before. –  Andrew Butenko Feb 21 '13 at 6:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.