MathGroup Archive 2013

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

Search the Archive

Re: bug or feature ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131282] Re: bug or feature ?
  • From: Sseziwa Mukasa <mukasa at gmail.com>
  • Date: Mon, 24 Jun 2013 03:57:47 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20130624025718.E40906A07@smc.vnet.net>

Position checks the heads of expressions too, try

(Debug) In[7]:= Position[{{1, 2}, {2, 3}, {1,
   4}}, _?(EvenQ[#[[2]]] &), {1}, Heads -> False]

(Debug) Out[7]= {{1}, {3}}


On Sun, Jun 23, 2013 at 10:57 PM, roby <roby.nowak at gmail.com> wrote:

> Dear Group
>
> When trying to evaluate the following code the expected result is returned.
> But strangly there is an error message generated.
> The code should (and does) return the positions of all sublists with an
> even element at the second position.
>
>
>
> Position[{{1, 2}, {2, 3}, {1, 4}}, _?(EvenQ[#[[2]]] &), {1}]
>
> Part::partd: Part specification List[[2]] is longer than depth of object.
> >>
>
> {{1}, {3}}
>
>
>
> Any hints if this a bug or a feature ?
>
> Regards Robert
>
>



  • Prev by Date: another query
  • Next by Date: memory leak with Cuda
  • Previous by thread: Position[] bug or feature ?
  • Next by thread: Re: bug or feature ?