Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Strange diference in outputs!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113674] Re: Strange diference in outputs!
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Sun, 7 Nov 2010 05:11:16 -0500 (EST)

----- Original Message -----
> From: "olfa" <olfa.mraihi at yahoo.fr>
> To: mathgroup at smc.vnet.net
> Sent: Saturday, November 6, 2010 4:58:59 AM
> Subject: [mg113648] Strange diference in outputs!
> Hi Mathematica Community
> 
> why the output for Print[Not[ForAll[{x,y},x<y]]] is not the same as
> for
> Print[Not[ForAll[ToExpression["{x,y}"],x<y]]] ?!!
> 
> Thank you.

ForAll has attribute HoldAll. That means its arguments are not evaluated prior to being seen by that code. I've no idea what it does once it gets them (might cook them for dinner, ForAll I know).

To avoid this, use Evaluate:

In[4]:= Not[ForAll[Evaluate[ToExpression["{x,y}"]], x < y]]

Out[4]= \!\(
\*SubscriptBox[\(\[Exists]\), \({x, y}\)]\(x >= y\)\)

Daniel Lichtblau
Wolfram Research




  • Prev by Date: Tag List Protected error
  • Next by Date: Re: Fonts, Formats, and examples as learning tools
  • Previous by thread: Re: Strange diference in outputs!
  • Next by thread: MathOO: Adding Object Orientation to Mathematica