MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

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>



  • Prev by Date: Re: Harmonic Numbers
  • Next by Date: Re: edge labels
  • Previous by thread: Re: CONDITION/DATA ANALYSIS/PLOTS
  • Next by thread: Re: Behavior of Longest