Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9504
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: evaluate to True? |
| Date | 2012-04-07 10:01 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jlp396$17c$1@smc.vnet.net> (permalink) |
| References | <201204061001.GAA23045@smc.vnet.net> |
You mean MemberQ rather than ModuleQ. In MemberQ[list, expr_] a blank
(with or without a name for the blank) matches anything.
{MemberQ[{a}, _],
MemberQ[{"a"}, _],
MemberQ[{Indeterminate}, _],
MemberQ[{ComplexInfinity}, _],
MemberQ[{Plot[x, {x, 0, 1}]}, _]}
{True, True, True, True, True}
Bob Hanlon
On Fri, Apr 6, 2012 at 6:01 AM, Christoph Lhotka
<christoph.lhotka@fundp.ac.be> wrote:
> Hello,
>
> I found and interesting subject of discussion in the post
>
> "Bug in pattern test, or I did something wrong?"
>
>
> I could trace back the problem to an issue with ModuleQ.
>
> Question: Why does
>
> In[12]:= ModuleQ[{0,1,2},expr_]
>
> Out[12]:= True
>
> evaluate to True?
>
>
> My argumentation is as follows:
>
> On the one hand there could be a chance that expr_ is 0,1 or 2 but on
> the other
> hand the probability that expr_ is not 0,1 or 2 is even higher. As a
> conclusion it should neither
> evaluate to True nor to False.
>
> In other words: Is there any reason why the expression of everything
> (named expr)
> is contained in the set {0,1,2} ?
>
> Best,
>
> Christoph
>
--
Bob Hanlon
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: evaluate to True? Bob Hanlon <hanlonr357@gmail.com> - 2012-04-07 10:01 +0000
csiph-web