# function application f//x when the function has more than one parameter [closed]

I want to use the function apply (or something even better).

x//f


with a function that has more than one parameter. Here is how it works with one parameter.

data = Dataset[<|"a" -> <|"x" -> 1, "y" -> 2, "z" -> 3|>,
"b" -> <|"x" -> 5, "y" -> 10, "z" -> 7|>|>]
pullz[x_] := x[[All, "z"]]
data // pullz


Here is the two parameter version

pull[x_, c_] := x[[All, c]]
data // pull


Here is the desired result

pull[data, "z"]


I want to add the parameter "z" to the two parameter version and still use //

Thanks for the help: Here is what I actually used in my code, as learned from the input here

r1 = tables // pull[#, "TABLE_NAME"] & //
Select[#, StringStartsQ[#, "Patient"] &] &


I added the suggestion, My tables actually comes from the SQL query:

SELECT * FROM Experiments.INfORMATION_SCHEMA.TABLES WHERE TABLE_TYPE \
= 'BASE TABLE'


Here is the modified Mathematica code

pull[c_][x_] := pull[x, c]
tNames = tables //
pull["TABLE_NAME] // Select[StringStartsQ[" Patient "]]

• data//pull[#, "z"]& – user6014 Aug 8 at 15:01
• @user6014 I got so close, I tried that but without the & – Harlan Nelson Aug 8 at 15:17
• Slots (#) almost always need a trailing & somewhere. – user6014 Aug 8 at 15:17
• I would suggest you define the operator form pull[c_][x_] := pull[x,c]. Then you can write the last line as r1 = tables // pull["TABLE_NAME"] // Select[StringStartsQ["Patient"]] (note that both Select and StringStartsQ also have an operator form). The nice thing about operator forms is that you can omit the # & & stuff in many cases. – Lukas Lang Aug 8 at 15:42
• A roundabout way :) : data // List // Append@"x" // Apply@pull – Michael E2 Aug 8 at 16:14