RE: Usage of "//" Operator with Multiargument Functions
- To: mathgroup at smc.vnet.net
- Subject: [mg45269] RE: [mg45249] Usage of "//" Operator with Multiargument Functions
- From: "David Park" <djmp at earthlink.net>
- Date: Wed, 24 Dec 2003 17:42:27 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Harold, This is one of the many places where pure functions come in handy. tb = Table[0, {i, 1, 10}, {j, 1, 10}] // MatrixForm // Extract[#, {1}] & and in general if you want to use // with a function that has more than one argument use a pure function. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Harold Noffke [mailto:Harold.Noffke at wpafb.af.mil] To: mathgroup at smc.vnet.net Hello. The following code will produce the result of "beheading" MatrixForm from a 10x10 nested List of "0" elements ... [1] tb = Table[0, {i, 1, 10}, {j, 1, 10}] // MatrixForm; Extract[tb, {1}] However, if I change [1] to include a second "//" to accomplish the same thing, I get this ... [2] tb = Table[0, {i, 1, 10}, {j, 1, 10}] // MatrixForm // Extract[<?>, {1}] This does not work at all, no matter what I use to replace the "<?>", which is just my ad-hoc symbol for, "I don't know what to put here." When I look in the Mathematica index of Operator Input Forms, I find ... [3] expr1 // expr2 == expr2[expr1] The "==" in [3] is another ad-hoc symbol of mine, which means Operator Form "is the same as" FullForm. Now we get to my puzzlement. If expr2 takes multiple arguments, how do we denote the results of evaluating expr1, as in my "<?>" in [2]? Thanks for any help or clarifications on this. My best guess at the moment is that Mathematica has no way to do this, which would make "expr1 // expr2" be NOT fully equivalent to "expr2[expr1]". Harold