Re: $PreRead
- To: mathgroup at smc.vnet.net
- Subject: [mg20666] Re: $PreRead
- From: "David Bailey" <db at salford-software.com>
- Date: Sun, 7 Nov 1999 02:10:04 -0500
- Organization: University of Salford, Salford, Manchester, UK
- References: <7vrc6l$2ng@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
N Monomachoff <nmonomachoff at email.msn.com> wrote in message news:7vrc6l$2ng at smc.vnet.net... > Section 2.13.1 of the Mathematica Book, v3 gives: > > In[1]:=$PreRead = StringReplace[#, {"<<" -> "{", ">>" -> "}"}]& > > And now, supposedly > > In[2]:=<<4,5,6>> > Out[2]:={4,5,6} > > But when I try this, I get an "Incomplete expression" error. > I even get that error when I try to remove the value with > > $PreRead=. > > This would be quite a useful function if I could get it to work. > Does anyone have suggestions? I'm using 3.0.1.1 on win98. > > N Monomachoff > nmonomachoff at msn.com > The same thing happens with Mathematica 4.0. I experimented by using a function which would print out the value and then just return the value unchanged: $PreRead = (Print[# // FullForm]; #) & Using your input I get the following: RowBox[List[RowBox[List["<<", "4"]], ",", "5", ",", RowBox[List["6", ">>"]]]] In other words, it would seem that PreRead is actually given a box structure if used from a notebook. I guess you could manipulate this structure to get what you want, but notice that the RowBox structures are not nested correctly to produce a list. David Bailey Salford Software