Behavior of Longest
- To: mathgroup at smc.vnet.net
- Subject: [mg107909] Behavior of Longest
- From: dh <dh at metrohm.com>
- Date: Tue, 2 Mar 2010 07:54:27 -0500 (EST)
Hello,
can somebody give an explanation for the following behavior of Longest
(mma version 7.0.1):
{1, 2} /. Longest[x__Integer]:>{x} gives {{1}, {2}}
the same as Shortest:
{1, 2} /. Shortest[x__Integer]:>{x} gives {{1}, {2}}
However, it works like expected in the following case:
{a, 1, 2, b} /. {x1___, Longest[x__Integer], x2___} :> {x1, {x}, x2}
gives: {a, {1, 2}, b}
looks like a bug to me.
Daniel
--
Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:dh at metrohm.com>
Internet:<http://www.metrohm.com>
- Follow-Ups:
- Re: Behavior of Longest
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Behavior of Longest
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Behavior of Longest
- From: Patrick Scheibe <pscheibe@trm.uni-leipzig.de>
- Re: Behavior of Longest
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Behavior of Longest