5
votes
3answers
396 views

What is the right way to write a function that includes other functions?

I want to include multiple sub functions: $b(x) = 10x$ $w(x) = s + b(x)$ $c(x) = x^2$ into two main functions: $ua(x) = w(x)-c(x)$ $ub(x) = w(x)-c(x)^2$ As a reaction to this answer, I wrote ...
12
votes
4answers
370 views

Equivalent Nested Loop Structure

Consider the following examples: ...
5
votes
1answer
192 views

How to find the name of the current function

I would like to know the name of the current function from within that function. For example, consider the following code ...
12
votes
2answers
230 views

f[arg1, arg2,…,argN] vs. f[{arg1, arg2,…,argN}]

I am trying to reproduce the API of a function (written in R) that accepts an arbitrary number of arguments and handles it the same way as it would handle a single argument that is a list of different ...