1 vote
48 views

### Find the arity of any function [duplicate]

First an example: f[x_,y_]:=x+y would have arity 2 because it takes 2 inputs while the function g[x]:=0 has arity 1, even though ...
• 71
157k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
5k views

### Automatically generating a dependency graph of an arbitrary Mathematica function?

Has anyone written a function to pull the function dependencies of a function? That is, it would be nice to have a function that returns a list of function dependencies as a set of rules, terminating ...
• 1,417
1k views

### What can I use as the second argument to Return in my own functions?

Having found out about the second argument to Return I played a bit with it, and the following tests all resulted in ...
• 19.2k
2k views

### How can I get the number of slots in Function?

Suppose that I define f = Function[#1 + #2]; And I want to define a new function, argsNum, so that it returns a number of ...
• 369
588 views

### How to get the parameter number of inbuilt function

I want to make a custom function parameterNumber,which can return the parameter number of inbuilt function,as the Plot's ...
• 26.9k
546 views

### How to write a function-defining function which stores the function arguments in a stack?

I have a function-defining function SetAttributes[DefFn, HoldAll]; DefFn[f_[args___], body_] := f[args] := body; I am trying to modify this function to record ...
• 2,125
324 views

### Using Through with SlotSequence

I have an expression consisting of a few pure functions added together like so: f+g+h I want to add the bodies of these functions together and make that a pure ...
• 1,099
256 views

### Automatization of SyntaxInformation and argx?

Does anybody have a good way to automate the setting of SyntaxInformation for any custom function? I have a ton of functions for which I want to set SyntaxInformation, and doing it by hand seems a ...
• 6,041
186 views

### How many arguments does a function require, and how to use that in Manipulate

The goal is to vary the order parameters in wavelet transforms in the Manipulate environment. The various transformations have arguments of different rank. For ...
• 1,092
265 views

### Create jacobian Function from a vector Function

This is related to this question and maybe this question. I wanted a function that takes an n-parameter vector function and outputs a Jacobian matrix function, also n-parameter. I think this works: <...
• 363
279 views

### Meta information about function parameters

I'm working on a project that allows for executing arbitrary, user-defined Mathematica scripts. It's an internal tool running on a trusted, local network. It's basically a web interface to Mathematica....
• 153
278 views

### Examine function parameters programmatically

I write a lot of scripts in Mathematica and I'd like to eliminate the boilerplate that parses command-line arguments and assigns them to variables of the correct type before doing the real work. I was ...
• 269
1 vote