Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6197

Part // interesting undocumented feature

From "Scot T. Martin" <smartin@seas.harvard.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Part // interesting undocumented feature
Date 2011-11-05 09:51 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j930uu$a9g$1@smc.vnet.net> (permalink)

Show all headers | View raw


A colleague new to Mathematica showed me something that I thought should cause an error:

Part[data[[All,1]]]

Of course, I thought the form should just be "data[[All,1]".

It turns out that there is form of Part that works like an identity function:

In[1]:= Part[5]
Out[1]= 5

Just out of a Mathematica trivia challenge question, can anyone think of an example when this undocumented syntax of Part[ ] could possibly be of use or why the programmers have it as an acceptable syntax?


Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Part // interesting undocumented feature "Scot T. Martin" <smartin@seas.harvard.edu> - 2011-11-05 09:51 +0000
  Re: Part // interesting undocumented feature David Bailey <dave@removedbailey.co.uk> - 2011-11-06 11:03 +0000

csiph-web