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


Groups > comp.soft-sys.math.mathematica > #3279 > unrolled thread

Re: pattern example

Started byBob Hanlon <hanlonr@cox.net>
First post2011-06-24 11:50 +0000
Last post2011-06-24 11:50 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: pattern example Bob Hanlon <hanlonr@cox.net> - 2011-06-24 11:50 +0000

#3279 — Re: pattern example

FromBob Hanlon <hanlonr@cox.net>
Date2011-06-24 11:50 +0000
SubjectRe: pattern example
Message-ID<iu1tm7$9kd$1@smc.vnet.net>
$Version

"8.0 for Mac OS X x86 (64-bit) (February 23, 2011)"

f[3/5, 4, 5, 2/3] /. f[x : (_Integer | _Rational) ..] :> {x}

{3/5, 4, 5, 2/3}


Bob Hanlon

---- Francisco Gutierrez <fgutiers2002@yahoo.com> wrote: 

=============
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


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web