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


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

Re: pattern example

From Tomas Garza <tgarza10@msn.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: pattern example
Date 2011-06-24 11:47 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iu1tgf$9ht$1@smc.vnet.net> (permalink)
References <201106231125.HAA25887@smc.vnet.net>

Show all headers | View raw


I get In[1]:= f[3/5,4,5,2/3]/.f[x:(_Integer|_Rational)..]:>{x}
Out[1]= {3/5,4,5,2/3}
(Mathematica 8.0.1, Windows Vista)
-Tomas

> Date: Thu, 23 Jun 2011 07:25:11 -0400
> From: fgutiers2002@yahoo.com
> Subject: pattern example
> To: mathgroup@smc.vnet.net
>
> I find in Leonid's (Shiffrin) excellent book the following example (p. 122):
> f[3/5,4,5,2/3]/.f[x:(_Integer|_Rational)..]:>{x}
>
> According to the book, this returns {3/5,4,5,2/3}
>
> However, I get (Mathematica 8.0.1, Windows 7) f[3/5,4,5,2/3]
>
> What's wrong?
> Francisco
>

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


Thread

Re: pattern example Tomas Garza <tgarza10@msn.com> - 2011-06-24 11:47 +0000

csiph-web