"Steven D'Aprano" <[EMAIL PROTECTED]> reasonably corrected my view
thusly: 

I wrote:

>> I think you may have hit upon a bug.

Steven replied: 

> I don't think so. That seems like expected behaviour to me.
> 
>> I put the following into the message box:
>> 
>> answer value("This is my dog.")
>> 
>> and it returned a "double binary operator" and flagged the
>> word "is" as a bad token. Evidently it was trying to evaluate
>> the trueness or falseness of the expression containing "is".
> 
> Well, the error message is a little less than user friendly, but value
> attempts to evaluate its arguments as a Metacard expression. So of
> course it tries to compare "This" with "my dog".
> 
> I'm not sure why it fails instead of returning false. I suspect it may
> have something to do with missing quotes around each substring.
> 
>> However, you would think that the value of a
>> string would be the string.
> 
> Then what is value("1+1")? Should it be the string "1+1"? Or the
> expected result of 2?
> 
> The value of a string being the same string pretty much defeats the
> purpose of having a value function. Why do you need a function that does
> nothing?
> 
> Think of value() as stripping a single pair of quotes from a string and
> treating the result as a Metacard expression. Then:
> 
> value(quote & "green_eggs and ham" & quote)
> 
> will return the string "green_eggs and ham", but
> 
> value("green_eggs and ham")
> 
> will attempt to evaluate the variable green_eggs and do a Boolean AND
> with the variable ham.
> 
> Why say
> 
> answer value("3 = 2+1")
> 
> when all you really need is
> 
> answer "3 = 2+1"
> 
> ?
Stephen, you are right. Sometimes it is hard for us hypercarders to make the
switch. MetaCard has so much more power in so many areas, but it takes time
to get used to the new models. I had a horrible time with backgrounds and
groups for about two weeks because I didn't completely understand the new
model. Now I see MC's model as superior, and love it -- though there are a
few unintended consequences now and again as models get mixed.... (wry
grin).

Value is one of the HC statements that gets used for strings because HC
doesn't have some of MC's features.

Thanks for the help.

Raymond 
> -- 
> Steven D'Aprano


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to