# Tag Info

Accepted

### Meaning of ## #

Plus[## #] & is the same as Plus[Times[##, #1]], which always computes to the same as the simpler ...
• 236k
Accepted

### How to supply argument to pure function when slot is already defined?

If you don't want to follow some suggestions made in comments and use the Function with named arguments (and there may be valid reasons to be willing to avoid that),...
• 115k

### What is the difference between a variable and a "slot variable"?

In my experience the two forms have equivalent functionality. The slot-based version is very compact. The named-variable version can be more readable, particularly if embedded inside another pure ...
• 67.5k
Accepted

### Applying Function with SlotSequence and Lists

User Michel E2 has already given a good answer. An alternative is to use (hat tip to Kuba for their suggestion): Fold[Apply, MyFunction, {{1, 2, 3}, {4, 5, 6}}] ...

### Applying Function with SlotSequence and Lists

This gets the desired result: (MyFunction @@ #1) @@ #2 & @@ {{1, 2, 3}, {4, 5, 6}} (* MyFunction[1, 2, 3][4, 5, 6] *)
• 240k

### Application of # for the $n^{th}$ derivative

Rule-replacement with x^n_. :> Derivative[n,0][a][y,z] (as done in Kuba's answer) has two drawbacks: if your polynomial has a constant term, then it will not be ...
• 1,979
Accepted

### When applying (@@) a function to a list of potential arguments, how can Slot be used to take the last argument?

As you already observed, Slot[-1] is not valid syntax in the same way as Slot[1]. The only way I can think of to do what you ...
• 24.1k

### What is the difference between a variable and a "slot variable"?

It is a bit exotic, but #0 as a reference to the whole pure function is only possible with the slot notation, AFAIK. It makes possible to define recursive pure functions. There are other posts on this ...
• 23.6k

...
• 161k
Accepted

### Drop 1st element of {#a, #b, #c} &

You could pass it to Delete: Delete[#, {1, 1}] &[{#a, #b, #c} &] {#b, #c} &
• 20.4k

### bind specific 'Slots' to specific 'Map'

You can do it even without slots: Map[Map[Flatten @* List] @* FoldList[List]] @ test ...
• 399k

### explanation of #1 and #2

If you know any other modern programming language you find similar constructs that are usually called Anonymous or Lambda functions. They have their origin in the Lambda calculus and they are called ...
• 113k

### When applying (@@) a function to a list of potential arguments, how can Slot be used to take the last argument?

{StringRiffle[{#1, #2}], #3}& @@@ people[[All, {1,2,-1}]] {{John Doe, Canada}, {firstName2 lastName2, country2}, {firstName3 lastName3, country3}} ...
• 20.9k
Accepted

### How to replace a multiple iterator Table to speed up computation

Set A=N[Range[2000]]; B=N[Range[0,Pi,Pi/10000.]]; I will compare ...
• 11.9k

### Apply pattern using a Slot (#) to each list element using a second slot

As requested, Use function definition to separate the two applications of # ...
• 12.3k

### Apply pattern using a Slot (#) to each list element using a second slot

Try also this: ...
• 39.8k

### When applying (@@) a function to a list of potential arguments, how can Slot be used to take the last argument?

I recommend using the operator form of Replace for these tasks, because in those circumstances you can use patterns and give parts of the sequence names. If you ...
• 18.6k
Accepted

...
• 161k

### Drop 1st element of {#a, #b, #c} &

foo = {#a, #b, #c} &; foo[[{1}, 2 ;;]] {#b, #c} & or, but only because we know there won't be any side effects: ...
• 137k

...
• 78.4k
Accepted

### Apply pattern using a Slot (#) to each list element using a second slot

An alternative to the function that @Bill created for applying to more complex arrays is as follows: ...
• 28.7k
Accepted

### Application of # for the $n^{th}$ derivative

{x, x^2, x^2 + x} /. x^n_. :> Derivative[n, 0][a][y, z]
• 137k
Accepted

### Combination of Scan[] and MapIndexed[]. Using an expression with slots corresponding to different functions

You can use the alternative form of anonymous functions with named parameters: Scan[Function[{x}, MapIndexed[Print[(#1 + #2) x] &, {"a", "b", "c"}]], Range[5]] ...
• 70.9k

### Using # and ## in same statement to represent different levels

According to the documentation for Slot: When pure functions are nested, the meaning of slots may become ambiguous, in which case parameters must be specified ...
• 13.9k
Accepted

...
• 161k
Accepted

### Defnining a function with a parameter which is not a slot but a constant

Edit 01 I guess I should've checked the OP's code first, which indeed also seems to work for me. ...
• 4,405

### Table doesn't work with Slot

Shortest would be to use Array: Array[Slot, 5] (* {#1, #2, #3, #4, #5} *)
• 49.1k
Accepted

### Multiple append over a Dataset

This seems to work well for me: ...
• 8,513
Accepted

...
• 161k